Skip to main content
POST
/
v1
/
sequences
Create Sequence
curl --request POST \
  --url https://api.example.com/v1/sequences \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "trigger": "<string>",
  "listId": "<string>",
  "tagName": "<string>",
  "eventName": "<string>",
  "inactiveDays": 123,
  "minCount": 123,
  "timeWindowDays": 123,
  "goal": "<string>",
  "emailCount": 123,
  "steps": [
    {
      "subject": "<string>",
      "previewText": "<string>",
      "blocks": [
        {}
      ],
      "html": "<string>",
      "delay": {
        "days": 123,
        "hours": 123,
        "minutes": 123
      },
      "name": "<string>"
    }
  ]
}
'
{
  "success": true,
  "message": "Sequence created. AI is generating email content based on your brand. This typically takes 30-60 seconds.",
  "sequence": {
    "id": "seq_abc123",
    "name": "Onboarding Sequence",
    "status": "draft",
    "emailCount": 5
  }
}

Create Sequence

Create an automation sequence that sends emails based on triggers. You can either:
  • Provide a goal to have AI generate the email content
  • Provide steps with explicit email content

Request

name
string
required
Name for the sequence
trigger
string
required
Trigger type: contact_added, tag_added, event_received, inactivity, or frequency
listId
string
List ID (for contact_added trigger)
tagName
string
Tag name (for tag_added trigger)
eventName
string
Event name (for event_received, inactivity, frequency triggers)
inactiveDays
number
Days of inactivity (for inactivity trigger)
minCount
number
Minimum event count (for frequency trigger)
timeWindowDays
number
Time window in days (for frequency trigger)

Option A: AI Generation

goal
string
Description of what the sequence should accomplish. AI will generate email content based on this.
emailCount
number
Number of emails to generate (default: 5)

Option B: Explicit Content

steps
array
Array of email steps with explicit content. Each step must have either blocks or html.

Examples

AI-Generated Content

curl -X POST "https://api.sequenzy.com/v1/sequences" \
  -H "Authorization: Bearer seq_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Onboarding Sequence",
    "trigger": "contact_added",
    "goal": "Welcome new users and help them get started with our product",
    "emailCount": 5
  }'

Explicit Content with Blocks

curl -X POST "https://api.sequenzy.com/v1/sequences" \
  -H "Authorization: Bearer seq_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome Sequence",
    "trigger": "contact_added",
    "steps": [
      {
        "subject": "Welcome to our product!",
        "blocks": [
          {
            "id": "heading-1",
            "type": "heading",
            "content": "Welcome!",
            "level": 1
          },
          {
            "id": "text-1",
            "type": "text",
            "content": "<p>Thanks for signing up. We are excited to have you.</p>",
            "variant": "paragraph"
          }
        ]
      },
      {
        "subject": "Getting started guide",
        "delay": { "days": 1 },
        "blocks": [
          {
            "id": "heading-2",
            "type": "heading",
            "content": "Getting Started",
            "level": 1
          },
          {
            "id": "text-2",
            "type": "text",
            "content": "<p>Here is everything you need to get started...</p>",
            "variant": "paragraph"
          }
        ]
      }
    ]
  }'

Explicit Content with HTML (Auto-converted)

Use this when migrating from other platforms or when you have existing HTML templates (React Email, MJML, etc.).
curl -X POST "https://api.sequenzy.com/v1/sequences" \
  -H "Authorization: Bearer seq_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Migrated Sequence",
    "trigger": "contact_added",
    "steps": [
      {
        "subject": "Welcome!",
        "html": "<h1>Welcome to our platform!</h1><p>We are thrilled to have you on board.</p><a href=\"https://example.com/start\">Get Started</a>"
      },
      {
        "subject": "Quick tips to get started",
        "delay": { "days": 2 },
        "html": "<h2>Getting Started Guide</h2><p>Here are some tips:</p><ul><li>Complete your profile</li><li>Explore the dashboard</li><li>Connect your integrations</li></ul>"
      }
    ]
  }'

Responses

{
  "success": true,
  "message": "Sequence created. AI is generating email content based on your brand. This typically takes 30-60 seconds.",
  "sequence": {
    "id": "seq_abc123",
    "name": "Onboarding Sequence",
    "status": "draft",
    "emailCount": 5
  }
}

Notes

  • The sequence is created in draft status. Use POST /sequences/{id}/enable to activate it.
  • When using steps, each step creates an email template in your account that can be edited later.
  • When using goal, AI generates content asynchronously. Poll GET /sequences/{id} to check enrichment status.
  • The first step typically has no delay (sends immediately after trigger).
  • When using html in steps, the content is automatically converted to Sequenzy blocks using AI. This supports:
    • Plain HTML
    • React Email rendered output
    • MJML compiled output
    • Any HTML-like email content