---
title: "Update Thread"
method: PATCH
path: "/v0/threads/{thread_id}"
tags: ["Threads"]
---

# Update Thread

`PATCH /v0/threads/{thread_id}`

## Request

- Base URL: `https://api.agentmail.to`
- URL: `https://api.agentmail.to/v0/threads/{thread_id}`
- Auth: HTTP bearer

Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.

## Path parameters

- `thread_id` string, required: ID of thread.

## Request body

- UpdateThreadRequest
  - `add_labels` string[], nullable: Labels to add to thread. Cannot be system labels.
  - `remove_labels` string[], nullable: Labels to remove from thread. Cannot be system labels. Takes priority over `add_labels` (in the event of duplicate labels passed in).

## Response `200`

- UpdateThreadResponse
  - `thread_id` string, required: ID of thread.
  - `labels` string[], required: Labels of thread.

## Other responses

- `400`
- `404`
- `422`

---

[API](https://skmtc.dev/agentmail-to/apis/agentmail-cli-speakeasy-api.md) - [All operations](https://skmtc.dev/agentmail-to/apis/agentmail-cli-speakeasy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentmail-to/apis/agentmail-cli-speakeasy-api/revisions/869b7f1c360c?raw)
