> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream thread events

> Stream events scoped to one Session thread.

`GET /api/v1/cloud/sessions/{session_id}/threads/{thread_id}/stream`

Streams public events for one thread as Server-Sent Events.

## Path parameters

| Parameter    | Type   | Description                        |
| ------------ | ------ | ---------------------------------- |
| `session_id` | string | Session ID with the `sess_` prefix |
| `thread_id`  | string | Thread ID with the `sthr_` prefix  |

## Headers

| Header          | Required | Description                                                                                                                                                                                          |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Authorization` | Yes      | `Bearer $QODER_PAT`                                                                                                                                                                                  |
| `Accept`        | No       | Use `text/event-stream`                                                                                                                                                                              |
| `Last-Event-ID` | No       | If provided, the stream resumes after the specified event ID. Returns `400` if the event ID does not exist, has been archived, refers to a non-public internal event, or is not part of this thread. |

## Example request

```bash theme={null}
curl -N -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019f00000000000000000000000000aa/threads/sthr_019f00000000000000000000000002bb/stream" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Accept: text/event-stream"
```

## Stream format

```text theme={null}
id: evt_019f00000000000000000000000003cc
event: agent.message
data: {"id":"evt_019f00000000000000000000000003cc","type":"agent.message","content":[{"type":"text","text":"Thread response"}],"processed_at":"2026-06-15T08:02:00.000Z"}

id: evt_c3d4e5f6a7b8c9d0
event: session.thread_status_idle
data: {"agent_name":"my-agent","id":"evt_c3d4e5f6a7b8c9d0","processed_at":"2026-06-15T08:02:01.000Z","session_thread_id":"sthr_019f00000000000000000000000002bb","stop_reason":{"type":"end_turn"},"type":"session.thread_status_idle"}
```

The server sends `: heartbeat` comment lines periodically to keep the connection alive.

## Errors

| HTTP | Type                    | Trigger                                                                                                                                                                                    |
| ---- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 400  | `invalid_request_error` | `Last-Event-ID` does not identify a valid public event in this session/thread (the event does not exist, has been archived, is a non-public internal event, or is not part of this thread) |
| 401  | `authentication_error`  | PAT invalid or expired                                                                                                                                                                     |
| 404  | `not_found_error`       | Session or thread does not exist                                                                                                                                                           |

**HTTP 404 Not Found**

```json theme={null}
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session thread 'sthr_fakefakefake_xxxxxxxxxxxxxxxx' was not found."
  },
  "request_id": "b5822072-f264-48da-9d61-6d48ffb07551"
}
```

See [Errors](/cloud-agents/api/conventions/errors) for the full error envelope.

## Related

<CardGroup cols={2}>
  <Card title="Managed Agents" icon="user-gear" href="/cloud-agents/managed-agents">
    Understand thread event semantics in multi-agent collaboration.
  </Card>

  <Card title="List Thread Events" icon="list" href="/cloud-agents/api/sessions/list-thread-events">
    Page through a thread's historical events.
  </Card>

  <Card title="List Session Threads" icon="layer-group" href="/cloud-agents/api/sessions/list-threads">
    View all threads in a session.
  </Card>
</CardGroup>
