Add Node
Email Steps
Add Node
Insert a new node into a draft campaign’s sequence. Also the home page for moving and deleting nodes on the same collection.
POST
Add Node
CLI:
To edit a node’s content (subject, body, delay values, AI purpose), use
Overview
Inserts a new node into the campaign sequence. Draft campaigns only — every mutation on this collection is gated onstatus === "draft".
This collection exposes three verbs:
| Verb | Operation | Purpose |
|---|---|---|
POST | addSequenceNode | Insert a new node (this page). Omit position to drop it right before the terminal end node. |
PATCH | moveSequenceNode | Reorder an existing node — see Move a sequence node. |
DELETE | deleteSequenceNode | Remove a node — see Delete a sequence node. |
updateSequenceNode against the singular /sequence/nodes/{nodeId} route. Type is immutable after creation — to change it, delete and re-add.
Every mutation on this collection is backed by an atomic Postgres RPC with row-level locking, so concurrent adds, moves, and deletes can’t corrupt the position ordering.
AI agent notes
Typical build order.
POST /api/campaignsto create a draft.- Loop over your desired nodes and
POST /api/campaigns/{id}/sequence/nodesfor each — omitpositionand every node lands just before the auto-inserted terminalend. - When done,
POST /api/campaigns/{id}/launch.
type determines which node kinds are legal:linkedincampaigns acceptconnection_request,message,delay,ai,end.emailcampaigns acceptemail,delay,ai,end.
{ sequence_nodes: [...] } — the full list, already ordered. On the rare occasion the post-mutation read-back fails, the server returns { mutated: true, node_id }. In that case refetch via GET /api/campaigns/{id}.Position omitted = before the end. Don’t set position unless you specifically need to insert somewhere other than the natural end-of-sequence slot. The server handles ordering.AI nodes. Adding { type: "ai" } creates the base row; populate purpose and output_type with a follow-up PUT /api/campaigns/{id}/sequence/nodes/{nodeId} call.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Campaign UUID
Body
application/json
Available options:
connection_request, message, email, delay, ai, end Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Response
Node inserted. Returns the fresh ordered list, or a mutation fallback when read-back fails.
- Option 1
- Option 2