Skip to content

Update Messages

POST
/v0/messages/update
curl -s -X POST "https://api.yoagent.dev/v0/messages/update" \
-H "Authorization: Bearer $YOAGENT_KEY" \
-H "Content-Type: application/json" \
-d '{"add_labels":["unread"],"message_ids":["msg_01je56wqswfmn9pgbc1wq8tjgq"]}'

Add or remove labels of messages (up to 200; read is removing unread): all of them or none — one the caller does not see is 404, one it may not change 403. The changed messages as list rows.

Media typeapplication/json
MessagesUpdate

Add or remove labels of messages (read is removing unread): all of them or none.

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
message_ids
required
Message Ids

The messages to change.

Array<string>
>= 1 items <= 200 items

Successful Response

Media typeapplication/json
MessageBatch

The messages a batch changed, as list rows (their labels and version after it).

object
messages
required
Messages
Array<object>
MessageItem

A message in a list: no bodies.

object
version
required
Version

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer
message_id
required
Message Id
string
/^msg_[0-7][0-9a-hjkmnp-tv-z]{25}$/
project_id
required
Project Id
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/
inbox_id
required
Inbox Id
string
/^inb_[0-7][0-9a-hjkmnp-tv-z]{25}$/
thread_id
required
Thread Id
string
/^thr_[0-7][0-9a-hjkmnp-tv-z]{25}$/
envelope_to
required
Envelope To

The address the message came to; null for a message the inbox sent (sent).

Any of:
string
envelope_from
required
Envelope From
string
plus_tag
required
Plus Tag
Any of:
string
from
required
From
Array<object>
Party

A name and address from a header.

object
name
required
Name
string
address
required
Address
string
to
required
To
Array<object>
Party

A name and address from a header.

object
name
required
Name
string
address
required
Address
string
subject
required
Subject
Any of:
string
preview
required
Preview
Any of:
string
labels
required
Labels
Array<string>
size
required
Size
integer
received_at
required
Received At
string format: date-time

Example

{
"messages": [
{
"version": 1,
"message_id": "msg_01je56wqswfmn9pgbc1wq8tjgq",
"project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
"inbox_id": "inb_01je56wqswfmn9pgbc1wq8tjgq",
"thread_id": "thr_01je56wqswfmn9pgbc1wq8tjgq",
"envelope_to": "test@k7m2xq4p.yoagent.email",
"envelope_from": "bounce@example.com",
"plus_tag": null,
"from": [
{
"name": "Example App",
"address": "noreply@example.com"
}
],
"to": [
{
"name": "",
"address": "test@k7m2xq4p.yoagent.email"
}
],
"subject": "Your sign-in code",
"preview": "Your sign-in code is 482913.",
"labels": [
"received",
"unread"
],
"size": 66000,
"received_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.