Error handling

Errors use a consistent JSON shape with a machine-readable code — over HTTP for REST, and as inline frames on an open stream connection.

REST errors

HTTP responses include a status code and a JSON body:

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key.",
    "status": 401
  }
}
StatusCodeMeaning
400bad_requestMalformed request or filters.
401unauthorizedInvalid or missing API key.
403forbiddenPlan doesn't include this feature.
429rate_limitedToo many requests. Back off.
500internalSomething went wrong on our end.

Stream errors

Subscription rejections and protocol errors arrive as JSON frames on the WebSocket without closing the connection (unless the error is fatal, such as an invalid API key on connect):

{
  "type": "error",
  "code": "forbidden",
  "channel": "trades",
  "message": "Your plan doesn't include this stream."
}
CodeMeaning
bad_requestMalformed subscribe message or filters.
unauthorizedInvalid or missing API key on connect.
forbiddenPlan doesn't include this stream or feature.
rate_limitedToo many subscribe/unsubscribe messages.

Connection-level failures use WebSocket close codes — see Close codes on the Streams page.