Skip to content

List messages​

GET
/api/v1/messages

Returns messages newest first, in arrival order. Page with before: pass the previous response's next_cursor to get the next page. A cursor page costs the same at any depth and does not shift when new mail arrives, where offset does both. offset is still accepted, but not together with before. starred, unread, has_attachments and tag narrow the listing on the server; they combine with AND, with each other and with q. total counts the messages matching q and the filters, before pagination is applied.

Parameters​

Query Parameters

q

Full-text search query (matches subject, body, sender, recipients)

Type
string
limit

Maximum number of results to return. Values outside 1 to 200 (0 and negatives included) are clamped into that range rather than rejected; the response's limit reports the value applied. A value that is not an integer is a 400.

Type
integer
Default
50
offset

Number of results to skip. A negative value is treated as 0. Kept for compatibility; prefer before, which it cannot be combined with.

Type
integer
Default
0
before

Keyset cursor: the id of a message. Returns only messages strictly older than it, in the same order. Use a previous response's next_cursor. Works with q. An id that names no stored message is a 400 with code: unknown_cursor.

Type
string
starred

When true, only starred messages. false does not filter: it is the same as leaving the parameter out, not its negation. Only the literals true and false are accepted; anything else, 1 included, is a 400. If repeated, the last value wins.

Type
boolean
unread

When true, only messages not marked as read. false does not filter: it is the same as leaving the parameter out, not its negation. Only the literals true and false are accepted; anything else, 1 included, is a 400. If repeated, the last value wins.

Type
boolean
has_attachments

When true, only messages with at least one attachment. false does not filter: it is the same as leaving the parameter out, not its negation. Only the literals true and false are accepted; anything else, 1 included, is a 400. If repeated, the last value wins.

Type
boolean
tag

Only messages carrying this tag, compared exactly and case-sensitively. May repeat (tag=a&tag=b): a message matches if it carries any of the given tags. More than 20 is a 400.

Type
array
Max Items
20

Responses​

Paginated list of message summaries. Sent with Cache-Control: no-store.

application/json
JSON
{
  
"messages": [
  
  
{
  
  
  
"id": "01HZ9RQABCDEFGHJKMNPQRSTUV",
  
  
  
"sender": "alice@example.com",
  
  
  
"recipients": [
  
  
  
  
[
  
  
  
  
  
"bob@example.com",
  
  
  
  
  
"carol@example.com"
  
  
  
  
]
  
  
  
],
  
  
  
"subject": "Hello world",
  
  
  
"size": 1024,
  
  
  
"has_attachments": false,
  
  
  
"is_read": false,
  
  
  
"is_starred": false,
  
  
  
"tags": [
  
  
  
  
[
  
  
  
  
]
  
  
  
],
  
  
  
"created_at": "2026-03-21T10:00:00Z"
  
  
}
  
],
  
"total": 120,
  
"next_cursor": "01HZ9RQABCDEFGHJKMNPQRSTUV",
  
"limit": 50
}

Samples​

Powered by VitePress OpenAPI

Released under the MIT / Apache 2.0 License.