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

# Create Campaign

> Create a managed batch calling campaign with lifecycle controls.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. A public v1 replacement is not currently listed in the v1 reference. This endpoint remains available for existing integrations until then.
</Warning>

A campaign is a managed outreach effort where you have full lifecycle control. You can pause, resume, and cancel it at any time. Unlike a [batch call](/docs/api-reference/v1/batches/create) (which is one-shot), a campaign lets you add leads incrementally and control the pace of calling.

## Batch calls vs. campaigns

|                    | Batch Call              | Campaign                                 |
| ------------------ | ----------------------- | ---------------------------------------- |
| Leads added via    | File upload at creation | File upload or one-by-one after creation |
| Lifecycle controls | None                    | Pause, resume, cancel                    |
| Best for           | Fixed one-shot outreach | Ongoing or large-scale campaigns         |

## Workflow

1. Create the campaign with this endpoint.
2. Add leads via [Bulk Upload](/docs/api-reference/campaign-leads/upload) or [Add Lead](/docs/api-reference/campaign-leads/create).
3. Monitor delivery using campaign lead endpoints and call logs.
4. Update campaign details when needed.
5. Track each lead's progress through campaign lead endpoints and call logs.


## OpenAPI

````yaml POST /campaigns
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a new campaign
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: CampaignsController_create
      parameters:
        - name: x-organization-id
          in: header
          description: RSA encrypted organization ID (base64 format)
          required: true
          schema:
            type: string
            example: BASE64_ENCRYPTED_ORG_ID_HERE
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignDto'
      responses:
        '201':
          description: Campaign created successfully
        '400':
          description: Bad Request
        '402':
          description: Payment Required - Insufficient wallet credits
        '500':
          description: Internal Server Error
      deprecated: true
components:
  schemas:
    CreateCampaignDto:
      type: object
      properties:
        title:
          type: string
          description: Title of the campaign (max 150 characters)
          example: New Product Launch
          maxLength: 150
        agent_id:
          type: string
          description: Agent ID associated with the campaign
          example: 101
        agent_version_number:
          type: number
          description: Agent Version ID associated with the campaign
          example: 1
        starts_at:
          type: string
          description: Start timestamp of the campaign (ISO string)
          example: '2025-05-10T09:00:00Z'
        ends_at:
          type: string
          description: End timestamp of the campaign (ISO string)
          example: '2025-05-20T18:00:00Z'
        calling_hours_start:
          type: string
          description: >-
            Start of allowed calling hours (HH:mm format only, not full
            datetime)
          example: '09:00'
        calling_hours_end:
          type: string
          description: End of allowed calling hours (HH:mm format only, not full datetime)
          example: '18:00'
        total_lead_count:
          type: number
          description: Total Number of Leads for this Campaign
          example: '10'
        status:
          type: string
          description: Status of the campaign
          enum:
            - draft
            - waiting
            - running
            - paused
            - completed
            - cancelled
            - deleted
            - scheduled
          example: draft
        number_of_retries:
          type: number
          description: Number of retries for the campaign (0-5)
          example: 3
        interval_between_retries:
          type: number
          description: Interval between retries in minutes (0-1440)
          example: 15
      required:
        - title
        - agent_id
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````