---
title: "Get automation run stats"
method: GET
path: "/api/v0/automations/run-stats"
tags: ["Automations"]
---

# Get automation run stats

`GET /api/v0/automations/run-stats`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/v0/automations/run-stats`
- Auth: HTTP bearer

Returns aggregate run counts (total + completed) and a per-day breakdown across all of the org automations, over the last windowDays UTC calendar days including today. completed counts every run that reached a terminal status, failed runs included. At most 5,000 run records are counted, so a busy organization can see an undercount.

## Query parameters

- `windowDays` string: Days of history to aggregate, ending today (1-90, default 7). Larger values are clamped to 90, fractions are rounded down, and a value that is not a positive number uses 7.

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- GetAutomationRunStats200ResponseBody
  - `windowDays` number, required
  - `totalRuns` number, required: Runs started in the window, counting at most 5,000 run records.
  - `completedRuns` number, required: Runs in totalRuns that reached a terminal status, failed runs included.
  - `daily` object[], required: One bucket per UTC calendar day of the window, oldest first.
    - `date` string, required
    - `total` number, required
    - `completed` number, required

## Other responses

- `400`: Response for status 400
- `401`: Response for status 401
- `402`: Response for status 402
- `403`: Response for status 403
- `404`: Response for status 404
- `451`: Response for status 451
- `500`: Response for status 500
- `503`: Response for status 503

## Changes

- **2026-11-14** `9fb2e1b1ec61`: 1 info
  - added the non-success response with the status `404`
- **2026-11-12** `b6a46c415079`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/automations/run-stats/get.md)

---

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