WebSocket Protocol

Subscribe, unsubscribe, ping — JSON message protocol.

All communication uses JSON messages over a single WebSocket connection. The protocol supports three operations: subscribe, unsubscribe, and ping.

Subscribe

Start receiving data from a channel:

Request

{"method": "subscribe", "subscription": {"type": "order_statuses"}}
{"method": "subscribe", "subscription": {"type": "order_statuses"}}
{"method": "subscribe", "subscription": {"type": "order_statuses"}}

Response

{"type": "subscription_ack", "subscription": {"type": "order_statuses"}}
{"type": "subscription_ack", "subscription": {"type": "order_statuses"}}
{"type": "subscription_ack", "subscription": {"type": "order_statuses"}}

Unsubscribe

Stop receiving data from a channel:

Request

{"method": "unsubscribe", "subscription": {"type": "order_statuses"}}
{"method": "unsubscribe", "subscription": {"type": "order_statuses"}}
{"method": "unsubscribe", "subscription": {"type": "order_statuses"}}

Response

{"type": "unsubscription_ack", "subscription": {"type": "order_statuses"}}
{"type": "unsubscription_ack", "subscription": {"type": "order_statuses"}}
{"type": "unsubscription_ack", "subscription": {"type": "order_statuses"}}

Error Handling

If you send an invalid channel name or malformed JSON, the server will respond with an error message. Always validate your subscription type against the available channels list.

Info

Subscribing to the same channel twice is a no-op — the server will acknowledge it but you won't receive duplicate messages.

Home

/

Introduction

On this page

Real-Time Streams

/

WebSocket Protocol

Real-Time Streams

/

WebSocket Protocol