Mail

List mail folders

Lists every folder in the mailbox with its message and unread counts.

GET /v1/folders

Permission

The key must be granted mail.folders.read

A key without it gets 403 insufficient_scope, with the missing permission named in details.

Returns every folder rather than a page. A mailbox has tens of them, so paging would mean writing a loop that never runs twice.

Request

curl https://api.veruapis.com/v1/folders \
  -H "Authorization: Bearer vak_live_..."

Response

Field Type Description
id string Use this wherever an endpoint takes a folder_id.
name string The folder's name as it appears in webmail and over IMAP.
message_count integer Messages in the folder, including read ones.
unread_count integer Messages without the read flag.
{
  "data": [
  { "id": "43e01b3d-8560-475f-93e9-c8ce9ddbf1f2", "name": "Archive", "message_count": 1,  "unread_count": 0 },
  { "id": "f76e4983-abfa-4691-9624-a641333b0f07", "name": "INBOX",   "message_count": 98, "unread_count": 1 },
  { "id": "31a40082-7f94-4869-a58e-5fe13b98a76b", "name": "Sent",    "message_count": 15, "unread_count": 0 }
],
  "meta": { "request_id": "req_01j8z9...", "timestamp": "2026-09-02T10:00:00Z" },
  "pagination": { "next_cursor": "eyJ1aWQiOjQyMTF9", "has_more": true, "limit": 25 }
}
Worth knowing

The complete set, not a page: a mailbox has tens of folders, and paging one would mean writing a loop that never runs twice. IMAP synchronisation state (uidvalidity, uidnext) is deliberately not published.

Errors

Every failure uses the same shape, with a stable string code you can branch on. See the error reference.

Related

GET /v1/folders

Runs the real request against your own workspace. The key is used once and never stored.