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

# Automation statistics per automation

`GET /v1/sites/{site_id}/automations/stats/by-automation`

## Request

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

E-mails and runs per automation. Call it to compare automations or to read
the numbers of several at once.

With `automation_ids` (up to 100, ids from `list_automations`):
every listed live automation of the site in the order given, zeros without
activity; repeated ids count once, unknown, deleted and foreign ids and
follow-ups of widgets are left out. The period is optional here: without
`from` and `to` the numbers cover the whole life, and `period` is null.

Without `automation_ids` the period is required: up to 100 live
automations with activity in the period, by the sum of `runs`, then by
`send`, most first. Deleted automations and follow-ups of widgets are left
out, so the sum may be below the total of `get_automations_stats`.

`is_active`, `trigger_type`, `widget_id`, `search`, `created_since` and
`folder_id` narrow either way to the automations that match every one given,
and then every matched automation is listed, zero ones too: one call gives
the numbers of a folder or of the active automations. `total` and `runs` are
the sums of the listed automations; use them rather than adding the items
up.

E-mails of an automation are those sent by its steps; double opt-in
confirmations are counted only in the site total.

`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

## Query parameters

- `automation_ids` integer[]: Automation ids from `list_automations`; repeat for several, up to 100
- `from` string, date: UTC day, included; omit for the whole life
- `to` string, date: UTC day, included; with `from`, today when omitted
- `is_active` boolean: true: only automations that are on; false: off
- `trigger_type` AutomationTriggerType[]: Only automations started by any of these trigger types; repeat for several
- `widget_id` integer: Only automations started by a form submit of this widget; widget id from `list_widgets`
- `search` string: Words of the name in order; case, spacing and punctuation are ignored. Or the exact id
- `created_since` string, date-time: Only automations created at or after this moment; without an offset, taken as UTC; a plain date means its start
- `folder_id` integer: Only the items of this folder, an id from `list_folders`; 0 is General

## Response `200`

Successful Response

- AutomationStatsBreakdown
  - `period` StatsPeriod
    - `date_from` string, date, required: First day, UTC, included
    - `date_to` string, date, required: Last day, UTC, included
  - `matched` integer, nullable: How many live automations the filters or ids matched; null without them. 0 means nothing matched, not that nothing happened: check the filters or ids
  - `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
  - `items` AutomationStatsBreakdownItem[], required
    - `id` integer, required: Automation id
    - `name` string, nullable
    - `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)
