---
title: "Create a new sequence"
method: POST
path: "/v1/sequences"
tags: ["sequences"]
---

# Create a new sequence

`POST /v1/sequences`

Create a new sequence with a <code>title</code>. Optionally attach one or more sending email accounts via <code>emailAccountIds</code> and/or assign a schedule in the same call.

<strong>Upfront validation (all-or-nothing)</strong> — every <code>emailAccountIds</code> entry and <code>scheduleId</code> are validated before the sequence is created. If <em>any</em> hashed ID fails to decode, does not belong to the caller, refers to an inactive email account, or if the array would exceed the per-sequence email account limit or plan quota, the request is rejected with the corresponding error and <strong>no sequence is created</strong>. If <code>emailAccountIds</code> is omitted, the caller's default email account is attached automatically.

## Request body

- CreateSequenceDto
  - `title` string, required
  - `emailAccountIds` string[] — Array of hashed email account IDs to attach as senders of the sequence. If any ID is invalid, inactive, or exceeds the account limit, the entire request is rejected and no sequence is created.
  - `scheduleId` string — Hashed ID of the sending schedule to assign to the sequence.

## Response `201`

Sequence created successfully

- CreateSequenceResponseDto
  - `message` string — Response message indicating the status of the operation
  - `payload` Sequence
    - `id` string — Unique identifier for the sequence
    - `title` string — Title of the sequence
    - `active` boolean — Indicates whether the sequence is active or not
    - `steps` Step[] — Steps included in the sequence
      - `id` string — Unique identifier for the step in the sequence
      - `name` string — Name of the step in the sequence
    - `client` Client
      - `id` string — Unique identifier for the client associated with the sequence
      - `companyName` string — Company name of the client
      - `firstName` string — First name of the client
      - `lastName` string — Last name of the client
    - `user` SequenceUser
      - `id` number — Unique identifier for the sequence owner
      - `firstName` string — First name of the sequence owner
      - `lastName` string — Last name of the sequence owner
      - `email` string — Email address of the sequence owner

## Other responses

- `400` — 4000: Failed to create sequence<br><br>
- `500` — 5001: Internal server error, please try again later<br><br>

---

[API](https://skmtc.dev/saleshandy/apis/develop-with-saleshandy.md) · [All operations](https://skmtc.dev/saleshandy/apis/develop-with-saleshandy/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/saleshandy/develop-with-saleshandy/revisions/fdaa0f2dcdfb/schema)
