Search messages (full-text, cross-inbox)
https://myagentmail.com/v1/messages/searchFull-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
querystring | Full-text across subject, body, and participants. |
inboxIdstring | Scope to one inbox. Omit = all inboxes the key can see. |
fromstring | Filter by sender address or domain (substring match). |
tostring | |
participantstring | Match from OR to OR cc (address or domain). |
direction"inbound" | "outbound" | |
afterstring | |
beforestring | |
hasAttachmentboolean | |
attachmentFilenamestring | Match an attachment filename substring (e.g. `invoice`). |
limitinteger | |
offsetinteger |
Responses
resultsobject[] | |
messageIdstring | format: uuid |
threadIdstring | format: uuid |
inboxIdstring | format: uuid |
inboxUsernamestring | |
inboxDomainstring | |
direction"inbound" | "outbound" | enum: "inbound" | "outbound" |
fromstring | |
tostring | |
subjectstring | |
receivedAtstring | format: date-time |
hasAttachmentsboolean | |
snippetstring | ~200 chars of plain body centred on the match. |
totalCountinteger | |
nextOffsetinteger |
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.