---
title: "Automation statistics"
method: GET
path: "/v1/sites/{site_id}/automations/{automation_id}/stats"
tags: ["Automations"]
---

# Automation statistics

`GET /v1/sites/{site_id}/automations/{automation_id}/stats`

## Request

- Base URL: `https://api.getsitecontrol.com`
- URL: `https://api.getsitecontrol.com/v1/sites/{site_id}/automations/{automation_id}/stats`
- Auth: HTTP bearer

E-mails and runs of one automation. Without `from` and `to` they cover its
whole life, and `period` is null. E-mails are counted by the automation that
sent them, including e-mails since removed from it. Clicks by link:
`get_automation_clicks`.

A new run through `run_automation` of a contact whose run failed replaces
that failure, so `failed` of a past period may go down. A bulk start shows
in `runs.queued` only once it is split into runs.

`rates` next to each `total` gives the delivery, open, click, click-to-open,
unsubscribe, complaint and bounce rates of the e-mails, rounded to 4 places;
a rate is null when its denominator is 0, as it is undefined, not zero.

## Path parameters

- `site_id` integer, required
- `automation_id` integer, required: Automation id from `list_automations`

## Query parameters

- `from` string, date: UTC day, included; omit for the whole life
- `to` string, date: UTC day, included; with `from`, today when omitted

## Response `200`

Successful Response

- AutomationStats
  - `period` StatsPeriod
    - `date_from` string, date, required: First day, UTC, included
    - `date_to` string, date, required: Last day, UTC, included
  - `total` EmailMetrics, required: E-mail counts; every key is always present. `open`, `click` and the rest count each e-mail once. `send` includes e-mails rejected on sending, which are also counted in `bounce`. `complaint` is spam complaints reported by mail providers. For a period, each number counts the events dated in it, so the numbers are independent: a bounce may fall in a later period than its sending. `deliver` is `send` minus `bounce`, never below zero.
    - `send` integer, required
    - `deliver` integer, required
    - `bounce` integer, required
    - `open` integer, required
    - `click` integer, required
    - `unsubscribe` integer, required
    - `complaint` integer, required
  - `rates` EmailRates, required: Rates from `total`, each a fraction rounded to 4 places: 0.0125 is 1.25%. For a period, each counter counts the events dated in it, so an open or a bounce of an e-mail sent before the period counts while its sending does not, and a rate can exceed 1.
    - `deliver` number, nullable: Delivery rate: `deliver` / `send`; null when `send` is 0: the rate is undefined, not zero
    - `open` number, nullable: Open rate: `open` / `deliver`; null when `deliver` is 0: the rate is undefined, not zero
    - `click` number, nullable: Click rate: `click` / `deliver`; null when `deliver` is 0: the rate is undefined, not zero
    - `click_to_open` number, nullable: Click-to-open rate: `click` / `open`; null when `open` is 0: the rate is undefined, not zero. A click is counted without an open when the recipient's mail app does not load images, so it can exceed 1
    - `unsubscribe` number, nullable: Unsubscribe rate: `unsubscribe` / `deliver`; null when `deliver` is 0: the rate is undefined, not zero
    - `complaint` number, nullable: Spam complaint rate: `complaint` / `deliver`; null when `deliver` is 0: the rate is undefined, not zero
    - `bounce` number, nullable: Bounce rate: `bounce` / `send`; null when `send` is 0: the rate is undefined, not zero
  - `runs` AutomationRunMetrics, required: Runs started in the period, each counted once by its current status.
    - `queued` integer, required: Waiting to start; a bulk start counts only once it is split into runs
    - `ongoing` integer, required: Running, waiting in a delay step or on hold
    - `done` integer, required: Finished
    - `ineligible` integer, required: Finished by being skipped
    - `failed` integer, required: Finished with an error, or failed before the start. A failure followed by a new run of the contact through the API is not counted

## Other responses

- `400`: Unsupported GSC-Version
- `401`: Missing or invalid API key or access token
- `403`: Access denied
- `404`: Not found
- `422`: Validation failed
- `429`: Rate limited
- `503`: `temporarily_unavailable`: the statistics took longer than 25 seconds or rate limits cannot be enforced; narrow the period or retry later. The heavy request is spent all the same

---

[API](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api.md) - [All operations](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/revisions/084fcad80e75?raw)
