errorCode":"UDAPI100012","message":"Invalid Endpoint"

errorCode":"UDAPI100012","message":"Invalid Endpoint" this is received as response when I try to hit the API

HttpResponse<String> response = Unirest.post("https://api-v2.upstox.com/feed/market-data-feed")
    .header("Api-Version", "2.0")
    .header("Authorization", "Bearer your_access_token_here")
    .header("Accept", "*/*")
    .header("Content-Type", "application/json")
    .body("{\n  \"guid\": \"someguid\",\n  \"method\": \"sub\",\n  \"data\": {\n    \"mode\": \"full\",\n    \"instrumentKeys\": [\"NSE_INDEX|Nifty Bank\"]\n  }\n}")
    .asString();

Also, to be clear, I did modify the above accordingly for headers.
Basically, I want to get the Live market prices of the stocks.

@Shubham_Sharma

As detailed in the documentation, you should access this API using a WebSocket client via the wss protocol, not https.

The CURL example in the documentation could be misleading, and we plan to revise it soon.

For a concrete example of connecting to the WebSocket in Java, you can review this example. Although it employs the Java SDK provided by Upstox, you should be able to understand the essence of the code and apply the logic to your own situation, particularly if you’re looking to establish a plain HTTP call instead of using the SDK.

Give this approach a try and let us know if it assists you in your implementation.

Thank you!