---
title: "Create a variant"
method: POST
path: "/api/v1/campaigns/{campaign_id}/variants"
tags: ["Variants"]
---

# Create a variant

`POST /api/v1/campaigns/{campaign_id}/variants`

## Request

- Base URL: `https://app.convertflow.co`
- URL: `https://app.convertflow.co/api/v1/campaigns/{campaign_id}/variants`
- Auth: HTTP bearer

Adds a variant at 0% traffic (not served until given traffic via traffic_split). Without template_id the variant is empty and answered 201. With template_id (GET /api/v1/templates) the variant row is created right away (`building: true`) and answered 202 while a job copies the template content and runs the AI remix when `remix.remix_all_text` asks for it; `building` flips to false when the job finishes, with `build_failed: true` if it failed. Nothing is published. Requires campaigns:write.

## Request body

- object
  - `name` string
  - `template_id` integer: Template to copy from (GET /api/v1/templates); answers 202
  - `remix` object
    - `remix_instructions` string
    - `remix_tone` string
    - `remix_all_text` string
    - `remix_asset_urls` string[]
    - `excluded_element_types` string[]

## Response `201`

variant created

- object
  - `id` integer
  - `campaign_id` integer
  - `name` string
  - `variation` string
  - `percentage` integer, nullable
  - `color` string
  - `screenshot` unknown
  - `score` integer
  - `score_field` unknown
  - `unpublished` boolean
  - `building` boolean
  - `build_failed` boolean
  - `behavior` object
    - `trigger_type` string
    - `delay` unknown
    - `scroll` unknown
    - `exit_delay` unknown
    - `aggressive` string
    - `hide` integer
    - `minutes_hide` unknown
  - `steps` unknown[]
    - unknown
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `has_custom_code` boolean

## Other responses

- `202`: variant created from a template, content being copied

---

[API](https://skmtc.dev/convertflow/apis/convertflow-api.md) - [All operations](https://skmtc.dev/convertflow/apis/convertflow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/convertflow/apis/convertflow-api/revisions/9a45e0736b68?raw)
