---
title: "List threads"
method: GET
path: "/v1/threads"
tags: ["mail"]
---

# List threads

`GET /v1/threads`

## Request

- Base URL: `https://botmail.pro`
- URL: `https://botmail.pro/v1/threads`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `bm_session`

Scope: read. Pending claim keys allowed. Newest first. Page by passing
`next_before` as `before` until it is null.

## Query parameters

- `mailbox_id` string
- `folder` 'inbox' | 'sent' | 'archive' | 'starred' | 'spam' | 'trash' | 'held' | 'all'
- `label` string
- `unread` '1'
- `q` string
- `from` string
- `to` string
- `has_attachment` '1'
- `since` string
- `until` string
- `before` string, date-time
- `limit` integer

## Response `200`

Threads.

- object
  - `threads` Thread[], required
    - `id` string, required
    - `mailbox_id` string, required
    - `subject` string, required
    - `snippet` string, required
    - `message_count` integer, required
    - `unread_count` integer, required
    - `last_message_at` string, date-time, required
    - `archived` boolean, required
    - `starred` boolean, required
    - `trashed` boolean, required
    - `spam` boolean, required
    - `labels` string[], required
    - `participants` string[], required: Sender addresses (up to 6).
  - `next_before` string, date-time, nullable, required: Pass as `before` for the next page; null when there are no more.

## Other responses

- `400`: Invalid request (`bad_request` or a more specific code).
- `401`: Missing or invalid credentials (`unauthorized`, `invalid_token`).
- `403`: The credential can't do this (`forbidden`, `csrf`, `account_inactive`, …). Missing scopes are listed in `details.required_scope`; pending keys get a hint to wait for the claim.
- `404`: Not found or not accessible with this credential.

---

[API](https://skmtc.dev/botmail/apis/botmail-api.md) · [All operations](https://skmtc.dev/botmail/apis/botmail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/botmail/apis/botmail-api/revisions/49f736362bf2?raw)
