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
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
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"
]
}
},
"warnings": [
"blocks[0].styles.color is not a supported field and was ignored. Button label color comes from the block-level `buttonTextColor` field. Supported styles fields: backgroundColor, backgroundOpacity, bleed, borderColor, borderRadius, borderWidth, paddingBottom, paddingLeft, paddingRight, paddingTop, textAlign, textColor."
],
"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
}
}