Skip to main content
GET /api/v1/cloud/sessions/{session_id}/events/stream Streams public Session events as Server-Sent Events. If the Session was created with incremental_streaming_enabled: true, this stream also emits incremental agent events such as agent.message_start, agent.content_block_delta, and agent.message_stop. There is no request parameter to turn incremental events on or off per stream connection; use the Session creation field.

Path parameters

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT
AcceptNoUse text/event-stream
Last-Event-IDNoIf provided, the stream resumes after the specified event ID. Returns 400 if the event ID does not exist, has been archived, or refers to a non-public internal event.

Example request

curl -N -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events/stream" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Accept: text/event-stream"

Stream format

Each event is emitted with standard SSE fields:
id: evt_019e392c0d787cfaa21bda98e06cd913
event: user.message
data: {"id":"evt_019e392c0d787cfaa21bda98e06cd913","type":"user.message","content":[{"type":"text","text":"Hello"}],"processed_at":"2026-05-18T03:40:48.888851795Z"}

id: evt_a1b2c3d4e5f6a7b8
event: agent.message
data: {"id":"evt_a1b2c3d4e5f6a7b8","type":"agent.message","content":[{"type":"text","text":"Hello! How can I help you today?"}],"processed_at":"2026-05-18T03:40:50.123456789Z"}

id: evt_b2c3d4e5f6a7b8c9
event: session.status_idle
data: {"id":"evt_b2c3d4e5f6a7b8c9","type":"session.status_idle","stop_reason":{"type":"end_turn"},"processed_at":"2026-05-18T03:40:50.987654321Z"}
The server sends : heartbeat comment lines periodically to keep the connection alive.

Incremental events

Incremental events are normal SSE messages: the SSE event: field and the JSON data.type field both contain the public event type.
id: evt_019efd3b90007c9b88be2a4e6d8c52a0
event: agent.content_block_delta
data: {"id":"evt_019efd3b90007c9b88be2a4e6d8c52a0","type":"agent.content_block_delta","message_id":"msg_019efd3b8c0d7d48a970f01dd6117d11","index":0,"delta":{"type":"text_delta","text":"Hello"},"processed_at":"2026-06-25T05:23:31.123Z"}
Top-level incremental event types are limited to agent.message_start, agent.content_block_start, agent.content_block_delta, agent.content_block_stop, agent.message_delta, and agent.message_stop. Delta names such as text_delta, thinking_delta, and input_json_delta appear inside agent.content_block_delta.delta.type; they are not top-level event types. See Session schemas.

Errors

HTTPTypeTrigger
400invalid_request_errorLast-Event-ID does not identify a valid public event in this session (the event does not exist, has been archived, or is a non-public internal event)
401authentication_errorPAT invalid or expired
404not_found_errorSession does not exist

Example: 404 Session not found

{
  "error": {
    "message": "Session 'sess_doesnotexist_xxxxxxxxxxxxxxxxxxxxxxxx' was not found.",
    "type": "not_found_error"
  },
  "request_id": "b5822072-f264-48da-9d61-6d48ffb07551",
  "type": "error"
}
See Errors for the full error envelope.

Session event stream

Stream agent thinking, messages, tool calls, and status over SSE.