> ## 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 session events

> Subscribe to a Forward session event stream with SSE.

`GET /api/v1/forward/sessions/{session_id}/events/stream`

Streams session events as Server-Sent Events. The `data` payload uses the same Forward filtering model as the event history endpoint.

## Headers

| Header          | Required | Description                 |
| --------------- | -------- | --------------------------- |
| `Authorization` | Yes      | `Bearer <PAT>`              |
| `Accept`        | Yes      | `text/event-stream`         |
| `Last-Event-ID` | No       | Resume after this Event ID. |

## Path parameters

| Parameter    | Type   | Required | Description |
| ------------ | ------ | -------- | ----------- |
| `session_id` | string | Yes      | Session ID. |

## Query parameters

| Parameter            | Type    | Required | Default | Description                                                 |
| -------------------- | ------- | -------- | ------- | ----------------------------------------------------------- |
| `type`               | string  | No       | -       | Filter by Event type. Comma-separated values are supported. |
| `types[]`            | string  | No       | -       | Array-style Event type filter.                              |
| `include_tool_calls` | boolean | No       | `true`  | Include tool call events.                                   |
| `include_thinking`   | boolean | No       | `true`  | Include thinking events.                                    |

## Example request

```bash theme={null}
curl -N -X GET 'https://api.qoder.com/api/v1/forward/sessions/sess_xxx/events/stream?include_thinking=false' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Accept: text/event-stream"
```

## Example response

**HTTP 200 OK**

```text theme={null}
id: evt_xxx
event: agent.message
data: {"id":"evt_xxx","type":"agent.message","session_id":"sess_xxx","content":[{"type":"text","text":"Here is the analysis result."}],"processed_at":"2026-06-22T11:00:03Z"}

```

## Incremental streaming example

When the Session was created with `incremental_streaming_enabled=true`, the stream can include incremental events before the final `agent.message`.

```text theme={null}
id: evt_start_xxx
event: agent.message_start
data: {"id":"evt_start_xxx","type":"agent.message_start","session_id":"sess_xxx","message_id":"msg_xxx","created_at":"2026-06-22T11:00:01Z"}

id: evt_delta_xxx
event: agent.content_block_delta
data: {"id":"evt_delta_xxx","type":"agent.content_block_delta","session_id":"sess_xxx","message_id":"msg_xxx","index":0,"delta":{"type":"text_delta","text":"Here"},"created_at":"2026-06-22T11:00:01Z"}

```

## Response fields

| Field   | Description                                                                                                       |
| ------- | ----------------------------------------------------------------------------------------------------------------- |
| `id`    | SSE event ID. Equals the Event ID.                                                                                |
| `event` | Event type.                                                                                                       |
| `data`  | Filtered Forward Event JSON. The payload fields follow the Event `type` matrix documented by List Session Events. |

## Errors

| HTTP | Type                    | Code                      | Trigger                                          |
| ---- | ----------------------- | ------------------------- | ------------------------------------------------ |
| 400  | `invalid_request_error` | `invalid_event_cursor`    | `Last-Event-ID` does not belong to this Session. |
| 401  | `authentication_error`  | `authentication_required` | PAT invalid or expired.                          |
| 404  | `not_found_error`       | `session_not_found`       | Session does not exist.                          |

## Notes

* Incremental streaming is controlled by the Session create request and cannot be enabled with this endpoint.
* Unknown Event types are forwarded as envelope-only events when available.
* `include_thinking=false` filters thinking events and recognizable thinking deltas.
* `include_tool_calls=false` filters tool-use events and recognizable tool input/output deltas.

## Related

<CardGroup cols={2}>
  <Card title="Create a session" icon="plus" href="/cloud-agents/api/forward/sessions/create" />

  <Card title="List session events" icon="list" href="/cloud-agents/api/forward/sessions/list-events" />
</CardGroup>
