All endpoints

Search messages (full-text, cross-inbox)

GEThttps://myagentmail.com/v1/messages/search

Full-text search across every inbox the key can see (tenant-, workspace-, or inbox-scoped automatically by key tier). Matches subject, plain-text body, and participant addresses. Returns lightweight hits — ids, participants, subject, receivedAt, hasAttachments, and a ~200-character snippet centred on the match — never htmlBody, so results stay small enough for an agent to consume in one call, then fetch the winning message/thread in full.

Query parameters

query
string

Full-text across subject, body, and participants.

inboxId
string

Scope to one inbox. Omit = all inboxes the key can see.

from
string

Filter by sender address or domain (substring match).

to
string
participant
string

Match from OR to OR cc (address or domain).

direction
"inbound" | "outbound"
after
string
before
string
hasAttachment
boolean
attachmentFilename
string

Match an attachment filename substring (e.g. `invoice`).

limit
integer
offset
integer

Responses

200application/jsonOK
results
object[]
messageId
string

format: uuid

threadId
string

format: uuid

inboxId
string

format: uuid

inboxUsername
string
inboxDomain
string
direction
"inbound" | "outbound"

enum: "inbound" | "outbound"

from
string
to
string
subject
string
receivedAt
string

format: date-time

hasAttachments
boolean
snippet
string

~200 chars of plain body centred on the match.

totalCount
integer
nextOffset
integer

Authentication

Send your API key in the X-API-Key header (or Authorization: Bearer <key>). Any prefix accepted by this endpoint — tk_, wk_, ak_, or sa_ — is documented in the key prefix table.