---
title: "Read a revision with its files"
method: GET
path: "/code/automations/{automationId}/revisions/{revisionId}"
---

# Read a revision with its files

`GET /code/automations/{automationId}/revisions/{revisionId}`

## Request

- Base URL: `https://api.caveman.so/api/v1`
- URL: `https://api.caveman.so/api/v1/code/automations/{automationId}/revisions/{revisionId}`
- 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}/revisions/{revisionId} 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`

The revision

- CodeAutomationRevision
  - `id` string, uuid, required
  - `automation_id` string, uuid, required
  - `sha256` string, required
  - `commit_sha` string, required
  - `state` 'active' | 'pending_approval' | 'superseded', required
  - `source` 'api' | 'push', required
  - `authority` object, required: The authority-bearing keys Cloud read: host, on, triggers, outputs, output_config (where and how each output posts), engines, agents, secrets, mcp, budget.
  - `authority_diff` object, required: What a revision adds over the active one. widens: it waits for approval.
    - `widens` boolean, required
    - `new` boolean
    - `changes` object[], required
      - `key` string, required
      - `change` 'added' | 'removed' | 'changed', required
      - `before` unknown
      - `after` unknown
      - `widens` boolean, required
  - `created_by_user_id` string, uuid, nullable
  - `created_by_service_account_id` string, uuid, nullable
  - `approved_by_user_id` string, uuid, nullable
  - `approved_at` string, date-time, nullable
  - `activated_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `files` object: The revision's files by path; on a single revision read.

## 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)
