---
title: "List chat threads"
description: "List chat threads for the user with cursor-based pagination.\n\nOptionally filter by agent_id, X-App-Id header, and created_at date range."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: AI Gateway API › History & Feedback

`GET /threads`

List chat threads for the user with cursor-based pagination.

Optionally filter by agent_id, X-App-Id header, and created_at date range.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Query parameters

- `agent_id` (`list_threads.query.agent_id`; any of, optional)
  - any of: `string`, `null`
- `cursor` (`list_threads.query.cursor`; any of, optional)
  - any of: `string`, `null`
- `limit` (`list_threads.query.limit`; integer, optional)
  - default `20`
- `order_by` (`list_threads.query.order_by`; string, optional)
  - default `"created_at"`
- `asc` (`list_threads.query.asc`; boolean, optional)
  - default `false`
- `created_after` (`list_threads.query.created_after`; any of, optional)
  - any of: `string`, `null`
- `created_before` (`list_threads.query.created_before`; any of, optional)
  - any of: `string`, `null`

## Header parameters

- `x-app-id` (`list_threads.header.x-app-id`; any of, optional) — Application ID for scoping threads
  - any of: `string`, `null`
- `X-On-Behalf-Of` (`list_threads.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`list_threads.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`
- `X-App-Id` (`list_threads.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://truememory-api.mvstg.com/threads \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/threads';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/threads"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "threads": [
    {
      "thread_id": "847c6285-8fc9-4560-a83f-4e6285809254",
      "agent_id": "chatbot",
      "app_id": "vibrantly",
      "title": "What is the weather in Tokyo?",
      "metadata": {
        "isPinned": false,
        "source": "whatsapp"
      },
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "next_cursor": "string"
}
```

- `threads` (`list_threads.response.200.threads`; array<object>, required)
  - `thread_id` (`list_threads.response.200.threads.thread_id`; string, required) — Thread ID (session_key).
  - `agent_id` (`list_threads.response.200.threads.agent_id`; string, required) — Agent that handled this thread.
  - `created_at` (`list_threads.response.200.threads.created_at`; string, required) — When the thread was created (ISO 8601).
  - `updated_at` (`list_threads.response.200.threads.updated_at`; string, required) — When the thread was last updated (ISO 8601).
  - `app_id` (`list_threads.response.200.threads.app_id`; any of, optional) — Application scope for this thread. None if unscoped.
    - any of: `string`, `null`
  - `title` (`list_threads.response.200.threads.title`; any of, optional) — Thread title derived from the first user message.
    - any of: `string`, `null`
  - `metadata` (`list_threads.response.200.threads.metadata`; any of, optional) — Arbitrary metadata dict for the thread.
    - any of: `object`, `null`
- `next_cursor` (`list_threads.response.200.next_cursor`; any of, optional) — Cursor for the next page. None if no more results.
  - any of: `string`, `null`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`list_threads.response.422.detail`; array<object>, optional)
  - `loc` (`list_threads.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`list_threads.response.422.detail.msg`; string, required)
  - `type` (`list_threads.response.422.detail.type`; string, required)
  - `input` (`list_threads.response.422.detail.input`; unknown, optional)
  - `ctx` (`list_threads.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/threads/list/index.md
