{"command":{"effect":"read","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Finds threads by the text of their emails, who sent or received them, whether they have attachments, and their dates. Results are ordered by latest activity, newest first, and paginate like the list threads endpoint, so a cursor that is not a thread ID returns a 422. Search can be up to about a minute behind new emails. Different parameters combine, so a thread must match all of them. `folders`, `labels`, and `read` apply to the thread. `query`, `from`, `to`, `cc`, `bcc`, `has_attachment`, `start_date`, and `end_date` must all match the same email in the thread. When any of these email filters is set, the matching email must itself be in one of `folders`. For `sent`, that means an email the inbox sent. When more than 10,000 threads match, search covers the 10,000 with the newest matching email.","properties":{"path":{"type":"object","properties":{"inbox_id":{"type":"string","examples":["b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1"],"description":"The Inbox ID or the inbox email address, such as `support@acme.com`. A value that contains `@` must be a valid email address, and any other value must be a UUID, or the request returns a 422. The address match is case-insensitive and never falls back to the inbox `name`. An address that matches no inbox returns a 404."}},"required":["inbox_id"],"additionalProperties":false},"query":{"type":"object","properties":{"query":{"type":"string","maxLength":256,"examples":["invoice -draft"],"description":"Free text to search for in the subject, body, sender, recipients, and attachment names. Every word must match. Wrap words in double quotes to match an exact phrase. Start a word or quoted phrase with `-` to exclude it. Max 256 characters and 32 words."},"from":{"type":"array","maxItems":20,"items":{"type":"string"},"examples":[["isabella@example.com","carolina@example.com"]],"description":"Comma-separated senders. Each value matches part of the sender's address or name, without case. Returns threads that match any of them. Up to 20 values. Repeating the parameter returns a 422 validation_error."},"to":{"type":"array","maxItems":20,"items":{"type":"string"},"description":"Comma-separated recipients, matched the same way as `from`. Up to 20 values. Repeating the parameter returns a 422 validation_error."},"cc":{"type":"array","maxItems":20,"items":{"type":"string"},"description":"Comma-separated CC recipients, matched the same way as `from`. Up to 20 values. Repeating the parameter returns a 422 validation_error."},"bcc":{"type":"array","maxItems":20,"items":{"type":"string"},"description":"Comma-separated BCC recipients, matched the same way as `from`. Up to 20 values. Repeating the parameter returns a 422 validation_error."},"has_attachment":{"type":"boolean","description":"`true` matches emails with an attachment. `false` matches emails without one. Only the literal values `true` and `false` are accepted."},"start_date":{"type":"string","examples":["2026-09-01"],"description":"Matches emails sent on or after this date. Accepts a date like `2026-09-01` or an ISO 8601 timestamp, in UTC unless the timestamp has an offset. An empty value returns a 422."},"end_date":{"type":"string","examples":["2026-09-30"],"description":"Matches emails sent on or before this date. Same formats as `start_date`. A date covers that whole day, so `start_date=2026-09-01&end_date=2026-09-30` covers all of September. A timestamp is used as given. An `end_date` before `start_date` returns a 422 validation_error. An empty value returns a 422."},"folders":{"type":"array","items":{"type":"string","enum":["inbox","archive","spam","sent","trash"]},"examples":[["inbox","sent"]],"description":"Comma-separated folders to search, for example `inbox,sent`. Repeating the parameter returns a 422 validation_error. A thread is returned when any of its emails is in one of the folders. Defaults to `inbox`, or to `inbox,archive,sent` when `labels` is set. `spam` and `trash` are only included when you name them."},"labels":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid"},"examples":[["7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"]],"description":"Comma-separated label IDs. Returns threads with any of these labels. Up to 50 IDs. An ID that does not exist in the inbox returns a 404. Repeating the parameter returns a 422 validation_error."},"read":{"type":"boolean","description":"`true` returns threads where every email is read. `false` returns threads with at least one unread email. Only the literal values `true` and `false` are accepted."},"limit":{"type":"integer","minimum":1,"maximum":100,"description":"Number of items to return."},"after":{"type":"string","description":"Return items after this cursor."},"before":{"type":"string","description":"Return items before this cursor."}},"required":[],"additionalProperties":false}},"required":["path"],"additionalProperties":false},"name":"Search the threads of an inbox","id":"resend.inboxes.search-threads","example":{"path":{"inbox_id":"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1"}},"maxRequests":1,"summary":false}}