Campaigns

Create variation

Changed on

Saves a version of the email as a new ready variation, for example a copy you want to take in another direction. Provide blocks or html (not both). Footerless blocks get the company's default footer, as on Update campaign. Labels are assigned in order (V1, V2, ...); a variation with parentVariationId is labeled as its branch (V2.1, V2.2, ...). Labels are never reused, even after a discard.

post/campaigns/{campaignId}/variations

Request

  • Base URL
    https://api.sequenzy.com/api/v1
  • URL
    https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations
  • Auth
    HTTP bearer

Path parameters

campaignIdstring required

Campaign ID

Request body

namestring required
summarystring nullable
htmlstring

HTML converted to blocks. Use instead of blocks.

subjectstring nullable

Subject this variation uses. Null keeps the email's subject.

previewTextstring nullable

Preview text this variation uses. Null keeps the email's preview text.

parentVariationIdstring nullable

The variation this one is derived from.

emailThemeobject nullable

The variation's own email theme (presetId, colors, typography, layout). A partial theme is completed with defaults. Null uses the email's theme. Using the variation puts its theme on the email.

fontFamilystring nullable

The variation's own body font stack. Null uses the email's font.

Example request

{
  "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

Variation created

successboolean
warningsstring[]

Block fields that were accepted but had no effect.

Example response

{
  "success": true,
  "variation": {
    "label": "V2.1",
    "name": "Warm and personal",
    "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