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

# Update a campaign

> Changes a campaign's settings, or starts and pauses it. Send only the fields you want to change.

Anything you leave out stays as it is. In the playground, only fill the fields you mean to change. The fields follow the same rules as [Create a campaign](https://docs.olimi.ai/api-reference/endpoint/campaigns/create-campaign.md).

* **Start or pause:** send `"isActive": true` to start dialing, or `"isActive": false` to pause. Starting is refused with `no_available_credits` if your company doesn't have enough credits.
* **Customer lists:** `customerListIds` **replaces** the campaign's lists. To add one, send the current IDs plus the new one. Adding a list to a running campaign starts calling its contacts.


## OpenAPI

````yaml patch /api/v2/campaigns/{id}
openapi: 3.0.1
info:
  title: Customer Management API
  description: API for managing customer lists and customers within those lists
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-eg.olimi.ai
security:
  - bearerAuth: []
paths:
  /api/v2/campaigns/{id}:
    patch:
      tags:
        - Campaigns
      summary: Update a campaign
      description: >-
        Changes a campaign's settings, or starts and pauses it. Send only the
        fields you want to change.
      parameters:
        - name: id
          in: path
          required: true
          description: The campaign's `id`.
          schema:
            type: string
            format: uuid
          example: 3e8b5d21-7c4a-4f96-a1d0-6b2e9c7f4a58
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignUpdate'
      responses:
        '200':
          description: The updated campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignUpdateResponse'
        '400':
          description: See [Errors](/api-reference/endpoint/campaigns/campaigns#errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: The `X-API-KEY` header is missing or the key isn't valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            `campaign_not_found`: no campaign with that `id` belongs to your
            company, or it was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: The request didn't pass validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      security:
        - apiKeyAuth: []
components:
  schemas:
    CampaignUpdate:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Surrounding spaces are trimmed.
          example: September renewals
        workingDays:
          type: array
          items:
            type: string
            enum:
              - monday
              - tuesday
              - wednesday
              - thursday
              - friday
              - saturday
              - sunday
          minItems: 1
          description: Days the campaign may call.
          example:
            - sunday
            - monday
            - tuesday
            - wednesday
            - thursday
        agentId:
          type: string
          format: uuid
          description: >-
            The outbound agent that makes the calls. Needed before the campaign
            can dial.
          example: 0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10
        customerListIds:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            **Replaces** the campaign's lists. To add one, send the current IDs
            plus the new one.
          example:
            - 9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24
        isActive:
          type: boolean
          description: >-
            `true` starts dialing, `false` pauses. Starting is refused if your
            company doesn't have enough credits.
          example: false
        workingStartTime:
          type: string
          description: Time of day calls may start, as `HH:mm` (24-hour).
          example: '09:00'
        workingEndTime:
          type: string
          description: >-
            Time of day calls must stop, as `HH:mm`. If it's earlier than
            `workingStartTime`, the window runs past midnight.
          example: '17:00'
        continueOvernight:
          type: boolean
          description: >-
            Which day the hours after midnight belong to. See [Overnight
            windows](/api-reference/endpoint/campaigns/campaigns#overnight-windows).
          example: false
        maxLines:
          type: integer
          minimum: 1
          maximum: 100
          description: >-
            How many contacts the campaign dials in each batch. No more than
            your company's line limit.
          example: 5
        maxRetries:
          type: integer
          minimum: 0
          maximum: 10
          description: How many more times to call a contact who didn't answer.
          example: 2
        retryDuration:
          type: integer
          minimum: 0
          maximum: 12000
          description: >-
            Seconds to wait before retrying a contact. If you leave it out, the
            wait isn't guaranteed, so set it explicitly.
          example: 3600
        description:
          type: string
          description: Free text for your own reference.
    CampaignUpdateResponse:
      type: object
      properties:
        message:
          type: string
          example: Campaign updated successfully
        data:
          $ref: '#/components/schemas/Campaign'
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        errorCode:
          type: string
          description: Machine-readable error code.
          example: agent_not_found
        message:
          type: string
          description: Human-readable text. May change; don't match on it.
          example: Agent not found
    ValidationError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 422
        message:
          type: array
          items:
            type: string
          description: What went wrong. Human-readable.
          example:
            - name must be shorter than or equal to 100 characters
        error:
          type: string
          example: Unprocessable Entity
    Campaign:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The campaign's ID.
          example: 3e8b5d21-7c4a-4f96-a1d0-6b2e9c7f4a58
        name:
          type: string
          description: The campaign's name.
          example: September renewals
        description:
          type: string
          nullable: true
          description: Your free-text note.
          example: null
        callType:
          type: string
          description: Always `outbound` for campaigns you create.
          example: outbound
        isActive:
          type: boolean
          description: Whether the campaign is switched on. `false` means paused.
          example: true
        workingDays:
          type: array
          items:
            type: string
            enum:
              - monday
              - tuesday
              - wednesday
              - thursday
              - friday
              - saturday
              - sunday
          description: Days the campaign may call.
          example:
            - sunday
            - monday
            - tuesday
            - wednesday
            - thursday
        workingStartTime:
          type: string
          nullable: true
          description: Start of the calling window, as `HH:mm:ss`.
          example: '09:00:00'
        workingEndTime:
          type: string
          nullable: true
          description: End of the calling window, as `HH:mm:ss`.
          example: '17:00:00'
        continueOvernight:
          type: boolean
          description: >-
            See [Overnight
            windows](/api-reference/endpoint/campaigns/campaigns#overnight-windows).
          example: false
        maxLines:
          type: integer
          description: Contacts dialed in each batch.
          example: 5
        maxRetries:
          type: integer
          description: Extra attempts for contacts who didn't answer.
          example: 2
        retryDuration:
          type: integer
          nullable: true
          description: Seconds between attempts.
          example: 3600
        agent:
          allOf:
            - $ref: '#/components/schemas/NamedRef'
          nullable: true
          description: The agent's `id` and `name`.
          example:
            id: 0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10
            name: Renewals Agent
        customerLists:
          type: array
          description: Each list's `id` and `name`.
          items:
            $ref: '#/components/schemas/NamedRef'
          example:
            - id: 9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24
              name: September renewals
        createdAt:
          type: string
          format: date-time
          description: When the campaign was created (UTC).
          example: '2026-09-28T10:15:02.418Z'
        updatedAt:
          type: string
          format: date-time
          description: When the campaign was last changed (UTC).
          example: '2026-09-28T10:15:02.418Z'
    NamedRef:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.