---
title: "Update a thread"
method: PATCH
path: "/v1/inboxes/{id}/threads/{threadId}"
tags: ["Messages"]
---

# Update a thread

`PATCH /v1/inboxes/{id}/threads/{threadId}`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/v1/inboxes/{id}/threads/{threadId}`
- Auth: API key in header `X-API-Key`

Applies to every message in the thread: labels (replace with `labels`,
or change with `addLabels` / `removeLabels`), read, starred, archived
and spam. Labelling a thread labels each of its messages.

## Request body

- object
  - `labels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `addLabels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `removeLabels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `isRead` boolean
  - `isStarred` boolean
  - `isArchived` boolean
  - `isSpam` boolean: true moves the thread to Spam; false recovers it.

## Response `200`

Updated

- object
  - `updated` boolean
  - `threadId` string
  - `messageCount` integer
  - `labels` string[]

## Other responses

- `400`: Request body failed schema validation
- `404`: Resource not found

---

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