---
title: "Create an A/B experiment"
method: POST
path: "/projects/{projectId}/endpoints/{endpointId}/abExperiments"
tags: ["ABExperimentService"]
---

# Create an A/B experiment

`POST /projects/{projectId}/endpoints/{endpointId}/abExperiments`

Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.

## Path parameters

- `projectId` string, required — Project identifier.
- `endpointId` string, required — Endpoint identifier.

## Request body

- DECreateABExperimentRequest — Configuration for a managed live-traffic split across deployments under one endpoint.
  - `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. Integer traffic percentages across all members must 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.

## 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

---

[API](https://skmtc.net/together/apis/together-apis.md) · [All operations](https://skmtc.net/together/apis/together-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/together/together-apis/revisions/468edbdc879c/schema)
