# Read Campaign Statistics

Reads lifetime statistics for an email or SMS newsletter or follow-up: sends, opens, clicks, conversions, bounces and tracked links. openRate is per send, clickRate per open, and clickRateOfRecipients per send; use these rates rather than dividing the counters. SMS has no opens or browser views; those fields and clickRate are null. Use clickRateOfRecipients for SMS. An unsent campaign has zero counts. Automations use get-automation-statistics.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "integer",
      "description": "ID of the campaign whose statistics are read",
      "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": [
    "campaignId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "campaignId",
    "name",
    "campaignType",
    "channel",
    "campaignStatus",
    "recipients",
    "sent",
    "failed",
    "opensTotal",
    "opensUnique",
    "openRate",
    "clicksTotal",
    "clicksUnique",
    "clickRate",
    "clickRateOfRecipients",
    "browserViewsTotal",
    "browserViewsUnique",
    "conversionsTotal",
    "conversionsUnique",
    "unsubscriptions",
    "hardBounces",
    "softBounces",
    "spamBounces",
    "spamComplaints",
    "links",
    "statisticsUrl"
  ],
  "properties": {
    "campaignId": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "campaignType": {
      "type": "string"
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms"
      ]
    },
    "campaignStatus": {
      "type": "string"
    },
    "recipients": {
      "type": "integer"
    },
    "sent": {
      "type": "integer"
    },
    "failed": {
      "type": "integer"
    },
    "opensTotal": {
      "type": [
        "integer",
        "null"
      ]
    },
    "opensUnique": {
      "type": [
        "integer",
        "null"
      ]
    },
    "openRate": {
      "type": [
        "number",
        "null"
      ]
    },
    "clicksTotal": {
      "type": "integer"
    },
    "clicksUnique": {
      "type": "integer"
    },
    "clickRate": {
      "type": [
        "number",
        "null"
      ]
    },
    "clickRateOfRecipients": {
      "type": "number"
    },
    "browserViewsTotal": {
      "type": [
        "integer",
        "null"
      ]
    },
    "browserViewsUnique": {
      "type": [
        "integer",
        "null"
      ]
    },
    "conversionsTotal": {
      "type": "integer"
    },
    "conversionsUnique": {
      "type": "integer"
    },
    "unsubscriptions": {
      "type": "integer"
    },
    "hardBounces": {
      "type": "integer"
    },
    "softBounces": {
      "type": "integer"
    },
    "spamBounces": {
      "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"
    }
  }
}
```

