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

# Create Campaign

> Create a new campaign



## OpenAPI

````yaml openapi-campaigns POST /campaigns
openapi: 3.0.1
info:
  title: Puretalk AI
  description: Api Documentation for Puretalk AI
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.puretalk.ai/api
security:
  - ApiKeyAuth: []
paths:
  /campaigns:
    post:
      description: Create a new campaign
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the campaign
                  example: My Campaign
                start_date:
                  type: string
                  description: Start date of the campaign
                  example: '2021-01-01'
                end_date:
                  type: string
                  description: End date of the campaign
                  example: '2021-01-01'
                ai_assistant_id:
                  type: string
                  description: ID of the AI assistant to use for the campaign
                  example: 123e4567-e89b-12d3-a456-426614174000
                type:
                  type: string
                  description: Type of the campaign
                  example: call
                leads:
                  type: array
                  items:
                    type: object
                    properties:
                      to_number:
                        type: string
                        description: Phone number to call
                        example: '+1234567890'
                      variables:
                        type: array
                        items:
                          type: object
                          properties:
                            var_name:
                              type: string
                              description: Name of the variable
                              example: name
                            var_value:
                              type: string
                              description: Value of the variable
                              example: John Doe
              required:
                - name
                - start_date
                - end_date
                - ai_assistant_id
                - type
                - leads
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    description: Message from the API
                    example: Campaign created successfully
                  err:
                    type: boolean
                    description: Indicates if the response is an error
                    example: false
                  results:
                    type: object
                    properties:
                      campaign_id:
                        type: string
                        format: uuid
                        description: ID of the created campaign
                        example: 123e4567-e89b-12d3-a456-426614174000
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        err:
          type: boolean
          description: Indicates if the response is an error
          example: false
        msg:
          type: string
          description: Message from the API
          example: Error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Authorization header containing API key. You can find your API key in
        the dashboard under 'API Keys'.

````