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

# Update Variant

`PATCH /v2/campaigns/{id}/audiences/{audience_id}/variants/{variant_id}`

Updates a variant's paywall and/or percentage while preserving its identity where possible. Swapping a paywall soft-deletes the existing variant and inserts a new row (matching the legacy replaceVariantPaywall flow) so live assignments are re-randomised. Requires campaigns:write scope.

## Path parameters

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

## Request body

- object
  - `paywall` string — New paywall ID for this variant. Treatments must reference a paywall; holdouts must be null. Changing this performs a swap: the old variant row is soft-deleted and a new row is inserted, preserving the percentage.
  - `percentage` number — Traffic percentage allocated to this variant (0-100)

## 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` — 17 breaking, 98 info
  - removed `subschema #1, subschema #2` from the `paywall` request property `anyOf` list
  - 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`
  - …111 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/:variant_id/patch.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/7b4c0e9ccb3a?raw)
