Overview
The CauseFlow Relay exposes a bidirectional WebSocket endpoint using JSON-RPC 2.0 over WSS. Clients use the relay to send commands to AI agents and receive streaming responses without polling. WebSocket URL:wss://relay.causeflow.ai/v1/connect
Required role: admin or member
This is a WebSocket endpoint, not a standard HTTP endpoint. Authenticate using JWT in the
Authorization header during the initial HTTP upgrade handshake.Request headers
JWT Bearer token. Format:
Bearer <your-jwt>.Connection handshake
Connect with theAuthorization header and optional X-Tenant-Id header:
connected notification:
JSON-RPC 2.0 protocol
All messages follow the JSON-RPC 2.0 specification. Requests include anid field; notifications omit it.
Send a command (client → server)
Receive a response (server → client)
Receive a push notification (server → client, no id)
Supported methods
| Method | Direction | Description |
|---|---|---|
investigation.subscribe | Client → Server | Subscribe to live updates for an incident investigation |
investigation.unsubscribe | Client → Server | Stop receiving updates for an investigation |
remediation.subscribe | Client → Server | Subscribe to remediation events for an incident |
ping | Client → Server | Send a keepalive ping |
connected | Server → Client | Sent on successful connection |
investigation.progress | Server → Client | Investigation step completed |
investigation.completed | Server → Client | Full investigation pipeline done |
remediation.proposed | Server → Client | Remediation plan ready for approval |
pong | Server → Client | Response to client ping |
Heartbeat
Send aping every 30 seconds to keep the connection alive through proxies:
1008 (Policy Violation).
Error codes
| Code | Meaning |
|---|---|
-32700 | Parse error — malformed JSON |
-32600 | Invalid request — missing jsonrpc or method |
-32601 | Method not found |
-32602 | Invalid params |
-32001 | Authentication expired — reconnect with fresh JWT |
-32002 | Subscription not found |
Examples
Relay status
Check relay health before connecting
Notifications stream
Alternative: SSE-based event delivery