404 error on market-data-feed WebSocket authorize despite valid access token

Hi Team,

I am facing a 404 error while trying to connect to the market-data-feed WebSocket.

Details:

  • API Version: v2
  • Broker: Upstox
  • Instrument: NSE_INDEX | Nifty 50
  • Access token: Valid (REST APIs working fine)
  • REST endpoints return live data successfully
  • Issue occurs only for WebSocket authorize / handshake

Flow:

  1. Generate access token via OAuth → success
  2. Call GET /v2/market-data-feed/authorize → returns 404
    Error code: UDAPI100060 (Resource not Found)
  3. As a result, WebSocket connection fails with 404

Observations:

  • Same token works for:
    • /v2/market-quote/quotes
    • historical candles
  • Issue persists across retries and fresh tokens
  • REST fallback works correctly, so this seems WebSocket-specific

Question:
Is there any additional entitlement, plan restriction, or updated endpoint required for market-data-feed WebSocket access?
Or has the authorize endpoint changed recently?

Requesting clarification or confirmation from the API team.

Thanks

@SOURAV_CHI_3001973

The 404 on /v2/market-data-feed/authorize endpoint with error UDAPI100060 is unusual and indicates one of these issues:

DIAGNOSIS CHECKLIST:

Issue 1: Endpoint URL Typo or Incorrect API Version

Make SURE you’re calling the correct endpoint. There might be a version mismatch:

# CORRECT endpoint (v3 feed, v2 authorize)
GET https://api.upstox.com/v3/feed/market-data-feed/authorize
# Note: It's /v3/feed/, NOT /v2/market-data-feed/

# OR the older v2 endpoint (check your SDK docs)
GET https://api.upstox.com/v2/market-data-feed/authorize

ACTION: Double-check your request URL - even small typos cause 404s.


Issue 2: Missing Authorization Header

The authorize endpoint requires proper OAuth header:

import requests

# CORRECT way
headers = {
    "Authorization": f"Bearer {your_access_token}",
    "Accept": "application/json"
}

response = requests.get(
    "https://api.upstox.com/v3/feed/market-data-feed/authorize",
    headers=headers
)

print(f"Status: {response.status_code}")
print(f"Response: {response.json()}")

if response.status_code == 404:
    print("ERROR: Endpoint not found - check URL")
elif response.status_code == 401:
    print("ERROR: Invalid token - regenerate access token")
elif response.status_code == 200:
    auth_uri = response.json()['data']['authorizedRedirectUri']
    print(f"SUCCESS: {auth_uri}")

Issue 3: WebSocket v3 vs v2 API Versioning

Upstox API has different versions. Confirm which you’re using:

Endpoint API Version Notes
/v3/feed/market-data-feed/authorize v3 Recommended - Latest
/v2/market-data-feed/authorize v2 Legacy endpoint (might be deprecated)

If you’re on v2 SDK and the endpoint was removed, that’s why you get 404. Try the v3 endpoint instead.


Issue 4: Account Permissions Check

Verify your account has WebSocket permissions:

# First, test if your token works for REST APIs
headers = {"Authorization": f"Bearer {your_access_token}"}

# Test 1: User profile
test1 = requests.get(
    "https://api.upstox.com/v2/user/profile",
    headers=headers
)
print(f"Profile API: {test1.status_code}")

# Test 2: Market quote
test2 = requests.get(
    "https://api.upstox.com/v2/market-quote/quotes",
    params={"mode": "LTP", "instrumentKey": "NSE_INDEX|Nifty50"},
    headers=headers
)
print(f"Market Quote API: {test2.status_code}")

# Test 3: Authorize (the failing endpoint)
test3 = requests.get(
    "https://api.upstox.com/v3/feed/market-data-feed/authorize",  # Try v3
    headers=headers
)
print(f"WebSocket Authorize: {test3.status_code}")
print(f"Response: {test3.text}")

MOST LIKELY SOLUTION:

Your URL is probably wrong. The endpoint is:

https://api.upstox.com/v3/feed/market-data-feed/authorize

NOT:

https://api.upstox.com/v2/market-data-feed/authorize  ← This might be deprecated

Try changing from v2 to v3 in the endpoint path.


If Still Getting 404 After Trying v3:

  1. Check SDK/Client Library Version:

    import upstox_client
    print(upstox_client.__version__)  # What version are you using?
    
  2. Check Official Docs:

  3. Regenerate Access Token:

    • OAuth tokens can be invalidated
    • Get a fresh token and retry
  4. Contact Upstox Support:
    If error persists after trying v3 endpoint:

    • Error: UDAPI100060 on /v3/feed/market-data-feed/authorize
    • Status: 404 Not Found
    • Access token: Valid (works for other REST endpoints)
    • Include your exact request details

QUICK TEST:

Run this to verify:

import requests

token = "YOUR_ACCESS_TOKEN"
headers = {"Authorization": f"Bearer {token}"}

# Try both endpoints
for endpoint in [
    "https://api.upstox.com/v2/market-data-feed/authorize",
    "https://api.upstox.com/v3/feed/market-data-feed/authorize",
]:
    try:
        resp = requests.get(endpoint, headers=headers, timeout=5)
        print(f"{endpoint}")
        print(f"  Status: {resp.status_code}")
        if resp.status_code == 200:
            print(f"  ✓ SUCCESS: {resp.json()['data']['authorizedRedirectUri'][:50]}...")
        else:
            print(f"  ✗ FAILED: {resp.json()['message']}")
    except Exception as e:
        print(f"{endpoint} - ERROR: {e}")
    print()

Run this and share which endpoint works. The correct one will return 200 with an authorizedRedirectUri in the response.

Let me know the results!

-VENKATA