Skip to main content
Trade API (64)

Why does my WebSocket keep disconnecting?

Check the close code:

  • 4401: your token expired at 06:00 IST or the key was revoked. Get a new token and reconnect.

  • 4408: your code didn't reply to the server's ping within 15 seconds. The server pings every 30 seconds.

  • 4409 (order updates only): your code was reading messages too slowly.

  • 4429: you opened more than 5 connections.

  • 4403: your token doesn't have permission for this stream.

After reconnecting, subscribe to your instruments again. Anything that happened while you were disconnected isn't replayed.