Fluxmail

Search emails batch

Search up to 20 accounts with one portable query and return one result group per account.

search_emails_batch

Search up to 20 accounts with one portable query and return one result group per account.

Permissions

Required capabilities: mail.read.

Inputs

NameRequiredTypeDetails
accountsYesarray of objectNone
queryYesstringTyped portable search syntax Minimum length: 1.
folderNoinbox or sent or drafts or archive or spam or trash or all or nullNone
fromNostring or nullNone
toNostring or nullNone
subjectNostring or nullNone
readNoboolean or nullNone
starredNoboolean or nullNone
hasAttachmentNoboolean or nullNone
afterNostring or nullYYYY-MM-DD received date, inclusive in UTC Minimum length: 1.
beforeNostring or nullYYYY-MM-DD received date, exclusive in UTC Minimum length: 1.
pageSizeNointeger or nullDefaults to 25 Minimum: 1. Maximum: 100.
includeSnippetNoboolean or nullRequest or suppress message previews
includeSearchContextNoboolean or nullInclude a match-centered body excerpt; requires a portable text query
{
  "type": "object",
  "properties": {
    "accounts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "pageToken": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "accountId"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 20
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Typed portable search syntax"
    },
    "folder": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "inbox",
            "sent",
            "drafts",
            "archive",
            "spam",
            "trash",
            "all"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "from": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "subject": {
      "type": [
        "string",
        "null"
      ]
    },
    "read": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "starred": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "hasAttachment": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "after": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "description": "YYYY-MM-DD received date, inclusive in UTC"
    },
    "before": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "description": "YYYY-MM-DD received date, exclusive in UTC"
    },
    "pageSize": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        {
          "type": "null"
        }
      ],
      "description": "Defaults to 25"
    },
    "includeSnippet": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Request or suppress message previews"
    },
    "includeSearchContext": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Include a match-centered body excerpt; requires a portable text query"
    }
  },
  "required": [
    "accounts",
    "query"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Last updated

On this page