Stream
Live signals (WebSocket)
A WebSocket (RFC 6455) that pushes every newly released signal your package may see, the same scope as GET /api/v1/customer/signals.
Authenticate with Authorization: Bearer <key or session> on the upgrade request (servers, mobile apps), or with ?ticket= from POST /api/v1/customer/stream/ticket (browsers cannot set headers on a WebSocket; a ticket works once, within 60 seconds). Optional subprotocol: riskpilot.v1.
Resume after a reconnect with ?lastEventId=<id of the last signal you received>: the missed signals are replayed (at most 200) and followed by replayed; when more were missed, or they are older than the retention (72 hours), you get reset and should refetch over REST.
The server sends a ping frame and a heartbeat message every 25 seconds; a client that does not answer pings is disconnected. Send {"type":"ping"} for a pong (at most 20 messages per 10 seconds, 4 KiB each). Close codes: 4401 the credential stopped working, 4402 payment needed, 4403 suspended or not allowed, 4408 no answer to ping, 4409 not reading fast enough, 1008 too many messages, 1001 server restart.
Opening a stream counts one request against your daily and monthly quota; pushed signals count nothing. At most 5 open streams per account.
query Parameters
ticketOne-time ticket (browsers).
lastEventId^\d+$Resume after this event id.
Live signals (WebSocket) › Responses
Switching protocols; then JSON text messages.
typeidsignal: the event id to resume from.
lastEventIdcodemessage