WebSocket

WebSocket errors

Error messages and close codes.

Problems with a message you sent come back as an error message, and the connection stays open:

{
  "type": "error",
  "code": "SYMBOL_LIMIT",
  "message": "Your plan allows 60 symbols per connection.",
  "details": { "limit": 60, "requested": 75 }
}

Close codes

CodeMeaningWhat to do
4000Bad messageFix the message format.
4401Missing or invalid keyCheck api_key. Don't retry.
4403Plan doesn't include this streamUpgrade, or use a stream your plan has.
4429Too many connectionsClose another connection first.
1001Server restartingReconnect with backoff.