# Commit Testset Revision

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

`POST /testsets/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`.

Commit Testset Revision

## Request body schema

Content type: `application/json` (required)

- `testset_revision` (object, required): New revision to commit. Pass either `data` (full replacement of the testcase list) or `delta` (add/remove/replace operations against the base revision) — not both.
  - `testset_revision_id` (string (uuid), nullable)
  - `revision_id` (string (uuid), nullable)
  - `testset_variant_id` (string (uuid), nullable)
  - `variant_id` (string (uuid), nullable)
  - `testset_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)
  - `data` (object, nullable)
    - `testcase_ids` (array of string (uuid), nullable)
    - `testcases` (array of object, nullable)
      - `testset_id` (string (uuid), nullable)
      - `set_id` (string (uuid), 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)
      - `id` (string (uuid), nullable)
      - `flags` (object, nullable)
      - `tags` (object, nullable)
      - `meta` (object, nullable)
      - `data` (object, nullable)
  - `message` (string, nullable)
  - `delta` (object, nullable)
    - `rows` (object, nullable)
      - `add` (array of object, nullable)
      - `remove` (array of string (uuid), nullable)
      - `replace` (array of object, nullable)
    - `columns` (object, nullable)
      - `add` (array of string, nullable)
      - `remove` (array of string, nullable)
      - `replace` (array of array of any, nullable)
- `include_testcases` (boolean, nullable): Include full testcase objects in the response.
- … more fields: see the OpenAPI specification.

## Response schemas

### 200: Successful Response

- `count` (integer): 1 if a revision was returned, 0 otherwise. Default: `0`.
- `testset_revision` (object, nullable): The testset revision. `data.testcase_ids` is the ordered list of testcase IDs; `data.testcases` is populated when `include_testcases` is true.
  - `testset_variant_slug` (string, nullable)
  - `variant_slug` (string, nullable)
  - `testset_slug` (string, nullable)
  - `artifact_slug` (string, nullable)
  - `testset_variant_id` (string (uuid), nullable)
  - `variant_id` (string (uuid), nullable)
  - `testset_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` (object, nullable)
    - `testcase_ids` (array of string (uuid), nullable)
    - `testcases` (array of object, nullable)
- `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)
