# Commit Workflow Revision

Source: https://agenta.ai/docs/reference/api/commit-workflow-revision

`POST /workflows/revisions/commit`

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`.

The human and SDK route: no write scope, the caller owns the whole revision.

## Parameters

- `workflow_variant_id` (in query, string (uuid))

## Request body schema

Content type: `application/json` (required)

- `workflow_revision` (object, required): Revision to append to a variant's history. Requires `workflow_variant_id` and optional `message`; `data` carries the new configuration.
  - `workflow_variant_id` (string (uuid), nullable)
  - `variant_id` (string (uuid), nullable)
  - `workflow_id` (string (uuid), nullable)
  - `artifact_id` (string (uuid), 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)
  - `slug` (string, 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)
      - `inputs` (object, nullable)
      - `outputs` (object, nullable)
    - `parameters` (object, nullable)
  - `message` (string, nullable)
  - `revision_id` (string (uuid), nullable)
  - `delta` (object, nullable)
    - `set` (object, nullable)
    - `remove` (array of string, nullable)
    - `operations` (array of object, nullable)
      - `operation` (string, one of: "set", "merge", "remove", "edit_text", "add_item", "replace_item", "remove_item", required)
      - `target` (array of any, required)
      - `value` (any, nullable)
      - `edits` (array of object, nullable)
      - `match_mode` (string, one of: "auto", "exact", nullable)
  - `base_revision_id` (string (uuid), nullable): The revision this change was built on. Omit it to keep today's last-write-wins behavior. Send it on a legacy delta and the commit is refused with `409` when the variant's head has moved since: sending the field is how a caller asks for that check. An ordered delta requires it.

## Response schemas

### 200: Successful Response

- `count` (integer): `1` when a revision is returned, `0` when none matched. Default: `0`.
- `workflow_revision` (object, nullable): The workflow revision.
  - `workflow_variant_slug` (string, nullable)
  - `variant_slug` (string, nullable)
  - `workflow_slug` (string, nullable)
  - `artifact_slug` (string, nullable)
  - `workflow_variant_id` (string (uuid), nullable)
  - `variant_id` (string (uuid), nullable)
  - `workflow_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)
- `status` (string, one of: "committed", "no_change", nullable): Commit outcome. `no_change` means the change produced the stored configuration, so no revision was created and `workflow_revision` is the current head. Absent on paths that do not run the checked commit; a reader must treat absent as `committed`.
- `warnings` (array of object, nullable): Structured advisories about the commit; never an error.
  - `code` (string, required)
  - `message` (string, required)
  - `target` (array of any, nullable)
  - `operation_index` (integer, nullable)
- `resolution_info` (object, nullable): Reference-resolution metadata; populated when `resolve=true` on retrieve.
  - `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)
