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

# Resume Campaign

> Restart a paused campaign. Completes pause tokens so Trigger.dev tasks continue their sequences.

**CLI:**

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

## Overview

Flips a `paused` campaign back to `active` and clears the stored `pause_reason` so the UI banner disappears. Only `paused` campaigns can be resumed — every other status returns 400. The request body is empty.

The server then completes all pause waitpoint tokens with `{ resumed: true }` so sleeping tasks wake and continue. Finally, it runs the `check_and_complete_campaign` RPC — if every remaining lead already reached a terminal state while the campaign was paused, the campaign is auto-transitioned to `completed` and the response reflects that terminal state instead of `active`.

## AI agent notes

<Note>
  **Edge case: auto-complete.** The response is not guaranteed to come back `status: "active"`. If the campaign had no work left to do, it will land in `completed`. Always read `campaign.status` from the response before telling the user the campaign is running again.

  **Idempotency.** Not idempotent — calling again while already `active` returns 400 (`Only paused campaigns can be resumed`). Treat that as a safe success.

  **Token completion is best-effort.** If a waitpoint token was already completed or expired, the failure is logged and ignored — it does NOT surface as a 500. The downstream task will hit the pause check at the top of its loop and self-correct.

  **Follow-up.** Poll `GET /api/campaigns/{id}` to observe `stats.sent` climbing again. If `status === "completed"` instead, stop polling.
</Note>


## OpenAPI

````yaml post /api/campaigns/{id}/resume
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}/resume:
    post:
      tags:
        - Campaigns
      summary: Resume Campaign
      description: >-
        Flip a paused campaign back to active, clear pause metadata, and
        complete pause waitpoint tokens so Trigger.dev tasks continue their
        sequences.
      operationId: resumeCampaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Campaign UUID
      responses:
        '200':
          description: >-
            Campaign resumed. Returns the updated campaign row — usually active,
            occasionally completed if nothing was left to do.
          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 `active` or `completed` if the completion RPC finishes
                      the campaign immediately.
                required:
                  - campaign
                additionalProperties: false
        '400':
          description: >-
            Campaign is not in paused status — only paused campaigns can be
            resumed.
          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 and the
            completion RPC are best-effort and do 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_...

````