---
title: "Create Variant"
method: POST
path: "/v2/campaigns/{id}/audiences/{audience_id}/variants"
tags: ["Campaigns V2"]
---

# Create Variant

`POST /v2/campaigns/{id}/audiences/{audience_id}/variants`

Adds a variant (treatment or holdout) to an audience. When `percentage` is omitted, the legacy default is applied — the first treatment/holdout gets 100%, subsequent variants get 0%. Requires campaigns:write scope.

## Path parameters

- `id` string, required
- `audience_id` string, required

## Request body

- object
  - `type` union, required — Whether this is a treatment or holdout variant
    - 'treatment' — Treatment variant that shows a paywall
    - 'holdout' — Holdout variant that does not show a paywall
  - `paywall` string, nullable, required — ID of the paywall to show, or null for holdouts
  - `percentage` number — Traffic percentage allocated to this variant (0-100). When omitted on createVariant, the server applies the legacy default — first treatment / first holdout gets 100%, subsequent variants get 0%.

## Response `200`

Success

- object
  - `id` string, required
  - `object` 'variant', required — Object type, always `variant`
  - `type` union, required — Whether this is a treatment or holdout variant
    - 'treatment' — Treatment variant that shows a paywall
    - 'holdout' — Holdout variant that does not show a paywall
  - `paywall` string, nullable, required — ID of the paywall shown for this variant, or null for holdouts
  - `percentage` number, required — Traffic percentage allocated to this variant (0-100)
  - `created_at` string, required — ISO 8601 timestamp of when the variant was created

## Other responses

- `400` — The request did not match the expected schema | The request was invalid or malformed | @superwall/api-schema/v2/errors/InvalidVariantPercentagesError | @superwall/api-schema/v2/errors/InvalidPaywallReferenceError
- `401` — No API key was provided in the request | The API key does not have a valid format | The API key is invalid or has been revoked | An error occurred while validating the API key | The session cookie is invalid or expired
- `403` — The API key does not have permission to perform this action
- `404` — The requested resource was not found
- `429` — Too many requests have been made in a short period
- `500` — A required post-operation side effect failed | An unexpected error occurred on the server

## Changes

- **2026-09-09** `217c96dc9a29` — 16 breaking, 97 info
  - the `percentage` request property type changed from `number` to no type
  - the `code` response's property type changed from `string` to no type for status `403`
  - the `code` response's property type changed from `string` to no type for status `404`
  - the `code` response's property type changed from `string` to no type for status `429`
  - …109 more
  - …this revision’s changelog is incomplete

[Change history](https://skmtc.dev/superwall/apis/superwall-api-v2/changes/v2/campaigns/:id/audiences/:audience_id/variants/post.md)

---

[API](https://skmtc.dev/superwall/apis/superwall-api-v2.md) · [All operations](https://skmtc.dev/superwall/apis/superwall-api-v2/llms.txt) · [OpenAPI document](https://skmtc.dev/superwall/apis/superwall-api-v2/revisions/bfb85c07a3d3?raw)
