Common messages · WebSocket
See connection, authentication and subscription limits in the WebSocket overview.
Subscription accepted (type: subscribed)
subscribedServer → client
Acknowledges the accepted subscription ID. A missing or blank request ID becomes default.
Message fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Allowed: "subscribed" |
subscription_id | string | Yes | The accepted request id, or default if the request id was omitted or blank. |
Application heartbeat (type: ping)
pingClient → server
The application heartbeat echoes ts in a pong message. It is separate from WebSocket protocol ping/pong frames. The server sends protocol pings every 30 seconds and requires a protocol pong within the 90-second read deadline; browsers handle those frames automatically.
Reply: pong
Message fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Always ping.Allowed: "ping" |
ts | string | No | Opaque value echoed in the pong; defaults to an empty string. Default: "" |
Heartbeat reply (type: pong)
pongServer → client
Echoes the application ping value in ts; it is not a WebSocket protocol pong frame.
Message fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Allowed: "pong" |
ts | string | Yes |
Errors (type: error)
errorServer → client
Subscription validation errors preserve the existing subscriptions and keep the connection open. subscribe_failed is followed by disconnection. Malformed JSON or messages exceeding 64 KiB may close the connection without a JSON error.
| code | Meaning |
|---|---|
invalid_subscription | Invalid quote, channel, symbol, or interval. |
subscription_limit | More than 100 subscriptions on this connection. |
symbol_limit | Symbol quota exceeded, or conflicting all-asset subscription. |
unknown_message | Unsupported message type. |
subscribe_failed | Realtime event service unavailable; reconnect with backoff. |
Message fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Always error.Allowed: "error" |
code | string | Yes | Machine-readable error code; see the error codes above. Allowed: "invalid_subscription", "subscription_limit", "symbol_limit", "unknown_message", "subscribe_failed" |
message | string | Yes | Human-readable details. |
