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

# Create a Campaign

> Create a new campaign

<Info>Campaigns are specifically designed to faciliate outbound marketing efforts. They take care of automatically following-up with prospects, and can be used to send emails, text messages, and voicemails. Campaigns also ensure prospects are dialed only during business hours, based on their phone number's area code.</Info>


## OpenAPI

````yaml POST /campaigns
openapi: 3.0.1
info:
  title: AI Phone Call Service API
  description: >-
    API for managing AI-based phone calls, including call initiation and result
    retrieval.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://my.cald.ai/client/api/v1
security:
  - apiKeyAuth: []
paths:
  /campaigns:
    post:
      description: Create a new campaign
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: >-
                    The name of the campaign, it must be unique across all
                    campaigns
                listId:
                  type: string
                  description: The list ID of the list to use for the campaign
                agentId:
                  type: string
                  description: The agent ID of the agent to use for the campaign
                schedule:
                  type: object
                  description: >-
                    The schedule enables you to choose the times when your
                    prospects will be called. Cald takes care of automatically
                    determining the time zone based of their phone numbers' area
                    codes, so express the times in your own time zone. The
                    default schedule is to call between 9am and 5pm. Our end
                    time is limited to 8 pm, to avoid calling too late in the
                    evening, and to comply with telephone regulations.
                  properties:
                    startHour:
                      type: number
                      description: >-
                        The hour of the day to start the campaign, between 9 and
                        19
                      default: 9
                    startMinute:
                      type: number
                      description: >-
                        The minute of the hour to start the campaign, between 0
                        and 59
                      default: 0
                    endHour:
                      type: number
                      description: >-
                        The hour of the day to end the campaign, between 9 and
                        19
                      default: 17
                    endMinute:
                      type: number
                      description: >-
                        The minute of the hour to end the campaign, between 0
                        and 59
                      default: 0
              required:
                - name
                - listId
                - agentId
      responses:
        '200':
          description: Success response with campaign details
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      Whether the campaign was successfully created, can be
                      either `success` or `failed`
                  campaignId:
                    type: string
                    description: >-
                      Unique identifier for the campaign (only returned if the
                      campaign was successfully created)
        '404':
          description: List or agent not found
        '409':
          description: Campaign with the same name already exists
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Your API key, e.g. `caldLiveDe39a3accb206dd615f30d118e519df0`

````