Skip to main content
POST
/
api
/
v1
/
ab-tests
/
{abTestId}
/
variants
Add A/B Test Variant
curl --request POST \
  --url https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subject": "<string>",
  "previewText": "<string>",
  "blocks": [
    {}
  ]
}
'
{
  "success": true,
  "abTest": {
    "id": "ab_abc123",
    "campaignId": "camp_abc123",
    "status": "draft",
    "variants": [
      { "id": "var_a", "label": "A", "subject": "A quick update" },
      { "id": "var_b", "label": "B", "subject": "Alternative subject line" },
      { "id": "var_c", "label": "C", "subject": "Third subject idea" }
    ]
  }
}
Add a variant to a draft campaign A/B test. The next variant label (B, C, …) is assigned automatically. A test can have at most 5 variants, and variants cannot be added after the test has started.

Request

abTestId
string
required
A/B test ID.
subject
string
required
Variant subject line.
previewText
string
Variant preview text.
blocks
array
Variant body blocks. Defaults to the campaign email blocks when omitted.
curl -X POST "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123/variants" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subject": "Third subject idea"}'

Responses

{
  "success": true,
  "abTest": {
    "id": "ab_abc123",
    "campaignId": "camp_abc123",
    "status": "draft",
    "variants": [
      { "id": "var_a", "label": "A", "subject": "A quick update" },
      { "id": "var_b", "label": "B", "subject": "Alternative subject line" },
      { "id": "var_c", "label": "C", "subject": "Third subject idea" }
    ]
  }
}