# List conversations

GET /v1/inboxes/{inbox_id}/threads

Source: https://cherami.to/docs/api/threads/list-threads



{/* Generated from apps/web/openapi. Edit the contract, not this file. */}

`GET /v1/inboxes/{inbox_id}/threads`

Requires a [Claim-issued API key](https://cherami.to/docs/api#authentication): `Authorization: Bearer YOUR_CREDENTIAL`.

Threads are grouped automatically. They contain ready received messages and sent attempts, including rejected and unknown outcomes.

`GET /v1/inboxes/{inbox_id}/threads?limit=20` returns `200`.

Most recent activity first by default. Accepts the shared [search, filters and ordering](https://cherami.to/docs/guides/search). A conversation matches when one member satisfies every condition. Filtered results additionally include `matching_message_ids` (up to 100, newest first) and `matching_message_count` (total matching members). `subject` is from the earliest surviving message and can be null. Counts include attempts, not just successful correspondence.

## Parameters [#parameters]

| Parameter     | Location | Required | Type                                      | Meaning                                                                                                                                                                                                                                                                                                                                |
| ------------- | -------- | -------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inbox_id`    | path     | Yes      | string                                    | Owned Cherami resource ID returned by the API.                                                                                                                                                                                                                                                                                         |
| `limit`       | query    | No       | integer                                   | Decimal integer without signs, whitespace or leading zeroes. `minimum`: `1` `maximum`: `100` `default`: `20`                                                                                                                                                                                                                           |
| `cursor`      | query    | No       | string                                    | Opaque returned cursor. Keep resource URL, filters and ordering unchanged; stop when next\_cursor is null.                                                                                                                                                                                                                             |
| `query`       | query    | No       | string                                    | Nonempty lexical subject/body search, at most 512 UTF-16 code units and 16 words or closed quoted phrases. Every term must match; no raw FTS operators. Attachments and filenames are excluded.                                                                                                                                        |
| `from`        | query    | No       | string                                    | Exact case-insensitive bare parsed-header address. At most 320 UTF-16 code units before trimming; not the SMTP envelope.                                                                                                                                                                                                               |
| `recipient`   | query    | No       | string                                    | Exact case-insensitive bare parsed-header address. At most 320 UTF-16 code units before trimming; not the SMTP envelope.                                                                                                                                                                                                               |
| `subject`     | query    | No       | string                                    | Case-insensitive literal substring, nonblank and at most 998 UTF-16 code units before trimming.                                                                                                                                                                                                                                        |
| `after`       | query    | No       | string                                    | Inclusive lower service receipt/submission bound. Timezone-qualified valid calendar instant; after must precede before. URL-encode normally, including literal plus signs in offsets. `pattern`: `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z\|[+-]\d{2}:\d{2})$`                                                           |
| `before`      | query    | No       | string                                    | Exclusive upper service receipt/submission bound. Timezone-qualified valid calendar instant; after must precede before. URL-encode normally, including literal plus signs in offsets. `pattern`: `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z\|[+-]\d{2}:\d{2})$`                                                           |
| `labels_all`  | query    | No       | array of [Label](#schema-label)           | Require every listed label. Repeat this parameter per label, never comma-separate. Groups combine with AND; contradictory filters match nothing. Omit unused groups; use labels\_all even for one label. Normalized set order and duplicates do not change cursor scope. `maxItems`: `32`                                              |
| `labels_any`  | query    | No       | array of [Label](#schema-label)           | Require at least one listed label. Repeat this parameter per label, never comma-separate. Groups combine with AND; contradictory filters match nothing. Omit unused groups; use labels\_all even for one label. Normalized set order and duplicates do not change cursor scope. `maxItems`: `32`                                       |
| `labels_none` | query    | No       | array of [Label](#schema-label)           | Exclude any message carrying a listed label; unlabeled messages qualify. Repeat this parameter per label, never comma-separate. Groups combine with AND; contradictory filters match nothing. Omit unused groups; use labels\_all even for one label. Normalized set order and duplicates do not change cursor scope. `maxItems`: `32` |
| `order`       | query    | No       | `"newest"` or `"oldest"` or `"relevance"` | relevance requires query. Listings are live views, not snapshots. `default`: `newest`                                                                                                                                                                                                                                                  |

## curl example [#curl-example]

Replace resource-ID placeholders with returned IDs. Supply `CHERAMI_API_KEY` through your private shell environment.

```sh
curl --silent --show-error --include --request GET \
  "https://cherami.to/v1/inboxes/INBOX_ID/threads" \
  --header "Authorization: Bearer $CHERAMI_API_KEY"
```

## Responses [#responses]

### HTTP 200 [#http-200]

Successful operation; inspect resource state and outcome fields.

* `X-Request-ID`: Support correlation ID, not an idempotency key.

Content type: `application/json`.

| Field         | Required | Type                                            | Meaning and constraints |
| ------------- | -------- | ----------------------------------------------- | ----------------------- |
| `threads`     | Yes      | array of [ThreadSummary](#schema-threadsummary) |                         |
| `next_cursor` | Yes      | string or null                                  |                         |

```json
{
  "threads": [],
  "next_cursor": null
}
```

### HTTP 400 [#http-400]

`invalid_limit`: Use an integer from 1 to 100.

`invalid_cursor`: Use the cursor with its original resource and filters, or restart from the first page. Draft listings instead report invalid\_draft.

`invalid_search`: Correct search terms, filters, timestamps, or ordering. See [search](https://cherami.to/docs/guides/search).

`invalid_labels`: Correct label names, changes, filter groups, or discovery prefix.

* `X-Request-ID`: Support correlation ID, not an idempotency key.

Content type: `application/json`.

[Error](#schema-error)

### HTTP 401 [#http-401]

`unauthorized`: Provide a valid bearer credential. Use [human-approved recovery](https://cherami.to/docs/guides/recovery) if access is lost.

* `X-Request-ID`: Support correlation ID, not an idempotency key.
* `WWW-Authenticate`: `"Bearer"`

Content type: `application/json`.

[Error](#schema-error)

### HTTP 404 [#http-404]

`not_found`: Resource is absent or inaccessible to this account. Reply targets must be in the sending inbox.

* `X-Request-ID`: Support correlation ID, not an idempotency key.

Content type: `application/json`.

[Error](#schema-error)

### HTTP 500 [#http-500]

`internal_error`: Operation failed; a write may already have happened. Follow the operation-specific recovery below.

* `X-Request-ID`: Support correlation ID, not an idempotency key.

Content type: `application/json`.

[Error](#schema-error)

## Schema: Label [#schema-label]

1–128 UTF-8 bytes after trimming. Well-formed Unicode without control characters; case-sensitive.

string. `x-max-utf8-bytes`: `128`

## Schema: ThreadSummary [#schema-threadsummary]

| Field                    | Required | Type            | Meaning and constraints                                                                                                              |
| ------------------------ | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `id`                     | Yes      | string          | Cherami resource ID, distinct from the RFC Message-ID. Use the returned value.                                                       |
| `inbox_id`               | Yes      | string          | Cherami resource ID, distinct from the RFC Message-ID. Use the returned value.                                                       |
| `subject`                | Yes      | string or null  |                                                                                                                                      |
| `last_activity_at`       | Yes      | string          | UTC service instant with milliseconds and Z suffix. `format`: `date-time` `pattern`: `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$` |
| `message_count`          | Yes      | integer         | `minimum`: `0`                                                                                                                       |
| `received_count`         | Yes      | integer         | `minimum`: `0`                                                                                                                       |
| `accepted_count`         | Yes      | integer         | `minimum`: `0`                                                                                                                       |
| `rejected_count`         | Yes      | integer         | `minimum`: `0`                                                                                                                       |
| `unknown_count`          | Yes      | integer         | `minimum`: `0`                                                                                                                       |
| `matching_message_ids`   | No       | array of string | `maxItems`: `100`                                                                                                                    |
| `matching_message_count` | No       | integer         | `minimum`: `0`                                                                                                                       |

## Schema: Error [#schema-error]

| Field   | Required | Type   | Meaning and constraints |
| ------- | -------- | ------ | ----------------------- |
| `error` | Yes      | object |                         |

### `error` fields [#error-fields]

| Field     | Required | Type   | Meaning and constraints                                                                       |
| --------- | -------- | ------ | --------------------------------------------------------------------------------------------- |
| `code`    | Yes      | string | Programmatic error code. Handle unrecognized codes by status and operation-specific recovery. |
| `message` | Yes      | string | Human-readable context, not a stable string to match.                                         |

[HTTP conventions, errors and pagination](https://cherami.to/docs/api/errors) · [Download OpenAPI 3.1](https://cherami.to/openapi.json)
