Create a sequence
Save a reusable sequence shape. The user chooses every step and gap; nothing is derived.
POST/api/v1/sequences
Parameters
Body
A JSON object, required. Fields not listed are ignored.
| Name | In | Description |
|---|---|---|
namerequired | body | Sequence name. |
description | body | What it is for. |
goal | body | What a reply should lead to. |
cadence_text | body | Cadence in plain English. |
workflow | body, object | The sequence as a workflow: { nodes, edges }. Nodes are start, email (purpose, notes, html, thread reply or new, variants, reply_intent), wait (days), if (rules: [{ id, label?, all: [{ check: opened or clicked, is: true or false }] }], checked in order, an edge per rule id plus else for Otherwise; an older if with check alone has Yes and No edges), reply (categories: interested, meeting_request, information_request, not_interested, out_of_office, contact_later, wrong_person, uncategorizable; one edge per category), action (set_stage or notify) and end. Edges leave by sourceHandle next, yes, no, reply or a reply category; an unsubscribe always stops the lead and is never a branch; a way out left unconnected ends the lead's path. Any step but start and end may carry label (its own name, up to 60 characters); a reply node may carry vertical: true (drawn as a tall box). A runnable workflow sets the steps and days; a half-drawn one is saved as drawn and its problems come back as workflow_issues. |
draft | body, boolean | Create: true saves a half-built workflow as a draft. Update: false finishes a draft (its workflow must run). A draft cannot go into a campaign. |
total_stepsrequired | body, integer | Number of emails in the sequence, 1 to 10. |
day_offsetsrequired | body, array | Day of each step counted from launch, one integer per step, the first is 0. |
ab_enabled | body, boolean | Write A/B variants. |
variants_count | body, integer | Variants per step, 1 to 3. |
generation_mode | body | personalized writes every lead its own copy; template writes one email per step with a {{hook}} slot. One of personalized, template. |
use_html | body, boolean | Send HTML instead of plain text. |
cta_policy | body | reply_only or link_allowed. One of reply_only, link_allowed. |
word_ceiling | body, integer | Target words per email, 40 to 400 (120 by default); the writer goes shorter or longer when the copy needs it, and only a body half again over is flagged. |
thread_followups | body, boolean | Follow-ups reply in the same thread. |
steps | body, array | Per-step purpose and notes: [{step_number, purpose, notes}]; purpose is opener, new_angle, question, proof, dissatisfaction, breakup or custom. |
Example
curl
curl -X POST "https://crm.ashwanth.dev/api/v1/sequences" \
-H "Authorization: Bearer $SALES_ENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "",
"total_steps": 0,
"day_offsets": [],
"description": "",
"goal": "",
"cadence_text": "",
"workflow": {},
"draft": false,
"ab_enabled": false,
"variants_count": 0,
"generation_mode": "personalized",
"use_html": false,
"cta_policy": "reply_only",
"word_ceiling": 0,
"thread_followups": false,
"steps": []
}'CLI
sales-engine sequences create --name "..." --total-steps 1 --day-offsets '[]'The JSON above lists every documented field with a typed placeholder; send only the ones you mean.
Response
A 200 with the result under data, on creation too. Errors come back as an error object with a stable code; see Errors.
Shape
{
"data": { ... }
}Run it below to see the live shape for your workspace.
Try it
Runs against this server, as the workspace behind the key. Kept in this page while you browse the docs, gone on reload, never stored. Signed in to the app? Leave it blank and the call runs as you.
Every documented field is listed above; leave out the ones you do not need.
Request
POST /api/v1/sequences