Sequences
Create sequence
Creates a draft automation sequence using either AI-generated content or explicit email/action steps. Discount action steps generate Stripe promotion 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",
"emailCount": 5,
"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",
"blocks": [
{
"id": "block_123",
"type": "html",
"content": "<h1>Hello</h1>",
"styles": {
"backgroundColor": "#f8fafc",
"backgroundOpacity": 80,
"textColor": "#111827",
"borderRadius": 12,
"borderColor": "#cbd5e1",
"borderWidth": 1
}
}
],
"html": "<h1>Welcome</h1><p>Thanks for joining.</p>",
"delay": {
"days": 1,
"hours": 2,
"minutes": 30
},
"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,
"nodeCount": 5,
"enrichmentStatus": "processing",
"stopCondition": {
"value": "saas.purchase"
}
}
}