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

# Create a campaign



## OpenAPI

````yaml post /v1/campaigns
openapi: 3.1.0
info:
  title: OpenMic v1 External API
  description: >-
    API specification for OpenMic v1 External API, providing endpoints for bot
    management, call handling, and phone number operations.
  version: 1.0.0
servers:
  - url: https://api.openmic.ai
    description: Production Environment
security:
  - api_key: []
tags:
  - name: Calls
    description: Endpoints related to phone call creation and management.
  - name: Bots
    description: Endpoints related to bot management and configuration.
  - name: Phone Numbers
    description: Endpoints related to phone number management and bot linking.
  - name: Knowledge Bases
  - name: FAQs
  - name: Campaigns
  - name: Tools
  - name: Contact Lists
  - name: Contacts
  - name: Voices
    description: >-
      Endpoints for browsing available text-to-speech voices. Voices are
      read-only and can be filtered by gender, provider, language, and accent.
  - name: SMS
    description: Endpoints for sending SMS messages.
paths:
  /v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a campaign
      operationId: createCampaignExt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '400':
          description: Validation error
        '404':
          description: Bot or contact list not found
components:
  schemas:
    CreateCampaignRequest:
      type: object
      required:
        - name
        - type
        - bot_uid
        - from_number
        - contact_list_id
        - time_start
        - time_end
      properties:
        name:
          type: string
          maxLength: 255
          description: Campaign name.
        type:
          type: string
          enum:
            - outbound
          description: >-
            Campaign type. Only **outbound** campaigns are supported (dials
            contacts from a contact list).
        bot_uid:
          type: string
          description: UID of the bot that handles calls for this campaign.
        from_number:
          type: string
          description: Phone number to dial from in E.164 format (e.g. "+12025551234").
        contact_list_id:
          type: integer
          description: ID of the contact list to dial.
        time_start:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
          description: >-
            Start time for the daily calling window in HH:MM format (e.g.
            "09:00").
        time_end:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
          description: >-
            End time for the daily calling window in HH:MM format (e.g.
            "17:00").
        timezone:
          type: string
          description: >-
            IANA timezone for the calling window (e.g. "America/New_York").
            Defaults to UTC if not specified.
        days:
          type: array
          items:
            type: string
            enum:
              - Monday
              - Tuesday
              - Wednesday
              - Thursday
              - Friday
              - Saturday
              - Sunday
          description: >-
            Days of week to run the campaign (e.g. ["Monday", "Wednesday",
            "Friday"]). If not provided, campaign runs as single-day. Valid
            values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,
            Sunday.
    CampaignResponse:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier.
        name:
          type: string
          description: Campaign name.
        type:
          type: string
          enum:
            - outbound
          description: Campaign type (always outbound).
        status:
          type: string
          enum:
            - Scheduled
            - Running
            - Stopped
            - Completed
            - Failed
            - Expired
            - Paused
          description: Current campaign status.
        bot_uid:
          type: string
          description: Bot UID for API reference.
        from_number:
          type: string
          description: Phone number used to dial from (E.164 format).
        contact_list_id:
          type: integer
          description: Associated contact list ID.
        time_start:
          type: string
          description: Daily calling window start time in HH:MM format.
        time_end:
          type: string
          description: Daily calling window end time in HH:MM format.
        timezone:
          type: string
          description: Calling window timezone (IANA format).
        days:
          type: array
          items:
            type: string
            enum:
              - Monday
              - Tuesday
              - Wednesday
              - Thursday
              - Friday
              - Saturday
              - Sunday
          description: Days of week the campaign runs on (for recurring campaigns).
        schedule_type:
          type: string
          enum:
            - single
            - multi
          description: >-
            Schedule type: single (one-time) or multi (recurring on specific
            days).
        current_index:
          type: integer
          description: Number of contacts already called.
        total_contacts:
          type: integer
          description: Total number of contacts in the campaign's contact list.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key authentication. Include your API key in the Authorization header
        as: `Authorization: Bearer <your-api-key>`

````