---
title: "Update an A/B experiment"
method: PATCH
path: "/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}"
tags: ["ABExperimentService"]
---

# Update an A/B experiment

`PATCH /v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}`

## Request

- Base URL: `https://api.together.ai`
- URL: `https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}`
- Auth: HTTP bearer

Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.

## Path parameters

- `projectId` string, required: Project identifier.
- `endpointId` string, required: Endpoint identifier.
- `id` string, required: A/B experiment identifier.

## Query parameters

- `updateMask` string: Fields to update. If omitted, all mutable fields are overwritten.

## Request body

- DEUpdateABExperimentRequest: Mutable description and traffic allocation for an A/B experiment.
  - `description` string: Updated free-form description.
  - `members` DEABExperimentMember[]: Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100.
    - `deploymentId` string, required: Deployment under the parent endpoint.
    - `role` 'AB_EXPERIMENT_MEMBER_ROLE_CONTROL' | 'AB_EXPERIMENT_MEMBER_ROLE_VARIANT', required: Role of this deployment within the A/B experiment.
    - `percent` integer, required: Integer traffic percent in [1, 100]. Percentages across all members must sum to 100.
  - `etag` string: Opaque version tag from a prior read for optimistic concurrency.

## Response `200`

OK

- DEABExperiment: Managed cohort split that subdivides a control deployment's live traffic among the control and one or more variants.
  - `id` string, required: Output only. Unique A/B experiment identifier.
  - `projectId` string, required: Output only. Project that owns the parent endpoint.
  - `endpointId` string, required: Output only. Endpoint this A/B experiment belongs to.
  - `name` string, required: Human-readable A/B experiment name, unique within the endpoint.
  - `description` string: Optional free-form description.
  - `members` DEABExperimentMember[], required: Two to 20 participating deployments with exactly one control and percentages that add up to 100.
    - `deploymentId` string, required: Deployment under the parent endpoint.
    - `role` 'AB_EXPERIMENT_MEMBER_ROLE_CONTROL' | 'AB_EXPERIMENT_MEMBER_ROLE_VARIANT', required: Role of this deployment within the A/B experiment.
    - `percent` integer, required: Integer traffic percent in [1, 100]. Percentages across all members must sum to 100.
  - `createdBy` string, required: Output only. Identifier of the principal that created the A/B experiment.
  - `createdAt` string, date-time, required: Output only. Timestamp when the A/B experiment was created.
  - `updatedAt` string, date-time, required: Output only. Timestamp when the A/B experiment was last updated.
  - `etag` string, required: Optional opaque version tag for optimistic concurrency control.

## Other responses

- `default`: Default error response

## Changes

- **2026-10-22** `bb5257b3173a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/together/apis/together-apis/changes/v2/projects/:projectId/endpoints/:endpointId/abExperiments/:id/patch.md)

---

[API](https://skmtc.dev/together/apis/together-apis.md) - [All operations](https://skmtc.dev/together/apis/together-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/together/apis/together-apis/revisions/93438ddac711?raw)
