---
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.
  - `propertyFilters` SequenceTriggerPropertyFilter[] — Event property filters for event_received triggers. The sequence only starts when the triggering event's properties match all filters. Use [] in the path to match items inside arrays.
    - `path` string, required — Dot-path into the event properties. Use [] to match items inside arrays.
    - `operator` 'exists' | 'not_exists' | 'equals' | 'not_equals' | 'one_of' | 'contains' | 'greater_than' | 'less_than', required — Comparison operator. Value is required for every operator except exists and not_exists. `one_of` matches when the property equals any entry of the value array.
    - `value` union — Value to compare against. For `one_of`, pass a non-empty array of strings or numbers (maximum 50 values); all other operators take a single value.
      - string
      - number
      - boolean
      - union[]
        - union
          - string
          - number
  - `inactiveDays` number — 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.
  - `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. Put visual styling under styles; top-level style keys such as backgroundColor, backgroundOpacity, borderColor, borderWidth, and borderRadius are normalized into styles.
      - `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.
      - `styles` object — Per-block visual styles. For compatibility, style fields such as backgroundColor, backgroundOpacity, borderColor, borderWidth, and borderRadius can also be supplied at the block top level and are normalized into this object.
        - `paddingTop` number
        - `paddingBottom` number
        - `paddingLeft` number
        - `paddingRight` number
        - `backgroundColor` string
        - `backgroundOpacity` number — Background opacity percentage from 0 to 100.
        - `textColor` string
        - `textAlign` 'left' | 'center' | 'right'
        - `borderRadius` number
        - `borderColor` string
        - `borderWidth` number
    - `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-06-12** `f9a826460811` — 2 info
  - added the new `one_of` enum value to the request property `propertyFilters/items/operator`
  - request property `propertyFilters/items/value` list-of-types was widened by adding types `array` to media type `application/json`
- **2026-06-11** `ad2d3114269a` — 1 info
  - added the new optional request property `propertyFilters`
- **2026-06-06** `d2c0e3a56514` — 1 info
  - added the new optional request property `inactivityBaseline`
- **2026-05-25** `402884feb64a` — 1 info
  - added the new optional request property `steps/items/blocks/items/styles/backgroundOpacity`
- **2026-05-25** `e8b9a2b46341` — 1 info
  - added the new optional request property `steps/items/blocks/items/styles`

[Full 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/f9a826460811/schema)
