Connection URL
Authentication
Browsers cannot set theAuthorization header on a WebSocket handshake. Instead, pass your Causeloop Bearer JWT as a query parameter:
workspace parameter — the server validates it matches the workspace claim in the token and rejects cross-tenant subscriptions:
Connection lifecycle
1
Open the connection
Connect to the WebSocket endpoint with
token and workspace query params.2
Receive the connected frame
Immediately after accepting, the server sends a
connected frame confirming your workspace and user:3
Receive event frames
The server pushes domain event frames as they occur. See Event types below.
4
Heartbeat
Every 5 seconds the server sends a heartbeat frame. Use this to detect stale connections:
Frame format
All frames share a common envelope:string
required
The event type identifier (see table below).
object
required
Event-specific data. Shape varies by event type.
string (ISO 8601)
required
UTC timestamp of when the event was emitted by the server.
Event types
issue.created payload
issue.status.changed payload
pattern.detected payload
job.updated payload
status is "succeeded", result_url is populated with the download path.
Close codes
Example client
Event bus integration
Server-side routers can push frames directly into the stream using thepublish function (for workspace-wide events) or publish_user (for user-scoped events). This allows any API mutation — creating an issue, updating a recommendation — to fan out a real-time event to all connected clients in that workspace without polling.