RiskPilot API
RiskPilot customer API

Live signals (WebSocket)

GET
/api/v1/customer/stream

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.

Live signals (WebSocket) › query Parameters

ticket
​string

One-time ticket (browsers).

lastEventId
​string · pattern: ^\d+$

Resume after this event id.

Live signals (WebSocket) › Responses

Switching protocols; then JSON text messages.

A server message on the stream. `ready` first (lastEventId: the newest event now); then `signal` (id, signal), `heartbeat`, `replayed` after a resume, `reset` (refetch over REST: too many missed or too old), `pong`, and `error` before a close.
type
​string · enum
Enum values:
ready
signal
heartbeat
replayed
reset
pong
error
id
​string

signal: the event id to resume from.

​Signal
lastEventId
​string
code
​string
message
​string

A one-time ticket to open the stream from a browser

POST
/api/v1/customer/stream/ticket

A one-time ticket to open the stream from a browser › Responses

The ticket (valid 60 seconds, once).

ticket
​string
expiresAt
​string · date-time
path
​string

Open this path as a WebSocket (wss:// on the API's host).