# Read Automation Email Statistics

Reads what one campaign (automation) or notification email achieved: how many contacts it was sent to, opened and clicked, bounces and spam complaints, and the tracked links with their clicks, most-clicked first -- the numbers of its statistics screen, linked as statisticsUrl. Counters are lifetime totals across every use of the email and are not restricted to a period. A campaign email nothing has been sent of answers with zeroes. A notification email records no sends, opens or link clicks, so sent, opened and clicked are null and links is empty for it; only bounces and complaints are counted. The ID is the email ID from get-automation-email or get-notification-email. For an automation SMS use get-automation-sms-statistics, for a newsletter 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"
    }
  }
}
```

