---
title: "List threads in a mailbox"
method: GET
path: "/v1/mailboxes/{id}/threads"
tags: ["Mailboxes"]
---

# List threads in a mailbox

`GET /v1/mailboxes/{id}/threads`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/mailboxes/{id}/threads`
- Auth: API key in header `x-api-key`

Returns thread summaries, most recent activity first. `after` and `before` filter by last activity, so an agent polling for new mail passes the last time it looked. `q` is a full-text search over subjects, senders, and message text; `folder`, `label`, `unread`, and `starred` narrow the list. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. A thread that gains activity while you page moves ahead of the cursor, so a walk lists each thread at most once.

## Path parameters

- `id` string, required

## Query parameters

- `limit` string, nullable
- `cursor` string
- `after` string, nullable
- `before` string, nullable
- `q` string, nullable
- `folder` 'inbox' | 'assigned' | 'pending' | 'sent' | 'archived' | 'trash'
- `label` string
- `unread` 'true' | 'false', nullable
- `starred` 'true' | 'false', nullable
- `snoozed` 'true' | 'false', nullable

## Response `200`

MailboxThreadPage

- MailboxThreadPage
  - `items` MailboxThreadSummary[], required
    - `id` string, required
    - `channel` 'email', required: The channel an endpoint, thread, or message belongs to.
    - `endpointId` string, required
    - `subject` string, nullable, required
    - `preview` string, nullable, required
    - `from` MailboxThreadSender, required
      - `address` string, nullable, required
      - `displayName` string, nullable, required
    - `messageCount` integer, required
    - `hasAttachments` boolean, required
    - `hasDraft` boolean, required
    - `folder` 'inbox' | 'assigned' | 'pending' | 'sent' | 'archived' | 'trash', required
    - `priority` 'low' | 'normal' | 'high' | 'urgent', required
    - `labels` MailboxLabelId[], required
    - `read` boolean, required
    - `starred` boolean, required
    - `snoozedUntil` string, nullable, required
    - `lastActivityAt` string, required
  - `nextCursor` string, nullable, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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