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

# Create Campaign

> Creates a new call campaign, including key campaign details such as Campaign Name, Selected AI Agent, Call Direction, Selected Phone Number, Number Rotation settings, Campaign Budget (in minutes), and Scheduling options.



## OpenAPI

````yaml POST /campaign/
openapi: 3.1.0
info:
  title: CloserX.ai API
  description: >-
    The CloserX.ai API provides programmatic access to manage AI-powered calling
    operations, including agent creation, campaign management, contact handling,
    telephony integration, and more. This API enables seamless automation and
    integration with CRM systems, telephony providers, and other third-party
    services for enhanced client communication and business operations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.closerx.ai/api
security:
  - api_key: []
paths:
  /campaign/:
    post:
      summary: Create a new call campaign
      description: >-
        Creates a new call campaign, including key campaign details such as
        Campaign Name, Selected AI Agent, Call Direction, Selected Phone Number,
        Number Rotation settings, Campaign Budget (in minutes), and Scheduling
        options.
      parameters:
        - name: Company-Name
          in: header
          description: The name of the schema to be used for the request
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
      responses:
        '200':
          description: Campaign created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCampaign'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateCampaignRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the campaign to be created
          example: Summer Sales 2025
        new_agent:
          type: integer
          description: ID of the agent assigned to the campaign
          example: 123
        direction:
          type: string
          description: Direction of the campaign, either 'Inbound' or 'Outbound'
          enum:
            - Inbound
            - Outbound
          example: Outbound
        calling_number:
          type: string
          description: Phone number used for calls
          example: '+18446020950'
        tags:
          type: array
          description: List of tag IDs to associate with the campaign
          items:
            type: integer
          example:
            - 1
            - 2
        enable_number_rotation:
          type: boolean
          description: Toggle to enable or disable number rotation for calls
          example: false
        number_dict:
          type: object
          description: Whether number rotation is enabled
          example: {}
        total_bugget:
          type: number
          format: float
          description: Total budget (in minutes) allocated for the campaign
          example: 60
        start_date:
          type: string
          format: date
          description: Start date of the campaign in YYYY-MM-DD format
          example: '2025-08-30'
        start_time:
          type: string
          format: time
          description: Start time of the campaign in HH:mm:ss format
          example: '10:00:00'
        end_date:
          type: string
          format: date
          description: End date of the campaign in YYYY-MM-DD format
          example: '2025-08-30'
        end_time:
          type: string
          format: time
          description: End time of the campaign in HH:mm:ss format
          example: '17:00:00'
      required:
        - name
        - new_agent
        - direction
        - calling_number
        - tags
        - enable_number_rotation
        - total_bugget
        - start_date
        - start_time
        - end_date
        - end_time
    CreateCampaign:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates whether the campaign was created successfully
          example: true
        message:
          type: string
          description: A message confirming the status of the campaign creation
          example: campaign created successfully
        data:
          type: object
          properties:
            campaign:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the campaign
                  example: Rell (test)
                new_agent:
                  type: integer
                  description: Unique ID of the agent selected for the campaign
                  example: 527
                direction:
                  type: string
                  description: The call direction (either 'Outbound' or 'Inbound')
                  example: Outbound
                contact_list:
                  type: object
                  description: The contact list associated with the campaign (if available)
                  example: null
                knowledge_base:
                  type: object
                  description: >-
                    The knowledge base associated with the campaign (if
                    available)
                  example: null
                calling_number:
                  type: string
                  description: The calling number assigned to the campaign
                  example: '+18446020950'
                start_date:
                  type: string
                  format: date
                  description: The start date of the campaign
                  example: '2025-08-24'
                start_time:
                  type: string
                  format: time
                  description: The start time of the campaign
                  example: '11:00:00'
                end_time:
                  type: string
                  format: time
                  description: The end time of the campaign
                  example: '12:30:00'
                saturday:
                  type: boolean
                  description: Indicates if the campaign is scheduled for Saturdays
                  example: false
                sunday:
                  type: boolean
                  description: Indicates if the campaign is scheduled for Sundays
                  example: false
                total_bugget:
                  type: number
                  description: Total budget of the campaign in minutes
                  example: 60
                bugget_left:
                  type: string
                  description: Remaining budget in minutes for the campaign
                  example: '60.0000'
                tags:
                  type: array
                  description: List of tags associated with the campaign
                  example:
                    - 1
    Error:
      required:
        - success
        - message
        - data
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api_key

````