---
title: "Update thread flags and labels"
method: PATCH
path: "/v1/threads"
tags: ["mail"]
---

# Update thread flags and labels

`PATCH /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 depends on the change: `read` is enough for read/unread;
archived, starred and labels need `send` or `manage`; trashed and
spam need `manage`. Threads the credential can't access are skipped.

## Request body

- object
  - `thread_ids` string[], required
  - `update` ThreadUpdate, required
    - `read` boolean: Scope: read.
    - `archived` boolean: Scope: send or manage.
    - `starred` boolean: Scope: send or manage.
    - `trashed` boolean: Scope: manage.
    - `spam` boolean: Scope: manage.
    - `add_labels` string[]: Scope: send or manage.
    - `remove_labels` string[]: Scope: send or manage.

## Response `200`

Number of threads updated.

- object
  - `updated` integer, required

## 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.

---

[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)
