WebSocket streams require a Bearer token. Create an Agent Key from the Terminal to get started.
SDKs (recommended)
The WebSocket protocol involves session bootstrapping, Pusher-compatible handshakes, and channel authorization. We strongly recommend using an official SDK instead of implementing this yourself:TypeScript SDK
Full WebSocket support with typed events and automatic reconnection.
Rust SDK
Async streams via
futures::Stream with typed payloads and auto-reconnect.- TypeScript
- Rust
Raw protocol details
The rest of this page describes the underlying WebSocket protocol. You only need this if you’re building a custom client without an SDK.How it works
There is no static WebSocket URL. The connection details are discovered dynamically through a session bootstrap call to the same REST API:Bootstrap a session
POST to The response includes a
/api/v2/ws/session with the streams you want to subscribe to. The response contains the WebSocket host, port, app key, and resolved subscription channels.connection object with wsHost, wsPort, appKey, and forceTls fields.Open WebSocket connection
Construct the WebSocket URL from the session response and connect:Wait for the
pusher:connection_established message to get your socket_id.Stream discovery
Get the full catalog of available streams and their filters at any time:Stream types
| Type | Auth required | Description |
|---|---|---|
| Public | API key only | Market data streams anyone can subscribe to |
| Presence | API key + channel auth | User-specific streams (portfolio, automation, personal signals) |
Connection states
| State | Description |
|---|---|
Disconnected | No active connection |
Connecting | Handshake in progress |
Connected | Ready to subscribe and receive events |
Reconnecting | Connection lost, attempting to reconnect |
Failed | Connection failed permanently |
Event format
All stream events arrive as JSON with the following structure:data field contains the stream-specific payload described in the Stream Catalog.