---
title: "Create Environment Revision"
method: POST
path: "/environments/revisions/"
tags: ["Environments"]
---

# Create Environment Revision

`POST /environments/revisions/`

## Request body

- EnvironmentRevisionCreateRequest
  - `environment_revision` EnvironmentRevisionCreate, required
    - `environment_variant_id` string, uuid, nullable
    - `variant_id` string, uuid, nullable
    - `environment_id` string, uuid, nullable
    - `artifact_id` string, uuid, nullable
    - `flags` object, nullable
    - `tags` object, nullable
    - `meta` object, nullable
    - `name` string, nullable
    - `description` string, nullable
    - `slug` string, nullable

## Response `200`

Successful Response

- EnvironmentRevisionResponse
  - `count` integer
  - `environment_revision` EnvironmentRevisionOutput
    - `environment_variant_slug` string, nullable
    - `variant_slug` string, nullable
    - `environment_slug` string, nullable
    - `artifact_slug` string, nullable
    - `environment_variant_id` string, uuid, nullable
    - `variant_id` string, uuid, nullable
    - `environment_id` string, uuid, nullable
    - `artifact_id` string, uuid, nullable
    - `author` string, uuid, nullable
    - `date` string, date-time, nullable
    - `message` string, nullable
    - `flags` object, nullable
    - `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` EnvironmentRevisionData — Per-app references for environment revision data. Keys are app-scoped identifiers (e.g., ``"pre.revision"``). Values are dicts of entity-type → Reference, providing full traceability:: { "pre.revision": { "application": Reference(id=..., slug=..., version=...), "application_variant": Reference(id=..., slug=..., version=...), "application_revision": Reference(id=..., slug=..., version=...), }, ... }
      - `references` object, nullable
  - `resolution_info` ResolutionInfo
    - `references_used` object[], required
    - `depth_reached` integer, required
    - `embeds_resolved` integer, required
    - `errors` string[]
  - `retrieval_info` RetrievalInfo — References actually used to retrieve a revision. For direct retrievals, `references` carries the artifact / variant / revision that was fetched. For environment-backed retrievals, it additionally carries the environment + environment_variant + environment_revision used to look the target up, and `selector` is {the key: path} map inside the environment's references map that selected the target.
    - `references` object
    - `selector` object, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.net/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/versions/ea6421d829f1/schema)
