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

### Response

| Parameter | Type  | Description                                  |
| :-------- | :---- | :------------------------------------------- |
| `items`   | array | Page of thread items sorted by `created_at`. |

Page size is server-controlled. Use `created_since` to tail forward from the newest known item; use
`created_before` to paginate backward from the oldest known item.

### Errors

* `invalid_thread_envelope` — the alias does not exist or its `value.type` is not `"thread"`.

### 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}
  {
    "items": [
      {
        "id": "itm_01H...",
        "session_id": "sess_001",
        "revision_id": "rev_001",
        "alias": "onboarding_thread",
        "created_at": "2026-05-22T22:00:01.000000+00:00",
        "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.000000+00:00",
        "user_id": "usr_001",
        "content": [{ "type": "text", "text": "Hello, world." }]
      }
    ]
  }
  ```
</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.
