For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
  • API Reference
      • GETList Inboxes
      • GETGet Inbox
      • POSTCreate Inbox
      • PATCHUpdate Inbox
      • DELDelete Inbox
        • GETList Threads
        • GETGet Thread
        • GETGet Attachment
        • PATCHUpdate Thread
        • DELDelete Thread
LogoLogo
contact@agentmail.ccDiscord
API ReferenceInboxesThreads

Update Thread

PATCH
/v0/inboxes/:inbox_id/threads/:thread_id
PATCH
/v0/inboxes/:inbox_id/threads/:thread_id
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.inboxes.threads.update(
8 inbox_id="inbox_id",
9 thread_id="thread_id",
10)
1{
2 "thread_id": "thread_id",
3 "labels": [
4 "labels",
5 "labels"
6 ]
7}

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.

Was this page helpful?
Previous

Delete Thread

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

inbox_idstringRequired
The ID of the inbox.
thread_idstringRequired
ID of thread.

Request

This endpoint expects an object.
add_labelslist of stringsOptional
Labels to add to thread. Cannot be system labels.
remove_labelslist of stringsOptional

Labels to remove from thread. Cannot be system labels. Takes priority over add_labels (in the event of duplicate labels passed in).

Response

This endpoint returns an object.
thread_idstring
ID of thread.
labelslist of strings
Labels of thread.

Errors

400
Validation Error
404
Not Found Error
422
Unprocessable Error