WebSocket Connections

Use streaming channels for real-time updates and event-driven workflows.

Connection flow

Open a WebSocket session to subscribe to events, stream results, and receive system updates in real time.

Authentication

Send your API key as part of the connection handshake or in an initial authorization message.

Message format

Messages are JSON objects with an action, payload, and optional correlation ID to map responses back to requests.

Reconnect strategy

Implement exponential backoff when reconnecting, and preserve session metadata to continue processing after transient disconnects.

Example event

{
  "action": "response",
  "requestId": "abc123",
  "payload": {
    "status": "completed",
    "result": { ... }
  }
}