---
title: "PATCH /threads/{threadId}/labels"
method: PATCH
path: "/threads/{threadId}/labels"
---

# PATCH /threads/{threadId}/labels

`PATCH /threads/{threadId}/labels`

## Request

- Base URL: `https://api.useanima.sh/v1`
- URL: `https://api.useanima.sh/v1/threads/{threadId}/labels`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Path parameters

- `threadId` string, required: Conversation to relabel — every message in it is updated

## Request body

- object: Add and/or remove labels across a whole conversation in one atomic write. Supply at least one of addLabels/removeLabels. Use this rather than looping over PATCH /messages/{id}/labels: a loop that fails partway leaves the thread in two folders at once.
  - `addLabels` string[]: Labels to add to every message in the thread. Adding `read` removes `unread` and vice versa, per message, exactly as the single-message route does.
  - `removeLabels` string[]: Labels to remove from every message in the thread.

## Response `200`

OK

- object: Result of relabelling a conversation
  - `threadId` string, required: The conversation that was relabelled
  - `updatedCount` integer, required: How many messages were written. Zero means the thread does not exist or is not yours — it is never a silent success.

---

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