# Read Automation Email Statistics

Reads the lifetime statistics of one campaign (automation) or notification email: sent, opened, clicked, bounces, spam complaints and tracked links, most-clicked first, as on its statistics screen (statisticsUrl). Counters total every use of the email, with no period filter; a campaign email nothing was sent of answers zeroes. A notification email records no sends, opens or link clicks: sent, opened and clicked are null and links is empty; only bounces and complaints are counted. The ID comes from get-automation-email or get-notification-email. Automation SMS use get-automation-sms-statistics, newsletters get-campaign-statistics.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "emailId": {
      "type": "integer",
      "description": "ID of the campaign or notification email whose statistics are read; this is not an automation action ID",
      "minimum": 1
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "emailId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "emailId",
    "name",
    "kind",
    "sent",
    "opened",
    "clicked",
    "bounces",
    "spamComplaints",
    "links",
    "statisticsUrl"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "emailId": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "automation",
        "notification"
      ]
    },
    "sent": {
      "type": [
        "integer",
        "null"
      ]
    },
    "opened": {
      "type": [
        "integer",
        "null"
      ]
    },
    "clicked": {
      "type": [
        "integer",
        "null"
      ]
    },
    "bounces": {
      "type": "integer"
    },
    "spamComplaints": {
      "type": "integer"
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "url",
          "title",
          "clicksTotal",
          "clicksUnique"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "clicksTotal": {
            "type": "integer"
          },
          "clicksUnique": {
            "type": "integer"
          }
        }
      }
    },
    "statisticsUrl": {
      "type": "string"
    }
  }
}
```

