Email

Search mail by meaning and by words

Searches the mailboxes you may read, or one mailbox with mailbox. Hybrid by default: the message embedding (pgvector, cosine) and the weighted words index are fused by reciprocal rank with a small recency boost, in one statement; why tells which branch matched. Gmail operators in q: from: to: cc: subject: label: filename: mailbox: is:unread|read|starred|unstarred has:attachment in:inbox|archive|sent|spam|trash|anywhere after:2026/08/01 before: newer_than:7d older_than:2w (h/d/w/m/y), "a phrase", -word or -from: to exclude, a OR b. A query made of operators alone lists the matching messages newest first (why: filter). Sign-in codes and links, spam and system mail are never indexed; mailboxes listed in the assistant's search_opt_out_mailbox_ids are searched by words only. A token bound to an agent identity searches only the mailboxes its agent operates. Requires email:read. Without email:auth_secrets, inbound authentication mail is left out before ranking: no word, operator or filter matches it, so a search for a sign-in code finds nothing.

get/api/emails/search

Request

  • Base URL: https://domani.run
  • URL: https://domani.run/api/emails/search
  • Auth: HTTP bearer

Query parameters

mailboxstring

Restrict to one mailbox address (slug@domain).

qstring required

What you are looking for, in any language: a name, a reference, or a description of the mail, plus Gmail operators (from:dave is:unread newer_than:7d -invoice "exact phrase").

mode'hybrid' | 'semantic' | 'keyword'

hybrid fuses the embedding and the words by rank; semantic uses the meaning only; keyword the words only.

limitinteger

Results to return.

sincestring date-time

Only mail received after this ISO timestamp.

untilstring date-time

Only mail received before this ISO timestamp.

folder'inbox' | 'archive' | 'sent' | 'spam' | 'trash' | 'anywhere'

One folder. Trash is excluded unless named or anywhere.

fromstring

Sender address contains.

labelstring

Comma-separated labels: only messages carrying any of them

Response

Ranked results

mode'hybrid' | 'semantic' | 'keyword'
querystring
took_msinteger
hintstring

Changes

No recorded changes to this operation across all 2 revisions of this API.