---
title: "Count the mail in each folder"
description: "What the sidebar of the app shows, for every folder and every address."
url: "https://openemail.uk/docs/api/threads/counts"
area: "API"
category: "Mailbox"
---

# Count the mail in each folder

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

`GET /threads/counts`

## 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/counts?address=billing@acme.com" -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": "billing@acme.com", "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

- [`GET /threads/counts`](https://openemail.uk/docs/api/reference/threads#get-threads-counts): full reference
