---
title: "Retrieve an automation's stats"
description: "How the automation is running, the numbers the builder shows: runs by status over a window (the runs that started in the last days days) and over its lifetime (runs retention has deleted included), the goal rate, and for each block of the live version the runs that entered, succeeded, failed and were skipped (by reason), the runs waiting there now, the runs that failed there in the window, and how long it takes (a wait: how long runs waited). `GET /api/v1/automations/{id}/stats`"
url: https://www.unitpost.com/docs/automations/get-automations-id-stats
section: "Automations API reference"
updated: 2026-12-01
---
# Retrieve an automation's stats

`GET /api/v1/automations/{id}/stats`

How the automation is running, the numbers the builder shows: runs by status over a window (the runs that started in the last `days` days) and over its lifetime (runs retention has deleted included), the goal rate, and for each block of the live version the runs that entered, succeeded, failed and were skipped (by reason), the runs waiting there now, the runs that failed there in the window, and how long it takes (a wait: how long runs waited). While the workspace's marketing email is paused, `runs.held_marketing` counts the runs waiting at a marketing email: they send once it is resumed (after 7 days they end unsent), and the automation keeps running. Block counts start over when you publish a new version. Counts only. To see the runs themselves, filter [List runs](https://www.unitpost.com/docs/automations/get-automations-id-runs) by `status` or `block`. Requires the `automations:read` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |
| `days` | query | integer | no | The window in days, 1–90 (default 7). Never reaches past run retention (30 days on Free). A block is `failing` when a run failed at it in this window. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `automation_id` | string | yes | — |
| `window` | object | yes | — |
| `retention_days` | integer | yes | How long finished runs are kept: 30 days on Free, 90 otherwise. |
| `runs` | object | yes | — |
| `goal` | object | yes | — |
| `version` | object \| null | yes | The live version the block counts belong to. Republishing starts them over. |
| `trigger` | object \| null | yes | — |
| `blocks` | object[] | yes | — |
| `guard_trips` | object | yes | Times a limit held the live version back, by rule: `re_entry`, `run_in_progress`, `max_active_runs`, `frequency_capped`, `run_rate`, `loop_hop_budget`, `max_steps`, `ttl`, … (the "held back by limits" count). `unmatched_subject` counts custom events whose `email` isn't a contact and that were sent with `create_contact: false`, or whose `contact_id` matched nobody: no run started and no contact was made. `contact_limit` counts unknown emails at the plan's contact limit. An unknown email sent without `create_contact: false` becomes a contact and starts the run, so it isn't counted here. `no_consent` counts people who started no run because every message it could send them would be skipped by consent (unsubscribed, not subscribed to the email's topic, no SMS consent): nothing was billed. |
| `failed_outside_blocks` | integer | yes | Runs that failed outside any block (step limit, billing), counted like `failed_in_window` (by when they failed, since the window's start or the live version's publish); not part of `runs.window`, which counts runs by when they started. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The automation's stats. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | Automation not found. |
| 422 | `days` isn't a whole number from 1 to 90. |
| 503 | The count took too long; nothing changed. Try again in a moment. |

## Example request

```bash
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123/stats' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

## Example response (200)

```json
{
  "object": "automation_stats",
  "automation_id": "automation_123",
  "window": {
    "days": 0,
    "since": "string"
  },
  "retention_days": 0,
  "runs": {
    "window": {
      "entered": 0,
      "active": 0,
      "waiting": 0,
      "completed": 0,
      "goal_reached": 0,
      "exited": 0,
      "failed": 0,
      "canceled": 0
    },
    "lifetime": {
      "entered": 0,
      "active": 0,
      "waiting": 0,
      "completed": 0,
      "goal_reached": 0,
      "exited": 0,
      "failed": 0,
      "canceled": 0
    },
    "held_marketing": 0
  },
  "goal": {
    "set": false,
    "window_rate": 0,
    "lifetime_rate": 0
  },
  "version": {
    "version": 0,
    "published_at": "2026-01-01T00:00:00.000Z"
  },
  "trigger": {
    "id": "id_123",
    "kind": "string",
    "title": "string"
  },
  "blocks": [
    {
      "id": "id_123",
      "kind": "string",
      "title": "string",
      "entered": 0,
      "succeeded": 0,
      "failed": 0,
      "skipped": 0,
      "skip_reasons": {},
      "branches": {},
      "waiting_now": 0,
      "active_now": 0,
      "failed_in_window": 0,
      "failing": false,
      "duration": {
        "measures": "execution",
        "avg_ms": 0,
        "p50_ms": 0,
        "p95_ms": 0
      }
    }
  ],
  "guard_trips": {},
  "failed_outside_blocks": 0
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/automations/get-automations-id-stats
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
