GET /v1/sessions/{session_id}/threads/{thread_id}/stream
Receives events for a specific session thread in real time through Server-Sent Events (SSE). After the connection is established, the server pushes the thread’s complete event history and continues to stream new events as they occur. Only events belonging to that thread are streamed.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Accept | Recommended | text/event-stream |
Last-Event-ID | No | Resume streaming after this event ID. The ID must belong to the current thread |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID (sess_ prefix) |
thread_id | string | Yes | Thread ID (sthr_ prefix) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | No | Filter by event type. Supports comma-separated values |
types[] | string | No | Array-style alternative to type |
Example Request
Example Response
HTTP 200 OKContent-Type: text/event-stream
Each event follows the standard SSE format. All events include a session_thread_id field:
Child thread created:
Thread Event Types
In addition to the session-level event types, the following thread-specific event types are available:| event (SSE field) | Description |
|---|---|
session.thread_created | A new child thread was created. Includes parent_thread_id, agent_id, agent_version, agent_name, role, created_by_tool_use_id |
session.thread_status_running | Thread started running. Includes agent_name, status |
session.thread_status_idle | Thread returned to idle. Includes status, stop_reason |
session.thread_status_terminated | Thread was archived or terminated. Includes status, stop_reason |
agent.thread_message_sent | Inter-thread message sent. Includes direction, content, from_session_thread_id, to_session_thread_id |
agent.thread_message_received | Inter-thread message received. Includes direction, content, is_error, from_session_thread_id, to_session_thread_id |
session_thread_id field. The session-level event stream (/sessions/{id}/events/stream) includes events from all threads; the thread-level event stream only includes events for the specified thread.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Last-Event-ID does not belong to this thread |
| 401 | authentication_error | PAT invalid or expired |
| 404 | not_found_error | Session or Thread does not exist |
Related
Managed Agents
Understand thread event semantics in multi-agent collaboration.
List Thread Events
Page through a thread’s historical events.
List Session Threads
View all threads in a session.