Update Thread
PATCH
/v0/threads/{thread_id}
curl -s -X PATCH "https://api.yoagent.dev/v0/threads/thr_01je56wqswfmn9pgbc1wq8tjgq" \ -H "Authorization: Bearer $YOAGENT_KEY" \ -H "Content-Type: application/json" \ -d '{"add_labels":["unread"]}'const response = await fetch("https://api.yoagent.dev/v0/threads/thr_01je56wqswfmn9pgbc1wq8tjgq", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.YOAGENT_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "add_labels": [ "unread" ] }),});if (!response.ok) throw new Error(await response.text());const data = await response.json();import os
import requests
response = requests.patch( "https://api.yoagent.dev/v0/threads/thr_01je56wqswfmn9pgbc1wq8tjgq", headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"}, json={ "add_labels": [ "unread", ], }, timeout=60,)response.raise_for_status()data = response.json()Add or remove labels of a thread.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”thread_id
required
Thread Id
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ThreadUpdate
Add or remove labels of a thread.
object
add_labels
Add Labels
Labels to add: unread or the project’s own.
Array<string>
remove_labels
Remove Labels
Labels to remove: unread (marks it read) or the project’s own.
Array<string>
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
ThreadItem
A thread in a list or after a change: no messages.
object
version
required
Version
Goes up by one on every change: of two copies, the one with the higher version is the newer.
integer
thread_id
required
Thread Id
string
inbox_id
required
Inbox Id
string
labels
required
Labels
Array<string>
message_count
required
Message Count
integer
last_message_at
required
Last Message At
string format: date-time
Example
{ "version": 1, "thread_id": "thr_01je56wqswfmn9pgbc1wq8tjgq", "inbox_id": "inb_01je56wqswfmn9pgbc1wq8tjgq", "subject": "Your sign-in code", "labels": [ "received", "unread" ], "message_count": 1, "last_message_at": "2026-12-01T12:00:00Z"}default
Section titled “default”An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.