Sequences

Create sequence

Creates a draft automation sequence using AI-generated content, explicit email/action steps, or a blank trigger-to-completion graph when both are omitted. Discount action steps dynamically generate Stripe or Shopify codes that later emails can reference with discount merge tags.

post/sequences

Request body

descriptionstring

Optional dashboard description.

userCancellableboolean

Whether recipients can cancel this sequence from email preferences.

labelsstring[]

Dashboard label names. Missing labels are created.

bccEmailsstring[] nullable

Addresses blind-copied on every sequence email.

fromEmailstring email

From address for every email in this sequence. Its domain must be configured and verified.

fromNamestring

Display name for a newly created sender profile. Requires fromEmail.

senderProfileIdstring

Existing sender profile ID. Mutually exclusive with fromEmail.

replyTostring email

Reply-To address for every email in this sequence. A profile is created when needed.

replyToNamestring

Display name for a newly created reply profile. Requires replyTo.

replyProfileIdstring

Existing reply profile ID. Mutually exclusive with replyTo.

namestring required
trigger'contact_added' | 'tag_added' | 'segment_entered' | 'event_received' | 'inbound_webhook' | 'inactivity' | 'frequency'
listIdstring

List ID for contact_added triggers. If omitted, contact_added can match any list.

tagNamestring

Tag name for tag_added triggers.

segmentIdstring

Segment ID for segment_entered triggers.

stopOnSegmentExitboolean

For segment_entered triggers, cancel enrollment when the subscriber leaves the segment.

eventNamestring

Event name for event_received, inbound_webhook, inactivity, and frequency triggers.

integrationSlugstring

Integration slug for inbound_webhook triggers.

integrationEventKeystring

Integration event key for inbound_webhook triggers.

customIntegrationobject

Custom inbound-webhook integration metadata.

inactiveDaysnumber

Days of inactivity before the sequence starts.

inactivityBaseline'sequence_created_at' | 'subscriber_created_at'

For inactivity triggers, controls when to start counting for subscribers who have never performed the event. Defaults to sequence_created_at.

minCountnumber

Minimum event count for frequency triggers.

timeWindowDaysnumber

Time window in days for frequency triggers.

enrollmentMode'unlimited' | 'one_time' | 'matching_field'

Controls sequence re-entry. unlimited allows re-entry after completion but prevents concurrent active runs. one_time allows one enrollment ever. matching_field is only valid for event-triggered sequences and allows concurrent active runs only when the trigger payload resolves to a different event field value.

enrollmentFieldPathstring

Scalar dot-path event property used by matching_field enrollment, such as order.id or product.providerVariantId. Array traversal with [] is not supported; use propertyFilters for array matching. Applies to event_received and inbound_webhook triggers. Leave empty for built-in Shopify product/variant defaults.

emailCountnumber

Number of emails for AI-generated content. Defaults to 5. Maximum is 10.

durationDaysnumber

Total duration in days used to space AI-generated emails. Omit this to use the default sequence delay schedule.

emailStyle'visual' | 'plain'

Style for the AI-generated emails: visual (designed, with heroes/imagery/rich sections) or plain (personal, text-first notes with a single button). Defaults to the company's saved preference when omitted.

goalstring

Goal for AI-generated sequence content. Provide either goal or steps, or omit both for a blank dashboard-compatible draft.

Example request

{
  "name": "Welcome Sequence",
  "listId": "list_abc123",
  "tagName": "trial",
  "segmentId": "seg_abc123",
  "eventName": "onboarding.started",
  "propertyFilters": [
    {
      "path": "lineItems[].providerProductId",
      "operator": "equals"
    }
  ],
  "inactiveDays": 14,
  "inactivityBaseline": "sequence_created_at",
  "minCount": 3,
  "timeWindowDays": 7,
  "enrollmentFieldPath": "order.id",
  "sendingWindow": {
    "enabled": true,
    "timezone": "Europe/Kiev",
    "startTime": "08:00",
    "endTime": "20:00",
    "days": [
      "monday",
      "tuesday",
      "wednesday",
      "thursday",
      "friday"
    ]
  },
  "emailCount": 5,
  "durationDays": 14,
  "emailStyle": "visual",
  "goal": "Welcome new users and help them reach activation.",
  "stopCondition": {
    "value": "saas.purchase"
  },
  "steps": [
    {
      "type": "create_discount",
      "subject": "Welcome to Acme",
      "previewText": "Here is what to do next",
      "text": "Hey {{FIRST_NAME}}, your order shipped!",
      "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"
            }
          ]
        }
      ],
      "html": "<h1>Welcome</h1><p>Thanks for joining.</p>",
      "attachments": [
        {
          "filename": "guide.pdf",
          "path": "https://example.com/files/guide.pdf"
        }
      ],
      "delay": {
        "mode": "until_date",
        "days": 1,
        "hours": 2,
        "minutes": 30,
        "untilDateField": "renews_at",
        "field": "event.subscription.renews_at",
        "untilOffsetDirection": "before",
        "direction": "before",
        "untilMissingAction": "exit",
        "missingAction": "exit"
      },
      "waitUntil": {
        "field": "renews_at",
        "untilDateField": "event.subscription.renews_at",
        "offset": {
          "days": 1,
          "hours": 2,
          "minutes": 30
        },
        "days": 1,
        "hours": 2,
        "minutes": 30,
        "direction": "before",
        "untilOffsetDirection": "before",
        "missingAction": "exit",
        "untilMissingAction": "exit"
      },
      "delayMs": 86400000,
      "name": "Welcome Sequence - Email 1",
      "discount": {
        "label": "Create win-back discount",
        "provider": "stripe",
        "discountType": "percent",
        "percentOff": 20,
        "amountOff": 500,
        "currency": "usd",
        "duration": "once",
        "durationInMonths": 3,
        "appliesToAllPlans": true,
        "planIds": [
          "prod_abc123"
        ],
        "codePrefix": "SAVE",
        "maxRedemptions": 1,
        "lockToSubscriber": true,
        "expiresAt": "2026-12-31",
        "expiresInHours": 48,
        "name": "Win-back coupon"
      },
      "label": "Create win-back discount",
      "provider": "stripe",
      "discountType": "percent",
      "percentOff": 20,
      "amountOff": 500,
      "currency": "usd",
      "duration": "once",
      "durationInMonths": 3,
      "appliesToAllPlans": true,
      "planIds": [
        "prod_abc123"
      ],
      "codePrefix": "SAVE",
      "maxRedemptions": 1,
      "lockToSubscriber": true,
      "expiresAt": "2026-12-31",
      "expiresInHours": 48
    }
  ]
}

Response

Sequence created successfully

successboolean
messagestring
eventTrackingCodestring

Code snippet returned for custom event triggers.

requiredEventsstring[]

Example response

{
  "success": true,
  "message": "Sequence created with 2 emails and 1 discount action. Use POST /api/v1/sequences/{id}/enable to activate.",
  "sequence": {
    "id": "seq_abc123",
    "name": "Welcome Sequence",
    "trigger": "trigger_list",
    "emailCount": 2,
    "discountCount": 1,
    "subscriberUpdateCount": 1,
    "nodeCount": 5,
    "enrichmentStatus": "processing",
    "stopCondition": {
      "value": "saas.purchase"
    },
    "sendingWindow": {
      "enabled": true,
      "timezone": "Europe/Kiev",
      "startTime": "08:00",
      "endTime": "20:00",
      "days": [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday"
      ]
    }
  },
  "eventTracking": {
    "endpoint": "https://api.sequenzy.com/api/v1/subscribers/events",
    "method": "POST",
    "docsUrl": "https://docs.sequenzy.com/api-reference/subscribers/events/trigger",
    "integrationGuide": {
      "tool": "get_integration_guide",
      "arguments": {
        "use_case": "event_tracking"
      }
    },
    "payloadContract": {
      "propertyFilters": [
        {
          "path": "lineItems[].providerProductId",
          "operator": "equals"
        }
      ]
    },
    "examplePayload": {
      "email": "user@example.com",
      "event": "trial.started",
      "properties": {
        "trial_id": "<trial_id>"
      }
    },
    "examplePayloadMatchesFilters": true
  }
}

Changes