Skip to content

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"]}'

Add or remove labels of a thread.

thread_id
required
Thread Id
string
/^thr_[0-7][0-9a-hjkmnp-tv-z]{25}$/
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>
default: <= 20 items
remove_labels
Remove Labels

Labels to remove: unread (marks it read) or the project’s own.

Array<string>
default: <= 20 items

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
/^thr_[0-7][0-9a-hjkmnp-tv-z]{25}$/
inbox_id
required
Inbox Id
string
/^inb_[0-7][0-9a-hjkmnp-tv-z]{25}$/
subject
required
Subject
Any of:
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"
}

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.