GET/inboxes/{inbox_id}/threads/search

Search inbox threads

Searches an inbox’s threads by email text, sender or recipient, attachment presence, and date. Combine filters to find threads matching all specified criteria; email-level filters must match the same email, and results may lag new emails by up to about a minute. Search covers the 10,000 threads with the newest matching email when more than 10,000 threads match.

15 parameters
inbox_idstringrequired
The UUID of the inbox whose threads you want to search. An email address is not accepted.
querystringoptional
Free text to search in subjects, bodies, senders, recipients, and attachment names. Every word must match; use double quotes for an exact phrase and start a word or phrase with `-` to exclude it. Maximum 256 characters and 32 words.
fromarray<string>optional
Comma-separated senders; each value matches part of the sender's address or name without regard to case. Accepts up to 20 values.
toarray<string>optional
Comma-separated recipients, matched like `from`. Accepts up to 20 values.
ccarray<string>optional
Comma-separated CC recipients, matched like `from`. Accepts up to 20 values.
bccarray<string>optional
Comma-separated BCC recipients, matched like `from`. Accepts up to 20 values.
has_attachmentbooleanoptional
Set to `true` to match emails with attachments or `false` to match emails without attachments.
start_datestringoptional
Match emails sent on or after this date. Use a date or ISO 8601 timestamp; timestamps use UTC unless they include an offset.
end_datestringoptional
Match emails sent on or before this date. Use the same date or timestamp formats as `start_date`; a date covers the entire day, while a timestamp is used as given.
foldersarray<string>optional
Comma-separated folders to search: `inbox`, `archive`, `spam`, `sent`, or `trash`. Defaults to `inbox`, or to `inbox,archive,sent` when `labels` is set; `spam` and `trash` are included only when named.
labelsarray<string>optional
Comma-separated label UUIDs; returns threads with any of the specified labels. Accepts up to 50 IDs.
readbooleanoptional
Set to `true` for threads where every email is read, or `false` for threads with at least one unread email.
limitintegeroptional
Number of threads to return. Must be between 1 and 100.
afterstringoptional
Thread ID cursor; returns threads after this cursor. Use a UUID and do not pass it with `before`.
beforestringoptional
Thread ID cursor; returns threads before this cursor. Use a UUID and do not pass it with `after`.

1 status code
200Returns an object with a `data` array of matching threads ordered by most recent activity first, and a `has_more` value indicating whether additional results are available.
objectstringrequired
Type of the response object.
has_morebooleanrequired
Indicates if there are more results available.
dataarray<object>required
The matching threads, most recently active first.

Error handling

The inbox_id path parameter must be a UUID for an inbox; an email address is not accepted. Keep query to 256 characters and 32 words, each sender or recipient filter to at most 20 values, and labels to at most 50 UUIDs; use only the listed folders and true or false for read and has_attachment. Dates must use a date or ISO 8601 timestamp, end_date must not precede start_date, limit must be between 1 and 100, and only one of after and before may be supplied as a thread ID in UUID format.