Skip to the documentation
API

Count the mail in each folder

What the sidebar of the app shows, for every folder and every address.

GET/threads/counts

Runs the real call on your workspace.

GET /threads/counts

What the sidebar of the app shows, for every folder and every address.

Example

Needs threads:read. folders has a row for inbox, sent, spam, archive, trash and snoozed, each with how many conversations it holds and how many of them are unread, then unread, whose count is the unread conversations in the inbox. addresses counts the inbox conversations that arrived at each address, with null for mail that recorded none.

curl
curl "$OE/threads/[email protected]" -H "$AUTH"
Response
{  "object": "mailbox_counts",  "folders": [    { "label": "inbox", "count": 412, "unread": 9 },    { "label": "sent", "count": 188, "unread": 0 },    { "label": "spam", "count": 3, "unread": 3 },    { "label": "archive", "count": 1270, "unread": 0 },    { "label": "trash", "count": 41, "unread": 1 },    { "label": "snoozed", "count": 2, "unread": 0 },    { "label": "unread", "count": 9, "unread": 9 }  ],  "addresses": [{ "address": "[email protected]", "count": 412 }]}

A key or an app limited to particular addresses counts only the mail that arrived at them. address narrows every count to one address, and an address outside what the key reaches counts nothing rather than failing.

Reference