Remove a node from a draft campaign’s sequence and re-pack remaining positions.
status === "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.
end node. Every campaign needs a terminal end marker. Removing it will leave the campaign unlaunchable — GET /api/campaigns/{id}/validate will flag it.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).POST to insert.PUT to edit content.sequence_nodes list.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Campaign UUID
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Draft-only. Remaining nodes are re-packed to contiguous 0-indexed positions.
UUID of the node to delete. Must belong to this campaign.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Node deleted. Returns the fresh ordered list of sequence nodes. Falls back to { mutated: true } if the post-mutation read-back fails.
Successful mutation response. The server re-fetches the full sequence and returns it so clients don't have to round-trip a GET.
Fresh ordered list of nodes after the mutation. Absent (replaced by mutated: true + optional node_id) only if the server's best-effort read-back after the mutation failed.