# Retrieve Application Revision

Source: https://agenta.ai/docs/reference/api/retrieve-application-revision

`POST /applications/revisions/retrieve`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Retrieve one application revision by reference.

Accepts application / variant / revision references for direct lookup,
or an environment reference (with optional `key`) to resolve the
currently-deployed revision in that environment. Returns the revision
including its `data` payload (URL, parameters, schemas), which clients
use to invoke the application.
Set `resolve: true` to inline embedded references inside `data`.

## Request body schema

Content type: `application/json` (required)

- `application_ref` (object, nullable): Application artifact to look up. Identifies the artifact by `id` or `slug` (both project-unique). When no variant_ref or revision_ref is provided, returns the latest revision of the application's default variant.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `application_variant_ref` (object, nullable): Application variant to look up. Identifies the variant by `id` or `slug` (both project-unique). When no revision_ref is provided, returns the latest revision of this variant.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `application_revision_ref` (object, nullable): Application revision to look up. `id` alone identifies a revision (project-unique). `slug` alone identifies a revision (project-unique). `version` alone is a per-variant sequence number and is **not** sufficient on its own; it must be combined with an `application_variant_ref`. Sending only `version` without a variant ref returns HTTP 400.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `environment_ref` (object, nullable): Environment reference. Returns the revision currently deployed to that environment under the given `key`.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `environment_variant_ref` (object, nullable): Environment variant reference; used together with `environment_ref`.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `environment_revision_ref` (object, nullable): Environment revision reference; used to pin to a specific environment commit instead of the current tip.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `key` (string, nullable): Deployment key inside the environment revision. When omitted and `application_ref` is supplied, the server derives it as `{application_slug}.revision`.
- `resolve` (boolean, nullable): When `true`, resolve embedded references in the returned revision's `data` (for example, snippet references).
- `include_archived` (boolean, nullable): When false, an archived application, variant, or revision resolves to nothing.

## Response schemas

### 200: Successful Response

- `count` (integer): `1` when a revision was found, `0` otherwise. Default: `0`.
- `application_revision` (object, nullable): The application revision, including its `data` payload (prompt, model parameters, schemas, URL).
  - `application_variant_slug` (string, nullable)
  - `workflow_variant_slug` (string, nullable)
  - `application_slug` (string, nullable)
  - `workflow_slug` (string, nullable)
  - `application_variant_id` (string (uuid), nullable)
  - `workflow_variant_id` (string (uuid), nullable)
  - `application_id` (string (uuid), nullable)
  - `workflow_id` (string (uuid), nullable)
  - `variant_slug` (string, nullable)
  - `artifact_slug` (string, nullable)
  - `variant_id` (string (uuid), nullable)
  - `artifact_id` (string (uuid), nullable)
  - `author` (string (uuid), nullable)
  - `date` (string (date-time), nullable)
  - `message` (string, nullable)
  - `flags` (object, nullable)
    - `is_application` (boolean) Default: `false`.
    - `is_evaluator` (boolean) Default: `false`.
    - `is_snippet` (boolean) Default: `false`.
    - `is_managed` (boolean) Default: `false`.
    - `is_custom` (boolean) Default: `false`.
    - `is_llm` (boolean) Default: `false`.
    - `is_hook` (boolean) Default: `false`.
    - `is_code` (boolean) Default: `false`.
    - `is_match` (boolean) Default: `false`.
    - `is_feedback` (boolean) Default: `false`.
    - `is_agent` (boolean) Default: `false`.
    - `is_skill` (boolean) Default: `false`.
    - `is_chat` (boolean) Default: `false`.
    - `has_url` (boolean) Default: `false`.
    - `has_script` (boolean) Default: `false`.
    - `has_handler` (boolean) Default: `false`.
    - `is_static` (boolean) Default: `false`.
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `created_at` (string (date-time), nullable)
  - `updated_at` (string (date-time), nullable)
  - `deleted_at` (string (date-time), nullable)
  - `created_by_id` (string (uuid), nullable)
  - `updated_by_id` (string (uuid), nullable)
  - `deleted_by_id` (string (uuid), nullable)
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
  - `data` (object, nullable)
    - `uri` (string, nullable)
    - `url` (string, nullable)
    - `headers` (object, nullable)
    - `runtime` (string, one of: "python", "typescript", "javascript", nullable)
    - `script` (string, nullable)
    - `schemas` (object, nullable)
    - `parameters` (object, nullable)
- `resolution_info` (object, nullable): Present only when the request set `resolve: true`. Describes which embedded references were resolved and any errors that occurred.
  - `references_used` (array of object, required)
  - `depth_reached` (integer, required)
  - `embeds_resolved` (integer, required)
  - `errors` (array of string) Default: `[]`.
- `retrieval_info` (object, nullable): References used to retrieve the top-level revision.
  - `references` (References)
  - `selector` (object, nullable)
- … more fields: see the OpenAPI specification.

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
