---
title: "List Threads"
url: "https://docs.yoagent.dev/reference/rest-api/operations/listthreads"
---

# List Threads

GET

/v0/threads

```sh
curl -s "https://api.yoagent.dev/v0/threads" \
  -H "Authorization: Bearer $YOAGENT_KEY"
```

```js
const response = await fetch("https://api.yoagent.dev/v0/threads", {
  headers: {
    Authorization: `Bearer ${process.env.YOAGENT_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://api.yoagent.dev/v0/threads",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    timeout=60,
)
response.raise_for_status()
data = response.json()
```

- api.yoagent.dev/v0/threads

List threads of all inboxes, newest first; `inbox_id` narrows it to one inbox.

## Authorizations

- **[ApiKey](https://docs.yoagent.dev/reference/rest-api#apikey)**

## Parameters

### Query Parameters

**limit**

_Limit_

integer

default: 20 >= 1 <= 100

How many items a page holds.

**page_token**

_Page Token_

Any of:

**string**

The next_page_token of the previous page

string

**null**

null

The previous page’s `next_page_token`, for the page after it; omitted: the first page.

**inbox_id**

_Inbox Id_

Any of:

**string**

Inbox id (inb\_…), address or \*@domain (the catch-all)

string

**null**

null

Only this inbox’s threads: its id, address or `*@domain` (the catch-all).

**search**

_Search_

Any of:

**string**

Words to find in mail, all of them: in the subject, body, names, addresses and file names (`or` between words, `-word` to leave out; quotes do not make a phrase)

string

\>= 1 characters <= 200 characters

**null**

null

Threads with a message that matches.

## Responses

### 200

Successful Response

application/json

_ThreadList_

A page of threads.

object

**count**

required

_Count_

integer

**next_page_token**

required

_Next Page Token_

Any of:

**string**

string

**null**

null

**threads**

required

_Threads_

Array\<object>

_ThreadItem_

A thread in a list or after a change: no messages.

object

**version**

required

_Version_

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer

**thread_id**

required

_Thread Id_

string

/^thr\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**inbox_id**

required

_Inbox Id_

string

/^inb\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**subject**

required

_Subject_

Any of:

**string**

string

**null**

null

**labels**

required

_Labels_

Array\<string>

**message_count**

required

_Message Count_

integer

**last_message_at**

required

_Last Message At_

string format: date-time

#### Example

```json
{
  "count": 1,
  "next_page_token": null,
  "threads": [
    {
      "version": 1,
      "thread_id": "thr_01je56wqswfmn9pgbc1wq8tjgq",
      "inbox_id": "inb_01je56wqswfmn9pgbc1wq8tjgq",
      "subject": "Your sign-in code",
      "labels": [
        "received",
        "unread"
      ],
      "message_count": 1,
      "last_message_at": "2026-12-01T12:00:00Z"
    }
  ]
}
```

### default

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: [Errors](https://docs.yoagent.dev/reference/conventions#errors).
