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

# Update a campaign



## OpenAPI

````yaml patch /v1/campaigns/{campaign_id}
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/{campaign_id}:
    patch:
      tags:
        - Campaigns
      summary: Update a campaign
      operationId: updateCampaignExt
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignRequest'
      responses:
        '200':
          description: Updated campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '404':
          description: Campaign not found
components:
  schemas:
    UpdateCampaignRequest:
      type: object
      description: All fields are optional. Only provided fields will be updated.
      properties:
        name:
          type: string
          maxLength: 255
          description: Campaign name.
        from_number:
          type: string
          description: Phone number to dial from in E.164 format.
        time_start:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
          description: Start time for the 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 calling window in HH:MM format (e.g. "17:00").
        timezone:
          type: string
          description: IANA timezone for the calling window.
        contact_list_id:
          type: integer
          description: ID of the contact list to dial.
        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"]). **Note:** When setting days, time_start and time_end
            must also be provided (either in the same request or already set on
            the campaign).
    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>`

````