Campaigns

Generate variations

Changed on

Starts generating 1 to 4 variations with AI and returns them at once with status generating. Each one takes its own direction planned from your prompt, so they differ from each other; style sets how far they move. Generation runs in the background; poll List variations or Get variation until each is ready or failed (a variation still generating after 10 minutes is reported as failed). An email can have up to 8 variations generating at once. The source is the email's saved content, or the variation in parentVariationId, which must be ready. The campaign email itself does not change.

post/campaigns/{campaignId}/variations/generate

Request

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

Path parameters

campaignIdstring required

Campaign ID

Request body

promptstring required

The direction for the new versions, in any language.

countinteger
parentVariationIdstring nullable

Derive from this variation instead of the email. New variations are its branches.

style'close' | 'fresh' | 'bold'

How far the new versions move from the source. close edits it, keeping its style and structure; fresh writes each version anew with its own structure in the brand's colors and fonts; bold also gives each its own look (a theme of its own). Defaults to close for branches of a variation and fresh otherwise.

Example request

{
  "prompt": "Three versions that are shorter and warmer"
}

Response

Generation started

successboolean

Example response

{
  "success": true,
  "variations": [
    {
      "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