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.seq here echoes the last_seq you sent, or 0 when you omitted it. It is not the head of the stream. The stream head arrives later as stream_seq on scope.confirmed.
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: reconnect with
?last_seq=and readscope.confirmed.resume.replayedmeans the server continued fromlast_seq + 1. - Hydration: when
resumeisgap, or on a first connect, fetch current state via HTTP —/v1/firm-control/users,/v1/firm-control/relationships, positions, balances, and open trades — then follow the live tail. Agapis expected after a few minutes offline, not only after a day.

