Campaigns

Edit variation with AI

Changed on

Changes one ready variation with AI and saves the result over it, like an edit in the editor. The prompt says what to change, in any language. With sectionIds, only those top-level blocks change; a whole-variation edit may also give the variation its own emailTheme and fontFamily. Runs synchronously and can take up to a minute. The campaign email does not change; use Use variation for that.

post/campaigns/{campaignId}/variations/{variationId}/edit

Request

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

Path parameters

campaignIdstring required

Campaign ID

variationIdstring required

Variation ID

Request body

promptstring required

What should change, in any language.

sectionIdsstring[]

Only change these top-level blocks. Omit to change the whole variation.

Example request

{
  "prompt": "Make the hero dark and the headline punchier"
}

Response

The variation, changed and saved

successboolean
summarystring

What the edit changed, in a sentence.

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