Get WebSocket connection

get/api/prime/trading/v1/ws

Establish a WebSocket connection to get real-time updates for order books and trade orders.

Request Body

Event subscription details
One of
type string required
The event type (e.g. "subscribe" or "unsubscribe")
channel string required
The subscription channel (e.g. "level2" for order books)
accountId string required
The ID of the account
productId string required
The ID of product. (e.g. "TBTC-TUSD*")
includeCumulative boolean
Include cumulative size in each price level. When `true`, each level is `[price, size, cumulativeSize]` instead of `[price, size]`. `cumulativeSize` is the running total of `size` from the top of that side through the level.
Default: false

101 Response

One of
channel string
The channel name (e.g. "level2").
type string
The type of the response (e.g. "snapshot").
product string
The product name (e.g. "TBTC-TUSD*").
time string <date-time>
The timestamp of the snapshot.
bids array[array]
An array of bid levels `[price, size]` or `[price, size, cumulativeSize]` when `includeCumulative` is true. `cumulativeSize` is the running total of `size` from the top of that side through the level.
string
asks array[array]
An array of ask levels `[price, size]` or `[price, size, cumulativeSize]` when `includeCumulative` is true. `cumulativeSize` is the running total of `size` from the top of that side through the level.
string

403 Response

error string required
errorName string required
reqId string required
context object
Optional structured metadata for REST validation failures. The schema is fixed for client contract stability.
errorName string required
Same value as the top-level errorName.
field string
Request field associated with the validation failure.
message string
Human-readable field-level validation message.