Real-time event stream (SSE)
Opens a text/event-stream connection that delivers every event of the account in real time — the same events that travel by webhook, without exposing a public endpoint.
Each event carries id: (monotonic cursor), event: (the event type) and data: (JSON with the same event_id as the webhook, so both channels cross-reference).
Reconnect with the Last-Event-ID header (or ?last_event_id=) and the server replays what you missed before resuming live delivery. Native EventSource cannot send an Authorization header: use fetch with ReadableStream.
Scope follows the credential: an account credential receives its own events; an org-admin credential with ops:read receives the organization-wide channel and can narrow it with ?account_id=.
The connection sends : ping every 20s, revalidates the session every 60s (a revoked session closes the stream with the unauthorized control event) and closes after 30 minutes with a reconnect control event.
Authorizations
Session JWT (from register/login) or API key (pk_...).
X-API-Key: <token> is accepted as an alternative header.
Headers
Reconnection cursor. Alternative to the Last-Event-ID header for fetch clients.
Query Parameters
Reconnection cursor. Alternative to the Last-Event-ID header for fetch clients.
Comma-separated event types to filter. An unknown type returns 400 invalid_event_type.
When true, the first event is snapshot with the absolute current state (balances and, for org-admins, operational health) before the live deltas.
Org-admin only: narrows the org-wide channel to a single account.
Response
Event stream opened. The body stays open and is written incrementally.
The response is of type string.