Campaigns V2

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.

patch/v2/campaigns/{id}/audiences/{audience_id}/variants/{variant_id}

Request

Path parameters

idstring required
audience_idstring required
variant_idstring required

Request body

paywallstring nullable

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.

percentageinteger

Traffic percentage allocated to this variant: a whole number from 0 to 100. A fraction is rejected with a 400.

Response

Success

idstring required
object'variant' required

Object type, always variant

paywallstring nullable required

ID of the paywall shown for this variant, or null for holdouts

percentagenumber required

Traffic percentage allocated to this variant (0-100)

created_atstring required

ISO 8601 timestamp of when the variant was created

Changes

    • info

      added subschema #4 to the response body anyOf list for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • breaking

      removed subschema #1 from the request property anyOf list

    • warning

      the / request property's max was set to 9007199254740991.00

    • warning

      the / request property's min was set to -9007199254740991.00

    • info

      added subschema #1 subschema #2 to the request property anyOf list