# GET /api/v2/automation-runs

List automation runs

- MCP id: automation-runs.index
- Scope: api:read:automations
- Scope: api:read:project_automations
- Scope: api:read:customer_automations
- Permission: automations::read
- Needs the automations feature on your organisation
- Rate cost: 1 unit, read bucket. `view=detail` makes it 3. Adds: `with_total=1` +2, each include +1.
- Cache-Control: private, no-store

Returns the runs of the automations the caller may see, newest first: a run is visible to whoever may see its automation, and the runs of a deleted automation are gone with it.

Narrow to one automation with `filter[automation_id]`, and to the runs that need a look with `filter[status][in]=failed,halted`. What a run worked with is shown only when `reveals_data` is true; read its steps at `links.steps`. `total` is omitted unless you pass `with_total=1`. The declared permission is `automations::read`; for a project or customer automation, the `project_automations` or `customer_automations` permission of the same action applies instead.

## Parameters
- view (string, optional): Which field set to render.
- per_page (integer 1 to 100, optional): Rows per page. At most 25 when `include` names a to-many relation; a larger value is 400 invalid-query-parameter.
- cursor (string, optional): Opaque keyset cursor from a previous page's links.next. Never construct one by hand.
- with_total (boolean, optional): Whether meta.page.total is counted for this request.
- filter[automation_id] (integer, optional): The automation that ran. Operators: = in.
- filter[automation_version_id] (integer, optional): The version of the flow the runs started with. Operators: = in null.
- filter[created_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): Creation timestamp. Pair with `sort=id` for a stable full export. Operators: = gte lt.
- filter[finished_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): When the runs ended. Operators: = gte lte null.
- filter[mode] (string, optional): `live` for runs their trigger started, `test` for tries in the builder. Operators: = ne in.
- filter[resume_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): When waiting runs carry on at the latest. Operators: = gte lte null.
- filter[run_as_id] (integer, optional): Whose permissions the runs used. Operators: = in null.
- filter[started_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): When the first step began. Operators: = gte lte null.
- filter[status] (string, optional): How the runs went. `filter[status][in]=failed,halted` gives the ones that need a look. Operators: = ne in.
- filter[triggered_by_id] (integer, optional): Who started the runs. Operators: = in null.
- filter[updated_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): Last-write timestamp. Use for incremental sync. Operators: = gte lt.
- sort (string, optional): Up to three keys, comma-separated, each optionally prefixed with `-` for descending.
- include (string, optional): Comma-separated names to inline, at most five.
- X-Request-Id (header, optional): A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
- If-None-Match (header, optional): The ETag a read is conditional on. A match is answered 304 with no body.

## Response 200
- id (integer, required): Unique identifier.
- uuid (string ≤ 36, required): The run's public id, which a webhook's answer hands the sender. Reads the same as `id` in the path.
- automation_id (integer, required): The automation that ran.
- automation_version_id (integer or null, required): The version of the flow the run started with. `null` once that version is gone.
- status (string, required): `pending` until a worker picks it up, `running`, `waiting` (such as at a Wait step), and finally `completed`, `failed`, `halted` (a step stopped it), `skipped` (not started, such as while switched off) or `throttled` (over a limit).
- mode (string, required): `live` for a run its trigger started, `test` for one an editor started to try the flow out.
- trigger_kind (string ≤ 20, required): What started it: `record` (a record event), `schedule`, `date`, `manual`, `webhook` or `automation` (a step of another automation).
- trigger_event (string or null, required): For a run a record event started, which event.
- record_type (string or null ≤ 255, required): The record type the run started on, such as `work_item`; `null` without a record.
- record_id (string or null ≤ 255, required): The key of that record. Shown to every reader, as the run page shows it.
- record_title (string or null, required): The record's title, only when the reader may see the record.
- context_id (integer or null, required): For an automation of every project or customer, the one the run happened in.
- parent_run_id (integer or null, required): The run of another automation whose step started this one, when the reader may see that automation.
- triggered_by_id (integer or null, required): Who started it, by hand or with the change that set it off.
- run_as_id (integer or null, required): Whose permissions its steps used: the automation's owner, or the editor for a test.
- attempts (integer, required): How often a worker took the run up, retries included.
- started_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): When the first step began.
- finished_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): When it ended; `null` while it is not finished.
- duration_ms (integer or null, required): How long it ran, in milliseconds.
- resume_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): While it waits, when it carries on at the latest.
- failure_reason (string or null, required): Why it failed, halted or was skipped. Record data appears in it only when `reveals_data` is true.
- reveals_data (boolean, required): Whether you may see what the run worked with: for a run on a record, whether you may see that record; otherwise, whether you may change the automation. Without it, `inputs`, `changes` and the steps' `input` and `output` are empty and messages carry no record data.
- inputs (object or null, required, detail only): What the person who started it filled in, by input name. `null` when `reveals_data` is false.
- changes (object, required, detail only): For a run a change started, the fields that changed, each `{label, old, new}`, without the fields you may not read. Empty unless you may see the record.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): When the run was started.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- automation (Ref or AutomationSummary, required): The automation that ran.
- version (Ref or AutomationVersionSummary or null, required): The version of the flow the run started with.
- triggered_by (Ref or UserSummary or null, required): Who started it.
- run_as (Ref or UserSummary or null, required): Whose permissions its steps used.
- steps_count (integer ≥ 0, required): How many step executions the run recorded.
- links (AutomationRunLinks, required)
  - self (url, required): The canonical URI of this record.
  - steps (url, required): What each step of the run did.

## Errors
- 403 forbidden-by-policy | insufficient-permission | insufficient-token-scope: Forbidden.
- 304 : Not modified.
- 400 idempotency-key-required | invalid-cursor | invalid-query-parameter | malformed-request | unsupported-parameter: Bad request.
- 401 token-expired | unauthenticated: Unauthenticated.
- 404 endpoint-not-found | resource-not-found: Not found.
- 406 not-acceptable: Not acceptable.
- 429 rate-limit-exceeded: Too many requests.
- 500 internal-error: Server error.
- 503 tenant-unavailable: Service unavailable.

## Example
```bash
curl -G \
  'https://<your-url>/api/v2/automation-runs' \
  --data-urlencode 'filter[automation_id]=1' \
  --data-urlencode 'filter[status]=failed' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json'
```
