This is the multi-page printable view of this section.
Search
GET /api/search searches the local cache across every account. By default it
matches metadata only — subject, sender and recipient fields — so even a
large mailbox answers quickly. Set body=1 to extend the query to message
bodies.
| Query | Default | Description |
|---|---|---|
q |
— | Text to look for in the subject, sender and recipient fields (plus snippet and body text when body=1) |
from |
— | Only messages whose sender name or address contains this text |
subject |
— | Only messages whose subject contains this text |
since |
— | Only messages dated on or after this Unix timestamp (seconds) |
until |
— | Only messages dated on or before this Unix timestamp (seconds) |
body |
0 |
1/true also matches the snippet and body text of cached bodies |
account |
0 (all) |
Restrict results to one account ID |
limit |
50 |
Maximum results, capped at 200 |
offset |
0 |
Skip this many results, for paging |
At least one of q, from, subject, since or until is required;
otherwise the endpoint returns 400. An inverted range (since > until) is
also rejected with 400.
Results are message summaries ordered newest first (date descending, ties
broken by id descending), and include the account and mailbox path so you
can tell where each hit lives:
Use read message with a result id to fetch
the full body.
Web interface
- Type in the search box above the message list and press Enter to search all
accounts. Press
/anywhere in the app to jump to the search box. - Each hit carries a chip naming its source account; opening a hit works across accounts.
- Expand Advanced search for sender, subject, date range, and the Also search message body checkbox.
- Press Esc or click the × button to leave the results and return to the previous mailbox.
Scope and limits
- Search covers only locally cached messages. Run a sync first if the mailbox was never fetched.
- Matching is a case-insensitive
LIKEsubstring;%and_in the query are escaped, so they match literally. Sender matching runs over the stored address JSON, so the literal wordsnameandaddresscan also match. body=1only searches bodies that are already cached — Pigeon fetches bodies lazily, so opening messages populates the searchable set over time. Body searches are slower on large mailboxes.- There is no dedicated full-text index yet — predicates run over SQLite’s
LIKE. The date index keeps newest-first paging over the whole cache cheap.
MCP clients can call the equivalent search_messages tool; see
MCP Server.