---
title: "Create sequence"
method: POST
path: "/sequences"
tags: ["Sequences"]
---

# Create sequence

`POST /sequences`

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.

## Request body

- SequenceCreateRequest
  - `name` string, required
  - `trigger` 'contact_added' | 'tag_added' | 'segment_entered' | 'event_received' | 'inactivity' | 'frequency', required
  - `listId` string — List ID for contact_added triggers. If omitted, contact_added can match any list.
  - `tagName` string — Tag name for tag_added triggers.
  - `segmentId` string — Segment ID for segment_entered triggers.
  - `eventName` string — Event name for event_received, inactivity, and frequency triggers.
  - `inactiveDays` number — Days of inactivity before the sequence starts.
  - `minCount` number — Minimum event count for frequency triggers.
  - `timeWindowDays` number — 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.
  - `enrollmentFieldPath` string — Dot-path event property used by matching_field enrollment, such as order.id or product.providerVariantId. Only applies to event_received triggers. Leave empty for built-in Shopify product/variant defaults.
  - `emailCount` number — Number of emails for AI-generated content. Defaults to 5. Maximum is 10.
  - `goal` string — Goal for AI-generated sequence content. Provide either goal or steps.
  - `stopCondition` SequenceStopCondition
    - `type` 'none' | 'has_tag' | 'does_not_have_tag' | 'added_to_list' | 'removed_from_list' | 'event_received'
    - `value` string, nullable
  - `steps` SequenceStepInput[] — Explicit email and action steps. Provide either steps or goal.
    - `type` 'email' | 'create_discount' | 'discount' — Step type. Omit or use email for email content; use create_discount for a Stripe discount action.
    - `nodeType` 'action_email' | 'action_create_discount' — Internal node-type alias for clients that work with automation nodes.
    - `subject` string — Email subject line for email steps.
    - `previewText` string — Optional email preview text.
    - `blocks` EmailBlock[] — Structured Sequenzy email blocks. Provide either blocks or html.
      - `id` string
      - `type` 'text' | 'html' | 'heading' | 'list' | 'button' | 'spacer' | 'divider' | 'image' | 'columns' | 'conditional-group' | 'card' | 'cta' | 'social' | 'logo' | 'footer' | 'video' | 'product', required
      - `content` string — Content for text, html, and heading-like blocks.
    - `html` string — Raw HTML to convert into Sequenzy blocks. Provide either html or blocks.
    - `delay` SequenceDelayInput — Delay before this step runs.
      - `days` number
      - `hours` number
      - `minutes` number
    - `name` string — Optional email template name for email steps.
    - `discount` SequenceDiscountInput — Discount configuration for create_discount steps.
      - `label` string — Builder label for discount steps.
      - `provider` 'stripe' — Discount provider. Currently only stripe is supported.
      - `discountType` 'percent' | 'amount' — Discount type for create_discount steps.
      - `percentOff` number — Percent discount. Required when discountType is percent.
      - `amountOff` number — Fixed discount amount in the smallest currency unit, for example 500 for $5. Required when discountType is amount.
      - `currency` string — ISO currency for fixed-amount discounts. Defaults to usd.
      - `duration` 'once' | 'forever' | 'repeating' — Stripe coupon duration. Defaults to once.
      - `durationInMonths` number — Required for repeating discounts.
      - `appliesToAllPlans` boolean — Whether the discount applies to all plans. Defaults to true.
      - `planIds` string[] — Stripe product IDs, such as prod_abc123, when appliesToAllPlans is false.
      - `codePrefix` string — Optional prefix for generated promotion codes.
      - `maxRedemptions` number — Maximum promotion-code redemptions. Use 1 for subscriber-specific codes.
      - `lockToSubscriber` boolean — Stripe-only. Restrict each generated promotion code to the matched subscriber's Stripe customer.
      - `expiresAt` string — Optional future expiration date or ISO timestamp. Mutually exclusive with expiresInHours.
      - `expiresInHours` number — Optional relative expiration in hours, resolved when each subscriber's code is created. Takes precedence over expiresAt.
      - `name` string — Optional provider coupon name.
    - `label` string — Legacy top-level builder label for discount steps. Prefer discount.label.
    - `provider` 'stripe' — Legacy top-level discount provider. Prefer discount.provider.
    - `discountType` 'percent' | 'amount' — Legacy top-level discount type. Prefer discount.discountType.
    - `percentOff` number — Percent discount. Required when discountType is percent.
    - `amountOff` number — Fixed discount amount in the smallest currency unit, for example 500 for $5. Required when discountType is amount.
    - `currency` string — ISO currency for fixed-amount discounts. Defaults to usd.
    - `duration` 'once' | 'forever' | 'repeating' — Stripe coupon duration. Defaults to once.
    - `durationInMonths` number — Required for repeating discounts.
    - `appliesToAllPlans` boolean — Whether the discount applies to all plans. Defaults to true.
    - `planIds` string[] — Stripe product IDs, such as prod_abc123, when appliesToAllPlans is false.
    - `codePrefix` string — Optional prefix for generated promotion codes.
    - `maxRedemptions` number — Maximum promotion-code redemptions. Use 1 for subscriber-specific codes.
    - `lockToSubscriber` boolean — Legacy top-level Stripe-only flag. Prefer discount.lockToSubscriber.
    - `expiresAt` string — Optional future expiration date or ISO timestamp. Mutually exclusive with expiresInHours.
    - `expiresInHours` number — Optional relative expiration in hours, resolved when each subscriber's code is created. Takes precedence over expiresAt.

## Response `200`

Sequence created successfully

- SequenceCreateResponse
  - `success` boolean
  - `message` string
  - `sequence` object
    - `id` string
    - `name` string
    - `status` 'draft' | 'active' | 'paused' | 'archived'
    - `trigger` string
    - `emailCount` number
    - `discountCount` number
    - `nodeCount` number
    - `enrichmentStatus` string
    - `stopCondition` SequenceStopCondition
      - `type` 'none' | 'has_tag' | 'does_not_have_tag' | 'added_to_list' | 'removed_from_list' | 'event_received'
      - `value` string, nullable
  - `eventTrackingCode` string — Code snippet returned for custom event triggers.
  - `requiredEvents` string[]

## Other responses

- `400` — Validation error
- `401` — Unauthorized
- `403` — No company selected
- `500` — Internal server error

## Changes

- **2026-04-29** `5dcea866d68e` — 2 info
  - added the new optional request property `steps/items/discount/allOf[#/components/schemas/SequenceDiscountInput]/lockToSubscriber`
  - added the new optional request property `steps/items/lockToSubscriber`
- **2026-04-27** `97fc1deb5949` — 1 warning, 3 info
  - added the new `removed_from_list` enum value to the `sequence/stopCondition/type` response property for the response status `200`
  - added the new optional request property `enrollmentFieldPath`
  - added the new optional request property `enrollmentMode`
  - added the new optional request property `stopCondition`
- **2026-04-23** `97195824586e` — 19 info
  - added the new optional request property `steps/items/amountOff`
  - added the new optional request property `steps/items/appliesToAllPlans`
  - added the new optional request property `steps/items/codePrefix`
  - added the new optional request property `steps/items/currency`
  - …15 more
- **2026-04-20** `ed7439559402` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/sequences/post.md)

---

[API](https://skmtc.dev/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.dev/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sequenzy/sequenzy-api/revisions/b040bb8c6608/schema)
