> ## Documentation Index
> Fetch the complete documentation index at: https://docs.puffle.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Node

> Remove a node from a draft campaign's sequence and re-pack remaining positions.

**CLI:**

```bash theme={null}
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.

## Related operations

* [Add a sequence node](/api-reference/campaigns/add-sequence-node) — `POST` to insert.
* [Update a sequence node](/api-reference/campaigns/update-sequence-node) — `PUT` to edit content.
* [Get a campaign](/api-reference/campaigns/get-campaign) — returns the fresh `sequence_nodes` list.

## AI agent notes

<Note>
  **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).
</Note>


## OpenAPI

````yaml delete /api/campaigns/{id}/sequence/nodes
openapi: 3.0.3
info:
  title: Puffle API
  version: 1.0.0
  description: >-
    HTTP API for the Puffle GTM platform - Feed and Lead Finder search
    preparation, campaign-backed Outbound execution, Puffle Agent runs, sender
    management, and Unibox reply workflows. Designed for operation by both
    humans and autonomous AI agents. Agents should start at the [Agent
    Playbook](/guides/agent-playbook) which prescribes a workspace-context check
    (`GET /api/context`) and core user journeys with exact call ordering.
  contact:
    name: Puffle Support
    url: https://puffle.ai
servers:
  - url: https://app.puffle.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Campaigns
    description: >-
      Campaign-backed Outbound execution. These endpoints manage draft,
      launching, active, paused, and completed Outbound runs with sequence
      nodes, contacts, and sender accounts.
  - name: Accounts
    description: Signed-in user account, settings, and workspace context endpoints.
  - name: Billing
    description: Billing customer portal and account billing endpoints.
  - name: Senders
    description: >-
      Connected sender accounts, email inboxes, sending domains, DNS
      verification, warmup, and sender capacity.
  - name: Socials
    description: >-
      Read connected LinkedIn and X accounts, review current and archived posts,
      and reconcile publication status. Creating, editing, scheduling,
      publishing, OAuth connection, analytics, and mentions remain
      dashboard-managed workflows and are not part of the public Bearer-token
      API.
paths:
  /api/campaigns/{id}/sequence/nodes:
    delete:
      tags:
        - Campaigns
      summary: Delete Node
      description: Remove a node from the campaign sequence by id. Draft campaigns only.
      operationId: deleteSequenceNode
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Campaign UUID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nodeId:
                  type: string
                  description: String value with endpoint-specific validation.
              required:
                - nodeId
              additionalProperties: false
      responses:
        '200':
          description: >-
            Node deleted. Returns the fresh ordered list, or a mutation fallback
            when read-back fails.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      sequence_nodes:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: String value with endpoint-specific validation.
                            campaign_id:
                              type: string
                              description: String value with endpoint-specific validation.
                            position:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            type:
                              type: string
                              enum:
                                - connection_request
                                - message
                                - email
                                - delay
                                - ai
                                - end
                            subject:
                              type: string
                              nullable: true
                            body:
                              type: string
                              nullable: true
                            body_html:
                              type: string
                              nullable: true
                            signature:
                              type: string
                              nullable: true
                            from_name:
                              type: string
                              nullable: true
                            reply_to:
                              type: string
                              nullable: true
                            cc:
                              type: string
                              nullable: true
                            bcc:
                              type: string
                              nullable: true
                            attachments:
                              type: array
                              items: {}
                              nullable: true
                            include_message:
                              type: boolean
                              nullable: true
                            is_reply:
                              type: boolean
                              nullable: true
                            delay_days:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              nullable: true
                            delay_hours:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              nullable: true
                            delay_minutes:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              nullable: true
                            ai_node:
                              type: object
                              properties:
                                output_type:
                                  type: string
                                  enum:
                                    - email
                                    - message
                              required:
                                - output_type
                              additionalProperties: {}
                              nullable: true
                          required:
                            - id
                            - campaign_id
                            - position
                            - type
                          additionalProperties: false
                    required:
                      - sequence_nodes
                    additionalProperties: false
                  - type: object
                    properties:
                      mutated:
                        type: boolean
                        enum:
                          - true
                      node_id:
                        type: string
                        description: String value with endpoint-specific validation.
                    required:
                      - mutated
                    additionalProperties: false
        '400':
          description: Validation failure, malformed RPC input, or non-draft campaign.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Campaign or node not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: pk_live_...

````