Skip to main content
DELETE
/
api
/
campaigns
/
{id}
/
sequence
/
nodes
Delete Node
curl --request DELETE \
  --url https://app.puffle.ai/api/campaigns/{id}/sequence/nodes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "nodeId": "<string>"
}
'
{
  "sequence_nodes": [
    {
      "id": "<string>",
      "campaign_id": "<string>",
      "position": 4503599627370495,
      "subject": "<string>",
      "body": "<string>",
      "body_html": "<string>",
      "signature": "<string>",
      "from_name": "<string>",
      "reply_to": "<string>",
      "cc": "<string>",
      "bcc": "<string>",
      "attachments": [
        "<unknown>"
      ],
      "include_message": true,
      "is_reply": true,
      "delay_days": 4503599627370495,
      "delay_hours": 4503599627370495,
      "delay_minutes": 4503599627370495,
      "ai_node": {}
    }
  ]
}
CLI:
puffle campaign sequence node delete --id <id> --node-id <node-id>

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