A/B Tests

Update A/B test settings

Changed on

Updates a draft or testing campaign test or the effective settings for a sequence test. Live campaign duration is measured from its original start; sample changes are asynchronous and preserve committed recipients. 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}

Request

  • Base URL
    https://api.sequenzy.com/api/v1
  • URL
    https://api.sequenzy.com/api/v1/ab-tests/{abTestId}
  • Auth
    HTTP bearer

Path parameters

abTestIdstring required

A/B test ID.

Request body

namestring
testPercentageinteger

Campaign-only integer share of the original full audience. Live changes queue a durable request; repeat the same percentage to retry.

testDurationMinutesinteger

Campaign-only total minutes from the original test start. An elapsed deadline queues selection immediately; paused campaigns stay paused.

winnerCriteria'open_rate' | 'click_rate' | 'goal_conversion_rate' | 'goal_value' | 'event_rate'

Winner metric for campaign or sequence tests; immutable once campaign testing starts, together with winnerGoalId and winnerEventName. Changing the criterion clears a goal or event the new criterion does not use.

winnerGoalIdstring nullable

Required for goal_conversion_rate and goal_value. A goal ID that is active and company-wide or scoped to this campaign or sequence, or default-revenue for built-in purchase revenue (SaaS purchases and commerce orders, in cents). Other goals return 400.

winnerEventNamestring nullable

Required for event_rate. The event a recipient must fire after receiving the variant.

testType'subject' | 'content'

Sequence-only variant strategy.

winnerThresholdinteger

Sequence-only recipient threshold.

autoSelectWinnerboolean

Sequence-only. True picks the leading variant once winnerThreshold is reached; false keeps splitting until a winner is selected. Resume sets it to false.

expectedUpdatedAtstring date-time

Optional campaign revision from GET; stale values return 409. Omit to preserve existing unconditional update behavior.

cancelSampleUpdateboolean

Discard a failed campaign sample request. Cannot be combined with testPercentage; does not undo committed sends.

endTestNowboolean

Campaign-only. End a running test now: the winner is picked by winnerCriteria from the results so far and sent to the remaining audience. Requires campaigns:send. Cannot be combined with testDurationMinutes; returns 400 for tests that are not running and 409 while a sample change is pending.

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"
              }
            ]
          }
        ]
      }
    ]
  }
}

Changes

    • info

      added the optional property ////// to the response with the status

    • warning

      added the new click_rate enum value to the / response property for the response status

    • warning

      added the new event_rate enum value to the / response property for the response status

    • warning

      added the new goal_conversion_rate enum value to the / response property for the response status

    • warning

      added the new goal_value enum value to the / response property for the response status

    • warning

      added the new open_rate enum value to the / response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new event_rate enum value to the request property

    • info

      added the new goal_conversion_rate enum value to the request property

    • info

      added the new goal_value enum value to the request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status