Stream session events
Establish a WebSocket connection to receive real-time session events. This endpoint requires an `Upgrade: websocket` header and an API key passed as the `token` query parameter; the `Authorization` header is not used. Each server frame is a JSON text message with `type` and `payload`. Broadcast frames also carry a monotonically increasing `sequence`: - `agent`: a session event. `payload.type` names the event (for example `message.updated`, `message.part.updated` or `session.status`) and `payload.properties` carries its data. Message and part payloads use the shapes returned by GET /sessions/{session_id}/messages. - `replay_complete`: `payload` is `{ requestedAfter, sequence }`, sent after replaying missed frames. - `replay_unavailable`: `payload` is `{ requestedAfter, sequence, reason }`; refetch state over HTTP. - `sync_status`: `payload` is `{ requestId?, sequence }`. Events include assistant responses, tool calls, and other session activity.
Establish a WebSocket connection to receive real-time session events. This endpoint requires an Upgrade: websocket header and an API key passed as the token query parameter; the Authorization header is not used.
Each server frame is a JSON text message with type and payload. Broadcast frames also carry a monotonically increasing sequence:
agent: a session event.payload.typenames the event (for examplemessage.updated,message.part.updatedorsession.status) andpayload.propertiescarries its data. Message and part payloads use the shapes returned by GET /sessions/{session_id}/messages.replay_complete:payloadis{ requestedAfter, sequence }, sent after replaying missed frames.replay_unavailable:payloadis{ requestedAfter, sequence, reason }; refetch state over HTTP.sync_status:payloadis{ requestId?, sequence }.
Events include assistant responses, tool calls, and other session activity.
session_id*stringThe unique identifier of the session
token*stringAPI key token used to authenticate the WebSocket connection
upgrade*stringMust be websocket.
Switching Protocols - WebSocket connection established
curl -X GET 'https://your-org.inspect.com/api/public/v1/sessions/string/events?token=string' \ -H 'upgrade: string'