Skip to content

Errors

REST errors contain an integer code and string message:

json
{
  "code": 404,
  "message": "market not found"
}
CodeMeaning
400Invalid parameters or malformed channel
404Resource not found
409WebSocket channel already subscribed
429Rate limit exceeded
500Request failed
503WebSocket channel cannot guarantee continuity

Messages are stable and do not expose internal service errors.

WebSocket errors

WebSocket errors use the same numeric code and string message:

json
{
  "type": "error",
  "channel": "orderbook/perp/1",
  "code": 503,
  "message": "stream unavailable",
  "timestamp_ns": "1785441661123456789"
}

A 503 error closes the server-side channel. Discard its local state and subscribe again. After an unexpected connection close, reconnect and restore subscriptions. Correct 400, 404, or 409 errors before retrying.