---
title: "List session events"
description: "Returns durable agent events in ascending id order. `after` and `before` form an exclusive range; `order` chooses traversal. Page forward with `after` = previous `lastId`, or backward with `before` = previous `firstId`, while `hasMore` is true."
url: "https://www.thecompany.company/docs/api/sessions/list-events"
---

# List session events

> Returns durable agent events in ascending id order. `after` and `before` form an exclusive range; `order` chooses traversal. Page forward with `after` = previous `lastId`, or backward with `before` = previous `firstId`, while `hasMore` is true.

- **Surface:** The App API
- **Endpoint:** `GET https://api.thecompany.company/v1/sessions/{id}/events`
- **Operation ID:** `sessions.listEvents`
- **Authentication:** `Authorization: Bearer <TOKEN>`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | `path` | `string` | Yes |  |
| `types` | `query` | `string` | No |  |
| `tools` | `query` | `string` | No |  |
| `after` | `query` | `string` | No |  |
| `before` | `query` | `string` | No |  |
| `order` | `query` | `string` | No |  |
| `limit` | `query` | `string` | No |  |
| `threadId` | `query` | `string` | No |  |
| `includeHeadId` | `query` | `string \| null` | No |  |
| `view` | `query` | `string \| null` | No |  |

## Responses

### `200` (`application/json`)

Success

Schema: `object`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array<SessionEvent>` | Yes |  |
| `data[].id` | `number` | Yes |  |
| `data[].threadId` | `number` | No |  |
| `data[].at` | `number` | Yes |  |
| `data[].transient` | `boolean` | Yes | True for live-only delta events (text/reasoning/tool-input deltas) that are never persisted or replayed. |
| `data[].payload` | `SessionEventPayload` | Yes | Agent event payload (discriminated by `type`) |
| `firstId` | `number \| null` | Yes | Numeric id of the first item in this page |
| `lastId` | `number \| null` | Yes | Numeric id of the last item (use as `after` for the next page) |
| `hasMore` | `boolean` | Yes | Whether more items exist after this page |
| `settledThroughId` | `integer` | No | Only set for conversation reads. Greatest event id through which this thread’s history may be filtered at the read head. Zero means no history was filtered; omission means no boundary was supplied. |
| `headId` | `number` | No | Newest durable event id across the whole session log at read time, unaffected by the page filters (types, threadId). Lets a filtered read resume the event stream without a separate head probe. Optional: absent while the serving actor predates the field. |

Example:

```json
{
  "data": [
    {
      "id": 1,
      "threadId": 1,
      "at": 1,
      "transient": true,
      "payload": {}
    }
  ],
  "firstId": 1,
  "lastId": 1,
  "hasMore": true,
  "settledThroughId": 0,
  "headId": 1
}
```

### `401` (`application/json`)

AuthenticationError

Schema: `AuthenticationError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `reason` | `string` | Yes |  |
| `description` | `string` | No |  |

Example:

```json
{
  "_tag": "AuthenticationError",
  "reason": "invalid_session",
  "description": "string"
}
```

### `402` (`application/json`)

OrganizationUnsubscribedError

Schema: `OrganizationUnsubscribedError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `code` | `string` | Yes |  |

Example:

```json
{
  "_tag": "OrganizationUnsubscribedError",
  "code": "ORGANIZATION_UNSUBSCRIBED"
}
```

### `403` (`application/json`)

ActorUnauthorizedError | UnauthorizedError | IdentityMismatchError | RequestedOrganizationError

Schema: `ActorUnauthorizedError | UnauthorizedError | IdentityMismatchError | ...`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `$ (ActorUnauthorizedError)._tag` | `string` | Yes |  |
| `$ (UnauthorizedError)._tag` | `string` | Yes |  |
| `$ (UnauthorizedError).entity` | `string` | Yes |  |
| `$ (UnauthorizedError).action` | `string` | Yes |  |
| `$ (IdentityMismatchError)._tag` | `string` | Yes |  |
| `$ (RequestedOrganizationError)._tag` | `string` | Yes |  |
| `$ (RequestedOrganizationError).reason` | `string \| null` | Yes |  |

Example:

```json
{
  "_tag": "ActorUnauthorizedError"
}
```

### `404` (`application/json`)

SessionNotFoundError

Schema: `SessionNotFoundError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `id` | `string` | Yes | TypeID with prefix "asess_". |

Example:

```json
{
  "_tag": "SessionNotFoundError",
  "id": "asess_01jd8z3k5q0b6f2m4r7t9v1x3c"
}
```

### `410` (`application/json`)

SessionRuntimeGoneError

Schema: `SessionRuntimeGoneError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `id` | `string` | Yes | TypeID with prefix "asess_". |

Example:

```json
{
  "_tag": "SessionRuntimeGoneError",
  "id": "asess_01jd8z3k5q0b6f2m4r7t9v1x3c"
}
```

### `429` (`application/json`)

RateLimitExceededError

Schema: `RateLimitExceededError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `resource` | `string` | Yes | Rate-limited resource bucket the request was counted against. |
| `retryAfter` | `number` | Yes |  |

Example:

```json
{
  "_tag": "RateLimitExceededError",
  "resource": "string",
  "retryAfter": 1
}
```

### `500` (`application/json`)

InternalError

Schema: `InternalError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |

Example:

```json
{
  "_tag": "InternalError"
}
```

### `502` (`application/json`)

ActorActionError

Schema: `ActorActionError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `code` | `string` | Yes |  |
| `acceptedEvents` | `integer` | No |  |
| `totalEvents` | `integer` | No |  |

Example:

```json
{
  "_tag": "ActorActionError",
  "code": "string",
  "acceptedEvents": -9007199254740991,
  "totalEvents": -9007199254740991
}
```

### `503` (`application/json`)

ActorUnavailableError

Schema: `ActorUnavailableError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |

Example:

```json
{
  "_tag": "ActorUnavailableError"
}
```

## Example Request

### cURL

```bash
curl -X GET 'https://api.thecompany.company/v1/sessions/{id}/events' \
  -H 'Authorization: Bearer <TOKEN>'
```

### TypeScript

```typescript
const response = await fetch('https://api.thecompany.company/v1/sessions/{id}/events', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
  },
});
if (!response.ok) {
  throw new Error('HTTP ' + response.status);
}
const data = await response.json();
```
