---
title: "Generate run statistics"
method: GET
path: "/stats/runs"
---

# Generate run statistics

`GET /stats/runs`

Generates statistics about runs over a specified time period.

## Query parameters

- `status` string[] — Filter runs by status(es). Define multiple with a comma-separated list. Supplying none will return all statuses.
- `start_at` string, date-time, required — Start date and time for statistics (inclusive)
- `end_at` string, date-time, required — End date and time for statistics (inclusive)
- `timezone` string — Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to UTC.
- `environment` string — Filter runs by environment. If not provided, all environments will be included.

## Response `200`

OK

- GenerateRunStatisticsResponse
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `series` RunTimeseriesPoint[], required
    - `cancelled` integer, required
    - `crashed` integer, required
    - `errored` integer, required
    - `exited` integer, required
    - `pending` integer, required
    - `period` string, date-time, required — The period of the timeseries point, typically the start of the period.
    - `retrying` integer, required
    - `running` integer, required
    - `scheduled` integer, required
    - `starting` integer, required
  - `settings` StatisticsSettings, required
    - `end_at` string, date-time, required — The end time for the statistics period.
    - `environment` string, required — The environment to get statistics for.
    - `interval` 'daily' | 'hourly', required — The interval for the statistics period.
    - `start_at` string, date-time, required — The start time for the statistics period.
    - `timezone` string, required — The time zone for the statistics period.
  - `stats` RunStatistics, required
    - `cancelled_runs` integer, required
    - `crashed_runs` integer, required
    - `errored_runs` integer, required
    - `exited_runs` integer, required
    - `running_runs` integer, required
    - `total_runs` integer, required

## Other responses

- `default` — Error

---

[API](https://skmtc.net/tower/apis/tower-api.md) · [All operations](https://skmtc.net/tower/apis/tower-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tower/tower-api/revisions/0e42b0fb26d9/schema)
