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

# Create campaign

> Create an outbound calling campaign.



## OpenAPI

````yaml api-reference/campaigns/openapi.json POST /v1/calls/campaigns
openapi: 3.0.3
info:
  title: Persistence Campaigns API
  version: '1.0'
  description: Create and run outbound calling campaigns.
servers:
  - url: https://api.persistence.dev
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Campaigns
    description: Campaign creation and lifecycle control.
paths:
  /v1/calls/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create campaign
      description: >-
        Create a campaign. The campaign identifies the agent that places the
        calls, the number it calls from, and the contact lists it calls.
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreateRequest'
        description: Campaign creation request
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CampaignCreateRequest:
      type: object
      required:
        - agentId
        - contactListIds
        - maxConcurrency
        - name
      oneOf:
        - required:
            - fromNumber
          not:
            required:
              - numberPoolId
        - required:
            - numberPoolId
          not:
            required:
              - fromNumber
      properties:
        agentId:
          type: string
        contactListIds:
          type: array
          minItems: 1
          items:
            type: string
        dndListIds:
          type: array
          items:
            type: string
        fromNumber:
          type: string
          description: >-
            Caller phone number in E.164 format. Mutually exclusive with
            numberPoolId.
        numberPoolId:
          type: string
          description: >-
            Number pool used for caller ID rotation. Mutually exclusive with
            fromNumber.
        maxConcurrency:
          type: integer
          minimum: 1
        name:
          type: string
        retryPolicy:
          type: object
          additionalProperties: true
        scheduleEnd:
          type: string
          pattern: ^(?:[01][0-9]|2[0-3]):[0-5][0-9]$
        scheduleStart:
          type: string
          pattern: ^(?:[01][0-9]|2[0-3]):[0-5][0-9]$
        scheduledAt:
          type: string
          format: date-time
        sendNow:
          type: boolean
        timezone:
          type: string
    CampaignResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Campaign'
        success:
          type: boolean
    Error:
      type: object
      properties:
        code:
          type: string
        error:
          type: string
    Campaign:
      type: object
      properties:
        agentId:
          type: string
        cancelledAt:
          type: string
        createdAt:
          type: string
        description:
          type: string
        direction:
          type: string
        endDate:
          type: string
        fromNumber:
          type: string
        id:
          description: PublicID
          type: string
        lists:
          type: array
          items:
            $ref: '#/components/schemas/CampaignContactListRef'
        maxConcurrency:
          type: integer
        meta:
          $ref: '#/components/schemas/CampaignMetadata'
        name:
          type: string
        pausedAt:
          type: string
        resumedAt:
          type: string
        retryPolicy:
          type: array
          items:
            type: integer
        scheduleEnd:
          type: integer
        scheduleStart:
          type: integer
        scheduledAt:
          type: string
        startDate:
          type: string
        status:
          type: string
        stoppedAt:
          type: string
        targetCallCount:
          type: integer
        targetConversionRate:
          type: number
        timezone:
          type: string
        totalContacts:
          type: integer
        updatedAt:
          type: string
    CampaignContactListRef:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
    CampaignMetadata:
      type: object
      properties:
        failure:
          $ref: '#/components/schemas/CampaignFailureMetadata'
    CampaignFailureMetadata:
      type: object
      properties:
        reason:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key issued for your workspace.

````