Skip to main content
DELETE
Delete Node
CLI:

Overview

Removes a node from the sequence by id. Draft campaigns only — every mutation on this collection is gated on 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.

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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Campaign UUID

Body

application/json
nodeId
string
required

String value with endpoint-specific validation.

Response

Node deleted. Returns the fresh ordered list, or a mutation fallback when read-back fails.

sequence_nodes
object[]
required