Skip to content

List Inbox Labels

GET
/v0/inboxes/{inbox_id}/labels
curl -s "https://api.yoagent.dev/v0/inboxes/inb_01je56wqswfmn9pgbc1wq8tjgq/labels" \
-H "Authorization: Bearer $YOAGENT_KEY"

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.

inbox_id
required
Inbox Id

Inbox id (inb_…), address or *@domain (the catch-all)

string
limit
Limit
integer
default: 20 >= 1 <= 100

How many labels a page holds.

page_token
Page Token
Any of:

The next_page_token of the previous page

string

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

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

Successful Response

Media typeapplication/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
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
/^lbl_[0-7][0-9a-hjkmnp-tv-z]{25}$/
label
required
Label
string
system
required
System
boolean
count
required
Count
integer
unread_received
required
Unread Received
integer

Example

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

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.