firm-ws service port are not supported.
Endpoint
Optional query parameter:
Firm API key (primary)
Send the firm key as a header on the upgrade request. The gateway validates it, resolves the firm, and injectsX-Firm-ID before forwarding to firm-ws.
/v1/firm-ws is on the gateway firm-key allowlist.
Staff session (secondary)
Browser-based staff users authenticate through/v1/auth/* and present a session cookie or bearer token. Staff sessions must also send the firm header so the gateway can resolve RBAC:
After the upgrade
Once the WebSocket is established, the server sends a single control frame to confirm the firm scope and the current JetStream cursor:Close codes
In addition to application-level
ping/pong, the server sends standard WebSocket control ping frames roughly every 30 seconds. Most client libraries respond to these automatically.
Hydration vs replay
- Replay (within ~24h): reconnect with
?last_seq=and the server resumes from where you left off. - Hydration (gap beyond retention, or first connect): fetch current state via HTTP in parallel —
/v1/firm-control/users,/v1/firm-control/relationships, Trading API reads — then sendscope.setand process the live stream fromDeliverNew.

