Skip to main content

Stream thread events

Subscribe to one thread's event stream with SSE.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
AcceptYestext/event-stream
Last-Event-IDNoResume after this Thread Event ID.

Path parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID.
thread_idstringYesThread ID.

Query parameters

ParameterTypeRequiredDefaultDescription
typestringNo-Filter by Event type. Comma-separated values are supported.
types[]stringNo-Array-style Event type filter.
include_tool_callsbooleanNotrueInclude tool call events.
include_thinkingbooleanNotrueInclude thinking events.

Example request

curl -N -X GET 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/threads/sthr_child_xxx/stream' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Accept: text/event-stream"

Example response

HTTP 200 OK
id: evt_xxx
event: agent.thread_message_received
data: {"id":"evt_xxx","type":"agent.thread_message_received","session_id":"sess_xxx","session_thread_id":"sthr_child_xxx","content":"Task received","processed_at":"2026-06-22T11:05:00Z"}

Response fields

FieldDescription
idSSE event ID. Equals the Event ID.
eventEvent type.
dataFiltered Forward Event JSON for the Thread.

Errors

HTTPTypeCodeTrigger
400invalid_request_errorinvalid_event_cursorLast-Event-ID does not belong to this Thread.
401authentication_errorauthentication_requiredPAT invalid or expired.
404not_found_errorsession_not_foundSession does not exist.
404not_found_errorthread_not_foundThread does not exist.

Notes

  • Thread SSE uses the same field-level filtering strategy as Session SSE.
  • Unknown Event types are not dropped; they are downgraded to envelope-only events when available.