# Search Emails

Lists the automation and notification emails and SMS of the account -- the "Emails / SMS" overview --, optionally filtered by name and kind, with sent, opened and clicked counts and app links, ordered by ID and paged with a cursor. Read one with get-automation-email, get-notification-email, get-automation-sms or get-notification-sms. Newsletter and follow-up messages are found through their campaigns. Reads only.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": [
        "null",
        "string"
      ],
      "description": "Part of the name, case-insensitive; omit for all",
      "default": null,
      "maxLength": 250
    },
    "type": {
      "type": [
        "null",
        "string"
      ],
      "description": "Only this kind: automation-email, automation-sms, notification-email or notification-sms",
      "default": null,
      "enum": [
        "automation-email",
        "automation-sms",
        "notification-email",
        "notification-sms"
      ]
    },
    "cursor": {
      "type": [
        "null",
        "string"
      ],
      "description": "nextCursor of the previous page; omit for the first page",
      "default": null,
      "maxLength": 200
    },
    "pageSize": {
      "type": "integer",
      "description": "Entries per page, 1 to 100",
      "default": 25,
      "minimum": 1,
      "maximum": 100
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account of the access token",
      "default": null,
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "count",
    "hasNextPage",
    "nextCursor",
    "emails"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "count": {
      "type": "integer"
    },
    "hasNextPage": {
      "type": "boolean"
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "emailId",
          "name",
          "type",
          "sent",
          "opened",
          "clicked",
          "editUrl",
          "statisticsUrl"
        ],
        "properties": {
          "emailId": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "automation-email",
              "automation-sms",
              "notification-email",
              "notification-sms"
            ]
          },
          "sent": {
            "type": "integer"
          },
          "opened": {
            "type": [
              "integer",
              "null"
            ]
          },
          "clicked": {
            "type": "integer"
          },
          "editUrl": {
            "type": "string"
          },
          "statisticsUrl": {
            "type": "string"
          }
        }
      }
    }
  }
}
```

