# Edit Testset Variant

Source: https://agenta.ai/docs/reference/api/edit-testset-variant

`PUT /testsets/variants/{testset_variant_id}`

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

Update metadata on a testset variant.

Variants hold only branch-level metadata (name, description, slug,
flags, tags, meta). Testcase content belongs to revisions.

## Parameters

- `testset_variant_id` (in path, string (uuid), required)

## Request body schema

Content type: `application/json` (required)

- `testset_variant` (object, required): Variant fields to update. The `id` in the body must match the `testset_variant_id` in the path.
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `id` (string (uuid), nullable)

## Response schemas

### 200: Successful Response

- `count` (integer): 1 if a variant was returned, 0 otherwise. Default: `0`.
- `testset_variant` (object, nullable): The testset variant (branch).
  - `testset_slug` (string, nullable)
  - `artifact_slug` (string, 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)
  - `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)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)

### 422: Validation Error

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