Skip to content

List Messages

GET
/v0/messages
curl -s "https://api.yoagent.dev/v0/messages" \
-H "Authorization: Bearer $YOAGENT_KEY"

List messages of all inboxes, newest first, with filters; project_id narrows it to one project, inbox_id to one inbox.

from
From
Any of:
string
>= 1 characters <= 200 characters

A part of the sender’s address or name, in any case.

subject
Subject
Any of:
string
>= 1 characters <= 200 characters

A part of the subject, in any case.

limit
Limit
integer
default: 20 >= 1 <= 100

How many items a page holds.

page_token
Page Token
Any of:

The next_page_token of the previous page

string

The previous page’s next_page_token, for the page after it; omitted: the first page.

project_id
Project Id
Any of:
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/

Only those of this project; omitted: of every project the caller sees.

inbox_id
Inbox Id
Any of:

Inbox id (inb_…), address or *@domain (the catch-all)

string

Only this inbox’s: its id, address or *@domain (the catch-all).

to
To
Any of:
string

Only mail that came to this address.

labels
Labels
Array<string>
default: <= 20 items

Messages that carry all of these.

exclude_labels
Exclude Labels
Array<string>
default: <= 20 items

Messages that carry none of these (received without unread: the Read folder).

search
Search
Any of:

Words to find in mail, all of them: in the subject, body, names, addresses and file names (or between words, -word to leave out; quotes do not make a phrase)

string
>= 1 characters <= 200 characters

Only mail with these words.

after
After
Any of:
string format: date-time

Only mail received after this time.

before
Before
Any of:
string format: date-time

Only mail received before this time.

Successful Response

Media typeapplication/json
MessageList

A page of messages.

object
count
required
Count
integer
next_page_token
required
Next Page Token
Any of:
string
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

{
"count": 1,
"next_page_token": null,
"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.