search_emails_batch
Search up to 20 accounts with one portable query and return one result group per account.
Search up to 20 accounts with one portable query and return one result group per account.
Permissions
Required capabilities: mail.read.
Inputs
| Name | Required | Type | Details |
|---|---|---|---|
accounts | Yes | array of object | None |
query | Yes | string | Typed portable search syntax Minimum length: 1. Maximum length: 2048. |
folder | No | inbox or sent or drafts or archive or spam or trash or all or null | None |
from | No | string or null | Maximum length: 2048. |
to | No | string or null | Maximum length: 2048. |
subject | No | string or null | Maximum length: 2048. |
read | No | boolean or null | None |
starred | No | boolean or null | None |
hasAttachment | No | boolean or null | None |
after | No | string or null | YYYY-MM-DD received date, inclusive in UTC |
before | No | string or null | YYYY-MM-DD received date, exclusive in UTC |
pageSize | No | integer or null | Defaults to 25 Minimum: 1. Maximum: 100. |
includeSnippet | No | boolean or null | Request or suppress message previews |
includeSearchContext | No | boolean or null | Include a match-centered body excerpt; requires a portable text query |
{
"type": "object",
"properties": {
"accounts": {
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"pageToken": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
}
},
"required": [
"accountId"
],
"additionalProperties": false
}
},
"query": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "Typed portable search syntax"
},
"folder": {
"anyOf": [
{
"type": "string",
"enum": [
"inbox",
"sent",
"drafts",
"archive",
"spam",
"trash",
"all"
]
},
{
"type": "null"
}
]
},
"from": {
"anyOf": [
{
"type": "string",
"maxLength": 2048
},
{
"type": "null"
}
]
},
"to": {
"anyOf": [
{
"type": "string",
"maxLength": 2048
},
{
"type": "null"
}
]
},
"subject": {
"anyOf": [
{
"type": "string",
"maxLength": 2048
},
{
"type": "null"
}
]
},
"read": {
"type": [
"boolean",
"null"
]
},
"starred": {
"type": [
"boolean",
"null"
]
},
"hasAttachment": {
"type": [
"boolean",
"null"
]
},
"after": {
"description": "YYYY-MM-DD received date, inclusive in UTC",
"anyOf": [
{
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
{
"type": "null"
}
]
},
"before": {
"description": "YYYY-MM-DD received date, exclusive in UTC",
"anyOf": [
{
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
{
"type": "null"
}
]
},
"pageSize": {
"description": "Defaults to 25",
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 100
},
{
"type": "null"
}
]
},
"includeSnippet": {
"description": "Request or suppress message previews",
"type": [
"boolean",
"null"
]
},
"includeSearchContext": {
"description": "Include a match-centered body excerpt; requires a portable text query",
"type": [
"boolean",
"null"
]
}
},
"required": [
"accounts",
"query"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false
}Last updated
search_emails
Search one account with typed portable syntax. The query supports text, from:, to:, subject:, in:, read and starred states, attachments, and date filters.
send_email
Send an email from a connected mailbox. There are three modes: direct (to, subject and body), an existing draft (draftId), or a reply (replyToMessageId, optionally with replyAll) that takes its recipients, subject and threading from the original. Repeating a successful send with the same idempotencyKey and arguments returns the saved result instead of sending again. Reusing a key with different arguments, or after a failed or uncertain send, returns an error. Confirm with the user when the intent is ambiguous. Add sendAt to any mode to schedule the message instead of sending it now.