> ## 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.

# List events

> List public events in a Session.

`GET /api/v1/cloud/sessions/{session_id}/events`

Retrieves public Session events with cursor pagination. If the `Accept` header requests `text/event-stream`, this route switches to SSE streaming; use `Accept: application/json` or omit the SSE media type for the paginated JSON response.

If the Session was created with `incremental_streaming_enabled: true`, the response may include persisted incremental agent events. If the flag is `false` or omitted, incremental events are hidden and only full public events are returned.

## Path parameters

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

## Headers

| Header          | Required | Description         |
| --------------- | -------- | ------------------- |
| `Authorization` | Yes      | `Bearer $QODER_PAT` |

## Query parameters

| Parameter         | Type            | Required | Description                                                                                                           |
| ----------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `limit`           | integer         | No       | Maximum number of events to return. Default 20, range 1-100. Values above 100 return `400 invalid_request_error`.     |
| `page`            | string          | No       | Opaque cursor from a previous response's `next_page`. Mutually exclusive with `before_id` and `after_id`              |
| `before_id`       | string          | No       | Return events ordered before this event ID. Mutually exclusive with `page` and `after_id`                             |
| `after_id`        | string          | No       | Return events ordered after this event ID. Mutually exclusive with `page` and `before_id`                             |
| `order`           | string          | No       | Sort direction: `asc` (default) or `desc`                                                                             |
| `types`           | string or array | No       | Filter by event type. Unrecognized event types are silently ignored — the response simply contains no matching events |
| `created_at[gt]`  | string          | No       | Return events created after this RFC 3339 timestamp                                                                   |
| `created_at[gte]` | string          | No       | Return events created at or after this RFC 3339 timestamp                                                             |
| `created_at[lt]`  | string          | No       | Return events created before this RFC 3339 timestamp                                                                  |
| `created_at[lte]` | string          | No       | Return events created at or before this RFC 3339 timestamp                                                            |

## Example request

```bash theme={null}
curl -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events?limit=5&types=user.message,agent.message" \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "id": "evt_019e392c0d787cfaa21bda98e06cd913",
      "type": "user.message",
      "content": [
        {"type": "text", "text": "Hello, this is a test message."}
      ],
      "processed_at": "2026-05-18T03:40:48.888851795Z"
    },
    {
      "id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
      "type": "agent.message",
      "content": [
        {"type": "text", "text": "Hello! How can I help you today?"}
      ],
      "processed_at": "2026-05-18T03:40:55.123Z"
    }
  ],
  "first_id": "evt_019e392c0d787cfaa21bda98e06cd913",
  "has_more": false,
  "last_id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
  "next_page": null
}
```

## Event types

See [Public event types](/cloud-agents/api/sessions/schemas#public-event-types) for the full set of event types exposed by list and stream endpoints.

For incremental streaming Sessions, use the top-level event types `agent.message_start`, `agent.content_block_start`, `agent.content_block_delta`, `agent.content_block_stop`, `agent.message_delta`, and `agent.message_stop` when filtering `types`. Do not filter by `text_delta` or `input_json_delta`; those are nested `delta.type` values inside `agent.content_block_delta`.

## Response fields

| Field       | Type           | Description                                                                     |
| ----------- | -------------- | ------------------------------------------------------------------------------- |
| `data`      | array          | List of public [Event objects](/cloud-agents/api/sessions/schemas#event-object) |
| `has_more`  | boolean        | Whether more results are available beyond this page                             |
| `first_id`  | string \| null | ID of the first event in the current page                                       |
| `last_id`   | string \| null | ID of the last event in the current page                                        |
| `next_page` | string \| null | Opaque cursor for the next page, or `null` when there are no more results       |

## Errors

| HTTP | Type                    | Trigger                                                                                                                                                  |
| ---- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400  | `invalid_request_error` | Invalid `limit` (non-integer or non-positive), invalid `order`, invalid timestamp filter, or simultaneously providing `page` with `before_id`/`after_id` |
| 401  | `authentication_error`  | PAT invalid or expired                                                                                                                                   |

> **Note:** This endpoint returns HTTP 200 with an empty `data` array for non-existent Session IDs, enabling clients to poll safely. Use `GET /api/v1/cloud/sessions/{id}` to verify Session existence.

### Example: 400 invalid `order`

```json theme={null}
{
  "error": {
    "message": "Field 'order' must be one of: asc, desc.",
    "type": "invalid_request_error"
  },
  "request_id": "74c9b7ee-f2f4-450a-9283-933fd3315cf8",
  "type": "error"
}
```

### Example: 400 invalid `limit`

```json theme={null}
{
  "error": {
    "message": "Field 'limit' must be a positive integer.",
    "type": "invalid_request_error"
  },
  "request_id": "d582074b-11ec-45cb-9c94-929278a19261",
  "type": "error"
}
```

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

## Related

<CardGroup cols={2}>
  <Card title="Session event stream" icon="wave-pulse" href="/cloud-agents/events-stream">
    Stream agent thinking, messages, tool calls, and status over SSE.
  </Card>
</CardGroup>
