---
title: "List Inbox Labels"
url: "https://docs.yoagent.dev/reference/rest-api/operations/listinboxlabels"
---

# List Inbox Labels

GET

/v0/inboxes/{inbox_id}/labels

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

```js
const response = await fetch("https://api.yoagent.dev/v0/inboxes/inb_01je56wqswfmn9pgbc1wq8tjgq/labels", {
  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/inboxes/inb_01je56wqswfmn9pgbc1wq8tjgq/labels",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    timeout=60,
)
response.raise_for_status()
data = response.json()
```

- api.yoagent.dev/v0/inboxes/{inbox_id}/labels

List an inbox’s labels in name order with how many of its messages carry each: every label of its project (0 too) and the system labels its messages carry (`received`: messages that arrived, `unread`: not read yet); `labels` keeps only those, `system` only system or only the project’s own. `unread_received`: messages that arrived and are not read yet.

## Authorizations

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

## Parameters

### Path Parameters

**inbox_id**

required

_Inbox Id_

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

string

### Query Parameters

**limit**

_Limit_

integer

default: 20 >= 1 <= 100

How many labels 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.

**labels**

_Labels_

Array\<string>

default: <= 20 items

Only these labels (their counts: a folder’s size).

**system**

_System_

Any of:

**boolean**

boolean

**null**

null

Only the system labels (true), or only the project’s own (false).

## Responses

### 200

Successful Response

application/json

_LabelList_

A page of an inbox’s labels with their counts: every own label of its project (0 when no message of the inbox carries it) and the system labels its messages carry; `unread_received` — messages that came in and are not read yet (the Unread folder; Read is `received` less these).

object

**count**

required

_Count_

integer

**next_page_token**

required

_Next Page Token_

Any of:

**string**

string

**null**

null

**labels**

required

_Labels_

Array\<object>

_LabelCount_

A label and how many of the inbox’s messages carry it: one of the project’s own (`label_id`) or a system label (`system`, no id).

object

**label_id**

required

_Label Id_

Any of:

**string**

string

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

**null**

null

**label**

required

_Label_

string

**system**

required

_System_

boolean

**count**

required

_Count_

integer

**unread_received**

required

_Unread Received_

integer

#### Example

```json
{
  "count": 1,
  "next_page_token": null,
  "labels": [
    {
      "label_id": null,
      "label": "unread",
      "system": true,
      "count": 1
    }
  ],
  "unread_received": 1
}
```

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