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

# Pause Campaign

> Halt an active campaign mid-send. Completes waitpoint tokens so Trigger.dev tasks observe the new state.

**CLI:**

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

## Overview

Flips an `active` campaign to `paused`. Only `active` campaigns can be paused — every other status returns 400. The request body is empty.

Under the hood the server does two things:

1. A compare-and-set update on `campaigns.status` (fast, the only step that can fail the request).
2. Completes every outstanding Trigger.dev waitpoint token for this campaign's leads with `{ paused: true }`, so sleeping per-lead tasks wake up and re-check the status. This step is best-effort — token-completion failures are logged but do not surface as a 500.

## AI agent notes

<Note>
  **When to call.** After a bounce spike, a misconfigured template, or explicit user intent. Validate on your side first — there's no server-side dry-run.

  **What changes immediately.** `campaigns.status` flips to `paused` synchronously. Sleeping tasks continue to exist on Trigger.dev until their waitpoint tokens resolve, but they will no-op on the pause check at the top of the engine loop.

  **Idempotency.** Not idempotent — a second call while already `paused` returns 400 (`Only active campaigns can be paused`). Treat that as a safe success for user-facing flows.

  **Follow-up.** Poll `GET /api/campaigns/{id}` to confirm `status === "paused"` before reporting success to the human. Resume later with `POST /api/campaigns/{id}/resume`.
</Note>


## OpenAPI

````yaml post /api/campaigns/{id}/pause
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}/pause:
    post:
      tags:
        - Campaigns
      summary: Pause Campaign
      description: >-
        Flip an active campaign to paused, or stop a stuck launching campaign,
        and complete every outstanding Trigger.dev waitpoint token so per-lead
        tasks wake up and check the new status.
      operationId: pauseCampaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Campaign UUID
      responses:
        '200':
          description: >-
            Campaign paused. Returns the updated campaign row with `status:
            "paused"`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign:
                    type: object
                    properties:
                      id:
                        type: string
                        description: String value with endpoint-specific validation.
                      user_id:
                        type: string
                        description: String value with endpoint-specific validation.
                      type:
                        type: string
                        enum:
                          - linkedin
                          - email
                          - multi_channel
                        description: >-
                          Channel mode for this campaign. Immutable after
                          creation.
                      name:
                        type: string
                      status:
                        type: string
                        enum:
                          - draft
                          - launching
                          - active
                          - paused
                          - completed
                        description: >-
                          Lifecycle state. `draft` is editable; `launching` is
                          transitional; `active` is sending; `paused` halts
                          sends until resumed; `completed` is terminal.
                      daily_limit:
                        type: integer
                        exclusiveMinimum: true
                        maximum: 9007199254740991
                        nullable: true
                        minimum: 0
                      stop_on_reply:
                        type: boolean
                        nullable: true
                      open_tracking:
                        type: boolean
                        nullable: true
                      signature:
                        type: string
                        nullable: true
                      skip_other_campaigns:
                        type: boolean
                        nullable: true
                      operating_hours:
                        type: object
                        additionalProperties: {}
                        nullable: true
                      stats:
                        type: object
                        properties:
                          total:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          sent:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          replied:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          bounced:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          completed:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          timed_out:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          connection_sent:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          connected:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          message_sent:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                        additionalProperties: false
                        description: >-
                          Counters updated atomically as leads progress. `total`
                          is set at launch; the rest increment.
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      sender_accounts:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: String value with endpoint-specific validation.
                            type:
                              type: string
                              enum:
                                - linkedin
                                - email
                                - multi_channel
                              description: >-
                                Channel mode for this campaign. Immutable after
                                creation.
                            email_address:
                              type: string
                              nullable: true
                            provider_account_id:
                              type: string
                              nullable: true
                            display_name:
                              type: string
                              nullable: true
                            first_name:
                              type: string
                              nullable: true
                            last_name:
                              type: string
                              nullable: true
                            status:
                              type: string
                            daily_limit:
                              type: integer
                              exclusiveMinimum: true
                              maximum: 9007199254740991
                              nullable: true
                              minimum: 0
                            is_default_sender:
                              type: boolean
                            weekly_connection_limit:
                              type: integer
                              exclusiveMinimum: true
                              maximum: 9007199254740991
                              nullable: true
                              minimum: 0
                            weekly_message_limit:
                              type: integer
                              exclusiveMinimum: true
                              maximum: 9007199254740991
                              nullable: true
                              minimum: 0
                            is_premium:
                              type: boolean
                              nullable: true
                          required:
                            - id
                            - type
                            - email_address
                            - provider_account_id
                            - display_name
                            - status
                          additionalProperties: false
                    required:
                      - id
                      - user_id
                      - type
                      - name
                      - status
                      - daily_limit
                      - stop_on_reply
                      - open_tracking
                      - signature
                      - skip_other_campaigns
                      - operating_hours
                      - stats
                      - created_at
                      - updated_at
                      - sender_accounts
                    additionalProperties: false
                    description: >-
                      The campaign row after the status transition. `status` is
                      now `paused`.
                required:
                  - campaign
                additionalProperties: false
        '400':
          description: >-
            Campaign is not in active status — only active campaigns can be
            paused.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: Missing or invalid Bearer token.
          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
        '500':
          description: >-
            Status CAS update failed. Waitpoint-token completion is best-effort
            and does not trigger a 500.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: pk_live_...

````