v101

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-08235133843.7 KB
A/B Tests

Update A/B test variant

Updates an A/B test variant's subject, preview text, or body content. Campaign variants remain editable only while the test is in draft. Sequence variants can be edited later with confirmLiveChange when the sequence is active, the test is no longer a draft, or the test has recorded activity; earlier sends remain unchanged, so combined results may no longer be accurate.

patch/ab-tests/{abTestId}/variants/{variantId}

Path parameters

abTestIdstring required

A/B test ID.

variantIdstring required

Variant ID.

Request body

htmlstring

Raw HTML body. Provide either html or blocks, not both.

subjectstring
previewTextstring nullable
confirmLiveChangeboolean

Required as true when the sequence is active, the test is no longer a draft, or the test has recorded activity. Earlier sends remain unchanged, so combined results may no longer be accurate.

Example request

{
  "html": "<h1>Hello</h1>",
  "blocks": [
    {
      "id": "block_123",
      "type": "html",
      "content": "<h1>Hello</h1>",
      "styles": {
        "backgroundColor": "#f8fafc",
        "backgroundOpacity": 80,
        "textColor": "#111827",
        "borderRadius": 12,
        "borderColor": "#cbd5e1",
        "borderWidth": 1
      },
      "conditions": [
        {
          "id": "c1",
          "value": "plan:pro"
        }
      ]
    }
  ]
}

Response

Variant updated

successboolean
warningsstring[]

Non-blocking advisories about a successful write. Present when an input was discarded or did not take effect as requested. This includes block fields that do not render as their names suggest, sequence email-step formatting restored on top of submitted blocks, and sender-identity conflicts such as a replyToName that differs from the saved profile. Each message identifies the affected input and gives recovery guidance. Absent when there is nothing to report.

Example response

{
  "success": true,
  "variant": {
    "id": "var_a",
    "variantId": "var_a",
    "abTestId": "ab_abc123",
    "label": "A",
    "variantLabel": "A",
    "emailId": "email_abc123",
    "subject": "Welcome",
    "blocks": [
      {
        "id": "block_123",
        "type": "html",
        "content": "<h1>Hello</h1>",
        "styles": {
          "backgroundColor": "#f8fafc",
          "backgroundOpacity": 80,
          "textColor": "#111827",
          "borderRadius": 12,
          "borderColor": "#cbd5e1",
          "borderWidth": 1
        },
        "conditions": [
          {
            "id": "c1",
            "value": "plan:pro"
          }
        ]
      }
    ]
  },
  "warnings": [
    "blocks[0].styles.color is not a supported field and was ignored. Button label color comes from the block-level `buttonTextColor` field. Supported styles fields: backgroundColor, backgroundOpacity, bleed, borderColor, borderRadius, borderWidth, paddingBottom, paddingLeft, paddingRight, paddingTop, textAlign, textColor."
  ]
}