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

# List Session Thread Items

Page items in a thread session object. Items are sorted by `created_at`.

## **POST** `/revisions/:id/data/query` (Command: `list_session_thread_items`)

### Request Body

| Parameter        | Type    | Required | Description                                                              |
| :--------------- | :------ | :------- | :----------------------------------------------------------------------- |
| `engine`         | string  | Yes      | Must be `workflow_blobhub`.                                              |
| `command`        | string  | Yes      | Must be `list_session_thread_items`.                                     |
| `session_id`     | string  | Yes      | The ID of the session.                                                   |
| `alias`          | string  | Yes      | Alias of the thread session object.                                      |
| `ascending`      | boolean | No       | Sort direction. Default `false` (newest first).                          |
| `created_since`  | string  | No       | Return items with `created_at > created_since`.                          |
| `created_before` | string  | No       | Return items with `created_at < created_before`.                         |
| `cursor`         | string  | No       | Opaque page cursor from a previous response's `cursor`. Omit for page 1. |
| `limit`          | integer | No       | Max items per page, 1–1000 (out-of-range → 400). Default `10`.           |

### Response

| Parameter | Type   | Description                                                              |
| :-------- | :----- | :----------------------------------------------------------------------- |
| `items`   | array  | Page of thread items sorted by `created_at`.                             |
| `cursor`  | string | Opaque cursor for the next page, or `null` when there are no more pages. |

**Pagination.** Pass the response `cursor` back as the request `cursor` to fetch the next page; stop when `cursor`
is `null`. The cursor is opaque — send it back verbatim. This is the same `cursor` + `limit` contract used by every
`list_*` command. The `created_since` / `created_before` timestamps remain available as independent time filters.

### Errors

* `invalid_thread_envelope` — the alias does not exist or its `value.type` is not `"thread"`.
* `invalid_cursor` — the supplied `cursor` is malformed or expired.

### Example

<CodeGroup>
  ```json Request theme={null}
  {
    "engine": "workflow_blobhub",
    "command": "list_session_thread_items",
    "session_id": "sess_001",
    "alias": "onboarding_thread",
    "ascending": false
  }
  ```

  ```json Response theme={null}
  {
    "status": "success",
    "items": [
      {
        "id": "itm_01H...",
        "session_id": "sess_001",
        "revision_id": "rev_001",
        "alias": "onboarding_thread",
        "created_at": "2026-05-22T22:00:01.000000Z",
        "user_id": "usr_002",
        "content": [{ "type": "text", "text": "Hi there!" }]
      },
      {
        "id": "itm_01G...",
        "session_id": "sess_001",
        "revision_id": "rev_001",
        "alias": "onboarding_thread",
        "created_at": "2026-05-22T22:00:00.000000Z",
        "user_id": "usr_001",
        "content": [{ "type": "text", "text": "Hello, world." }]
      }
    ],
    "cursor": null
  }
  ```
</CodeGroup>

### See also

* [BlobHub Worker — thread items](/worker/session-agent-harness/thread-items) — `metadata.type`
  discriminates worker-posted items (`text`, `tool_call`, `tool_result`, `thinking`, `status`,
  `turn_end`, `pending_prompt`, `pending_prompt_resolved`) from plain user posts.
