Skip to main content
Control messages are JSON frames distinguished from event envelopes by the presence of a top-level type field without a schema field. Event envelopes always carry "schema": "ws.firm.v1".

Server → client

connected

Sent exactly once, immediately after the upgrade succeeds.

scope.confirmed

Sent in response to every accepted scope.set.

pong

Reply to client ping.

error

Advisory error for the client. Does not close the socket on its own — the server may follow with a close frame (4001 for auth, 4002 for backpressure).

Client → server

scope.set

See Subscription scopes for the full schema. A second scope.set replaces the previous subscription.

ping

Application-level keepalive. Send every 20–30 seconds. The server also sends standard WebSocket control ping frames at ~30s intervals — most client libraries auto-respond to those.

batch

Only when you connected with ?format=batch. Control frames stay individual messages. Each event inside the array has its own seq. The server flushes every 20 ms, or at 500 events, or at 256 KiB.

Ordering guarantees

  • The server processes client frames in order. A new scope.set stops the previous subscription before events for the new scope are delivered. A later scope.set on the same socket starts at the live tail.
  • seq increases with the shared stream. Delivery to one connection is in seq order. One account stays on one partition, so that account’s events stay ordered.
  • Holes in seq are other firms’ events. They are not missing messages.