> ## 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

> Creates a new outbound dialing campaign.

The campaign will begin dialing contacts within the `time_start`–`time_end` window on the specified `days`. If `timezone` is omitted the organization's default timezone is used.



## OpenAPI

````yaml post /v2/campaigns
openapi: 3.0.3
info:
  title: OpenMic External API v2
  version: '2.0'
  description: >-
    The OpenMic External API (v2) provides programmatic access to agents, calls,

    phone numbers, tools, contact lists, campaigns, and voices.


    ## Authentication

    All endpoints require an API key passed as a Bearer token in the

    `Authorization` header:

    ```

    Authorization: Bearer <your_api_key>

    ```


    ## Rate Limiting

    Most endpoints are limited to **100 requests per minute** per organization.

    The `POST /create-phone-call` endpoint has a stricter limit of **5 requests
    per minute**.
  contact:
    name: OpenMic Support
servers:
  - url: https://api.openmic.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Verify API key identity.
  - name: Agents
    description: Create and manage voice AI agents.
  - name: Calls
    description: Initiate and track phone calls.
  - name: Phone Numbers
    description: Manage phone numbers and agent assignments.
  - name: Tools
    description: Manage agent tools (API requests, call transfers, etc.).
  - name: Contact Lists
    description: Manage contact lists and individual contacts.
  - name: Campaigns
    description: Create and manage outbound dialing campaigns.
  - name: Voices
    description: Browse available voices for agents.
  - name: SMS
    description: Send SMS messages.
paths:
  /v2/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a campaign
      description: >-
        Creates a new outbound dialing campaign.


        The campaign will begin dialing contacts within the
        `time_start`–`time_end` window on the specified `days`. If `timezone` is
        omitted the organization's default timezone is used.
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
            example:
              name: Q1 Sales Blitz
              type: outbound
              agent_uid: agent_abc123
              from_number: '+12025551234'
              contact_list_id: 42
              time_start: '09:00'
              time_end: '17:00'
              timezone: America/New_York
              days:
                - Monday
                - Tuesday
                - Wednesday
                - Thursday
                - Friday
      responses:
        '201':
          description: Campaign created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateCampaignRequest:
      type: object
      required:
        - name
        - type
        - agent_uid
        - from_number
        - contact_list_id
        - time_start
        - time_end
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        type:
          type: string
          enum:
            - outbound
        agent_uid:
          type: string
        from_number:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          description: E.164 format.
        contact_list_id:
          type: integer
        time_start:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
          description: HH:MM format.
          example: '09:00'
        time_end:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
          description: HH:MM format.
          example: '17:00'
        timezone:
          type: string
          example: America/New_York
        days:
          type: array
          items:
            $ref: '#/components/schemas/CampaignDay'
    CampaignResponse:
      type: object
      required:
        - id
        - name
        - type
        - status
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          type: string
          enum:
            - outbound
        status:
          $ref: '#/components/schemas/CampaignStatus'
        agent_uid:
          type: string
        from_number:
          type: string
        contact_list_id:
          type: integer
        time_start:
          type: string
          description: HH:MM (24-hour) daily window start.
          example: '09:00'
        time_end:
          type: string
          description: HH:MM (24-hour) daily window end.
          example: '17:00'
        timezone:
          type: string
          example: America/New_York
        days:
          type: array
          items:
            $ref: '#/components/schemas/CampaignDay'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    CampaignDay:
      type: string
      enum:
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
        - Saturday
        - Sunday
    CampaignStatus:
      type: string
      enum:
        - Running
        - Scheduled
        - Stopped
        - Completed
        - Failed
        - Expired
        - Paused
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        details:
          type: string
  responses:
    BadRequest:
      description: Validation error or invalid request body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              message:
                type: string
              error:
                type: string
              retryAfter:
                type: integer
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the OpenMic dashboard.

````