Search mail
Requires scope: read. Full-text search over received and sent mail (subject, body text and addresses), newest first. Each hit says whether it was received or sent and carries a snippet around the match. Never leaves the workspace; a key tied to one agent searches that agent's mail; a test key searches test mail only and a live key live mail only. A search that runs past 5 seconds is stopped (400, narrow it), and a workspace may search 120 times a minute (429 with Retry-After past that).
Request
- Base URL: https://api.mails.ai
- URL: https://api.mails.ai/v1/search
- Auth: HTTP bearer
Query parameters
Full-text search: every word must appear in the subject, body or addresses, as a whole word or, from three letters up, the start of one (inv finds invoice). At most 16 different words (more is a 400).
Filter by agent id or name. A key tied to one agent always reads that agent's mail, and naming another agent is a 403.
The sender's address contains this text (the display name, which the sender chooses, is not matched).
A recipient address contains this text.
Only mail at or after this time (ISO 8601, or YYYY-MM-DD).
Only mail before this time (ISO 8601, or YYYY-MM-DD).
true for mail with a file attachment, false for mail without.
Which folder's mail to return, or all for every folder. Without it: every folder except trash.
Only mail in threads carrying this label (a name, or a label id lbl_…).
Only received or only sent mail.
Page size (1–100).
Opaque cursor from a previous page's next_cursor.
Response
A page of hits.
Changes
No recorded changes to this operation across all 1 revision of this API.