Delete Node
Email Steps
Delete Node
Remove a node from a draft campaign’s sequence and re-pack remaining positions.
DELETE
Delete Node
CLI:
Overview
Removes a node from the sequence by id. Draft campaigns only — every mutation on this collection is gated onstatus === "draft".
The nodeId travels in the JSON body, not the URL — the collection endpoint serves all three mutation verbs (POST add, PATCH move, DELETE remove) and keys off the body. The backing Postgres RPC holds a row-level lock while deleting and re-packing remaining nodes to contiguous 0-indexed positions, so concurrent mutations can’t corrupt the order.
Related operations
- Add a sequence node —
POSTto insert. - Update a sequence node —
PUTto edit content. - Get a campaign — returns the fresh
sequence_nodeslist.
AI agent notes
Don’t delete the
end node. Every campaign needs a terminal end marker. Removing it will leave the campaign unlaunchable.Positions re-pack automatically. After deletion, remaining nodes shift down so positions stay contiguous (0, 1, 2, …). You don’t need to follow up with moveSequenceNode calls.Read-back fallback. Normal response is { sequence_nodes: [...] }. If the post-mutation read-back fails, the server returns { mutated: true }; in that case refetch via GET /api/campaigns/{id}.Irreversible. There is no soft-delete. Confirm with the human before deleting if the node has been hand-authored content (subject, body, AI purpose).Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Campaign UUID
Body
application/json
String value with endpoint-specific validation.
Response
Node deleted. Returns the fresh ordered list, or a mutation fallback when read-back fails.
- Option 1
- Option 2