---
title: "List an automation's runs"
method: GET
path: "/code/automations/{automationId}/runs"
---

# List an automation's runs

`GET /code/automations/{automationId}/runs`

## Request

- Base URL: `https://api.caveman.so/api/v1`
- URL: `https://api.caveman.so/api/v1/code/automations/{automationId}/runs`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/api/v1/oauth/authorize`
    - Token URL: `/api/v1/oauth/token` scopes: `code:read`
  - HTTP bearer
  - API key in cookie `cave_access`
  - API key in cookie `__Secure-cave_identity.session_token`

GET /api/v1/code/automations/{automationId}/runs on the Caveman Cloud control plane. Requires the code:read scope. Not exposed to autonomous agents: Cloud automations are applied from a repository's .caveman/ files by the Code app, a code:run key or a push to the default branch, and a person approves wider authority (ADR 0133). An agent works inside a run's session and never applies, approves, enables or fires automations from a control-plane connection.

## Response `200`

Runs, newest first

- object
  - `runs` CodeAutomationRun[], required
    - `id` string, uuid, required
    - `automation_id` string, uuid, required
    - `revision_id` string, uuid, required
    - `trigger` string, required: github.<event>, schedule, webhook, slack.app_mention, linear.<event>, jira.<event> or manual.
    - `event_id` string
    - `fire_slot` string, required
    - `subject` string, required
    - `inputs` object
    - `triggered_by_user_id` string, uuid, nullable
    - `session_id` string, uuid, nullable
    - `workspace_id` string, uuid, nullable
    - `status` 'queued' | 'running' | 'waiting' | 'succeeded' | 'failed' | 'cancelled' | 'skipped', required
    - `outcome` string, required: The reason a terminal status carries: superseded, skipped_overlap, policy_denied, admission_refused, dispatch_failed, deadline, session_failed (the session failed and no run record came).
    - `cost_usd` number, required
    - `started_at` string, date-time, nullable
    - `finished_at` string, date-time, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time
    - `requires_action` object, nullable: What a waiting run waits for: its session's last ask since it last ran. Null while running, or before the ask arrives.
      - `ask_id` string, required
      - `kind` string, required: approval for an approve: gate.
      - `step` string, required
      - `by` 'owner' | 'members', required
    - `recorded_at` string, date-time, nullable: When the run's record arrived (ADR 0134). An ended run that started a session and has none: cost_usd is unknown, not 0.
    - `automation` string: The automation's name; on the organization-wide list.
    - `repo` string
    - `pull_requests` object[]
      - `url` string
      - `state` 'open' | 'merged' | 'closed'

## Other responses

- `401`: A person's sign-in or a code:run key is required.
- `403`: The role, the key's scope, or an inactive service account (cave_code_service_account_inactive) refuses.
- `2XX`: Successful response. Exact status depends on synchronous or durable delivery outcome.
- `4XX`: Structured failure. `error.code` is stable; `error.request_id` is echoed in the x-cave-request-id header.
- `5XX`: Structured failure. `error.code` is stable; `error.request_id` is echoed in the x-cave-request-id header.

---

[API](https://skmtc.dev/caveman/apis/caveman-cloud-api.md) - [All operations](https://skmtc.dev/caveman/apis/caveman-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/caveman/apis/caveman-cloud-api/revisions/508312d01cfc?raw)
