v97

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

Update A/B test settings

Updates a draft campaign test or the effective settings for a sequence test. Campaigns use testPercentage and testDurationMinutes; sequences use testType and winnerThreshold. Sequence changes that affect a live or already-used test require confirmLiveChange.

patch/ab-tests/{abTestId}

Path parameters

abTestIdstring required

A/B test ID.

Request body

namestring
testPercentageinteger

Campaign-only test audience percentage.

testDurationMinutesinteger

Campaign-only test duration.

winnerCriteria'open_rate' | 'click_rate'

Winner metric for campaign or sequence tests.

testType'subject' | 'content'

Sequence-only variant strategy.

winnerThresholdinteger

Sequence-only recipient threshold.

confirmLiveChangeboolean

Required when sequence settings affect an active test or a test with recorded activity.

Response

A/B test settings updated

successboolean

Example response

{
  "success": true,
  "abTest": {
    "id": "ab_abc123",
    "companyId": "company_abc123",
    "campaignId": "camp_abc123",
    "automationNodeId": "node_abc123",
    "name": "Subject test",
    "status": "draft",
    "winnerCriteria": "open_rate",
    "variants": [
      {
        "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"
              }
            ]
          }
        ]
      }
    ]
  }
}