> ## 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 Campaign

> Cancel all running background jobs and remove the campaign plus every cascaded row. Irreversible.

**CLI:**

```bash theme={null}
puffle campaign delete --id <id>
```

## Overview

Deletes a campaign and everything that depends on it:

* Cancels every Trigger.dev run for in-flight leads (best-effort, batched in groups of 50)
* Deletes the `campaigns` row — Postgres FK cascades remove: `campaign_prospects`, `campaign_prospect_messages`, `campaign_sender_accounts` links, `campaign_sequence_nodes` (and their AI extensions)

**There is no undo.** Sent messages stay in downstream provider systems (LinkedIn invitations already out, emails already delivered) — we only clean up our own state.

## AI agent notes

<Note>
  **Confirm with the human before calling.** Deletion is total and irreversible. If the campaign has any `sent` leads, their conversation history in our `conversations` table is lost too.

  **Safer alternatives to offer first:**

  * `POST /api/campaigns/{id}/pause` — halts sends, keeps all data, reversible with `resume`
  * `PATCH /api/campaigns/{id}` with a renamed campaign + smaller sequence — if the user wants to pivot, not abandon

  **Best-effort trigger cancellation.** The Trigger.dev run-cancel calls are wrapped in `Promise.allSettled` — individual failures are swallowed, the DB delete proceeds either way. A 500 from this endpoint means the DB delete itself failed; run cancellation errors do not surface.
</Note>


## OpenAPI

````yaml delete /api/campaigns/{id}
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}:
    delete:
      tags:
        - Campaigns
      summary: Delete Campaign
      description: >-
        Cancel Trigger.dev runs and cascade-delete a non-live campaign. Active
        or launching campaigns must be paused before deletion.
      operationId: deleteCampaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Campaign UUID
      responses:
        '200':
          description: Campaign deleted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                required:
                  - success
                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 doesn't exist or isn't owned by the caller.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Campaign is active or launching and cannot be deleted yet.
          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_...

````