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

# Update a campaign

> Changes a campaign's settings. Send only the fields to change; at least one is required. Only `draft` and `scheduled` campaigns can be edited: cancel a running campaign to stop it.
Setting `start_time` schedules the campaign; setting it to `null` returns it to `draft`. Changing `callback` also applies the new value to every contact already on the campaign.



## OpenAPI

````yaml /api-reference/voice-openapi.json put /v1/projects/{projectId}/campaigns/{id}
openapi: 3.0.3
info:
  title: Clarity Voice API
  version: '1.0'
  description: Voice agents, outbound calls, conversations, campaigns, and evals.
servers:
  - url: https://voice-api.onclarity.com
security:
  - organizationApiKey: []
tags:
  - name: Projects
    description: >-
      The projects your organization owns. Every other resource lives in a
      project.
  - name: Agents
    description: Create, configure, version and publish voice agents.
  - name: Outbound calls
    description: Have a published agent phone a number now.
  - name: Conversations
    description: >-
      One record per call session, with its calls, recordings, transcripts and
      artifacts.
  - name: Calls
    description: The calls of a project, with their status, direction, timing and outcome.
  - name: Campaigns
    description: Outbound calling campaigns that phone a list of numbers on a schedule.
  - name: Eval suites
    description: >-
      Reusable sets of eval scenarios and test cases to measure an agent
      against.
  - name: Eval judges
    description: The LLM judges that score eval calls against your test cases.
  - name: Eval scenarios
    description: The simulated-caller scenarios of your eval suites.
  - name: Eval test cases
    description: The checks a judge applies to each eval call.
  - name: Eval submissions
    description: Run an eval suite against an agent and read the verdicts.
paths:
  /v1/projects/{projectId}/campaigns/{id}:
    parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      - $ref: '#/components/parameters/CampaignId'
    put:
      tags:
        - Campaigns
      summary: Update a campaign
      description: >-
        Changes a campaign's settings. Send only the fields to change; at least
        one is required. Only `draft` and `scheduled` campaigns can be edited:
        cancel a running campaign to stop it.

        Setting `start_time` schedules the campaign; setting it to `null`
        returns it to `draft`. Changing `callback` also applies the new value to
        every contact already on the campaign.
      operationId: updateCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignRequest'
            example:
              max_concurrency: 10
              calling_window:
                start: '10:00'
                end: '17:00'
                timezone: Europe/London
      responses:
        '200':
          description: The updated campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
              example:
                campaign:
                  id: 3f1c2a8e-6b0d-4f6e-9a51-0d2b7c9e4a10
                  project_id: 8d2e4b1a-1c3f-4e5a-9b7d-6f0a2c4e8b13
                  name: March renewals
                  agent_id: 5b7e9c1d-2a4f-4c6e-8d0b-1f3a5c7e9b24
                  from_number: '+14155550100'
                  start_time: null
                  callback: false
                  retries: 2
                  retry_delay_seconds: 3600
                  max_concurrency: 10
                  calling_window:
                    start: '10:00'
                    end: '17:00'
                    timezone: Europe/London
                  status: draft
                  started_at: null
                  canceled_at: null
                  ended_at: null
                  created_at: '2026-02-27T15:12:40.000Z'
                  updated_at: '2026-02-28T10:01:12.000Z'
        '400':
          description: >-
            The request body is not valid JSON, or the agent uses an
            architecture that is no longer supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The credential has no access to this project, or it may only manage
            draft campaigns (`code: PUBLISH_CAPABILITY_REQUIRED`) and the
            campaign is scheduled or the body sets a `start_time`. Organization
            API keys can change scheduled campaigns.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such campaign in this project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The campaign is running, canceled or ended and can no longer be
            edited, or (`AGENT_NOT_PUBLISHED`) the agent set on it has never
            been published.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AgentNotPublishedError'
                  - $ref: '#/components/schemas/Error'
              example:
                error: Cannot edit a running campaign
        '422':
          description: >-
            The body failed validation (see `issues`), the agent id is not an
            agent of this project, or the agent cannot place calls (`code:
            AGENT_TYPE_NOT_DISPATCHABLE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
components:
  parameters:
    ProjectIdPath:
      name: projectId
      in: path
      required: true
      schema:
        type: string
      description: Project id
    CampaignId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Campaign id
  schemas:
    UpdateCampaignRequest:
      type: object
      minProperties: 1
      description: Send only the fields to change.
      properties:
        name:
          type: string
          minLength: 1
        agent_id:
          type: string
          minLength: 1
          nullable: true
        from_number:
          type: string
          minLength: 1
          nullable: true
        start_time:
          type: string
          format: date-time
          nullable: true
          description: Set to schedule the campaign; `null` returns it to draft.
        callback:
          type: boolean
          description: Changing it applies the new value to every existing contact.
        retries:
          type: integer
          minimum: 0
        retry_delay_seconds:
          type: integer
          minimum: 0
        max_concurrency:
          type: integer
          minimum: 5
          maximum: 20
        calling_window:
          allOf:
            - $ref: '#/components/schemas/CampaignCallingWindow'
          nullable: true
    CampaignResponse:
      type: object
      required:
        - campaign
      properties:
        campaign:
          $ref: '#/components/schemas/Campaign'
    Error:
      type: object
      required:
        - error
      additionalProperties: true
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: >-
            A stable machine-readable reason, present on the refusals a client
            may branch on. Among them: `PUBLISH_CAPABILITY_REQUIRED` (403, the
            credential may not change what is live), `AGENT_NOT_PUBLISHED` (409,
            the agent has no published version yet),
            `AGENT_TYPE_NOT_DISPATCHABLE` (422, a Voice Assist agent named where
            an agent must place or take a call; the body carries `agent_type`
            and `agent_id`), `NOT_APPLICABLE_TO_AGENT_TYPE` (422, a voice-only
            setting written on a Voice Assist agent), `AGENT_TYPE_BOUNDARY`
            (409), `AGENT_TYPE_NOT_SUPPORTED` (400), `VOICE_ASSISTANT_REQUIRED`
            (403, the organization is not licensed for Voice Assist),
            `ORGANIZATION_UNAVAILABLE` (503) and `REGION_PROFILE_CONFLICT`
            (503).
    AgentNotPublishedError:
      type: object
      description: >-
        Refusal: the agent named where an agent is assigned to take or place
        calls (dispatch rules, campaigns and their items, outbound caller id,
        dispatch-call) was never published, so no call could run it. Refused
        before any side effect; an assignment saved earlier stays. Match on
        `code`.
      required:
        - error
        - code
        - agent_id
      properties:
        error:
          type: string
          example: >-
            Agent "Billing bot" is not published yet — publish it before it can
            take calls
        code:
          type: string
          enum:
            - AGENT_NOT_PUBLISHED
        agent_id:
          type: string
    ValidationError:
      type: object
      description: >-
        A validation failure. `error` is a human-readable summary; `issues`
        (request validation) or `details` (agent configuration validation)
        locate each problem.
      properties:
        error:
          type: string
        message:
          type: string
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: Dotted path of the offending field
              code:
                type: string
              message:
                type: string
        details:
          type: array
          items: {}
    CampaignCallingWindow:
      type: object
      description: >-
        A recurring window in which the campaign may dial. Outside it, contacts
        wait for the next window. When `end` is not after `start` the window
        runs past midnight (for example 22:00 to 02:00).
      required:
        - start
        - end
        - timezone
      properties:
        start:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          description: Start of the window, 24-hour `HH:MM`, in `timezone`.
          example: '09:00'
        end:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          description: End of the window (exclusive), 24-hour `HH:MM`, in `timezone`.
          example: '18:00'
        days:
          type: array
          maxItems: 7
          description: >-
            ISO weekdays on which the window applies (1 = Monday … 7 = Sunday).
            Omitted or empty means every day.
          items:
            type: integer
            minimum: 1
            maximum: 7
          example:
            - 1
            - 2
            - 3
            - 4
            - 5
        timezone:
          type: string
          minLength: 1
          description: IANA time zone the window is expressed in.
          example: America/New_York
    Campaign:
      type: object
      description: An outbound calling campaign.
      required:
        - id
        - project_id
        - name
        - callback
        - retries
        - retry_delay_seconds
        - max_concurrency
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
        project_id:
          type: string
        name:
          type: string
        agent_id:
          type: string
          nullable: true
          description: Agent that places the calls, unless a contact names its own.
        from_number:
          type: string
          nullable: true
          description: Caller id the calls are placed from.
        start_time:
          type: string
          nullable: true
          description: When the campaign starts (or started) dialing. `null` for a draft.
        callback:
          type: boolean
          description: >-
            Default `callback` for new contacts (whether a callback is placed
            when the person asks to be called back).
        retries:
          type: integer
          description: How many more times an unanswered or failed contact is retried.
        retry_delay_seconds:
          type: integer
          description: Wait between attempts, in seconds.
        max_concurrency:
          type: integer
          description: Maximum simultaneous calls (5–20).
        calling_window:
          type: object
          nullable: true
          description: >-
            When the campaign may dial (same shape as `CampaignCallingWindow`).
            `null` means any time.
          properties:
            start:
              type: string
              description: 24-hour HH:MM
            end:
              type: string
              description: 24-hour HH:MM
            days:
              type: array
              items:
                type: integer
            timezone:
              type: string
        status:
          type: string
          enum:
            - draft
            - scheduled
            - running
            - canceled
            - ended
          description: >-
            `draft` (no start time), `scheduled` (will start at `start_time`),
            `running`, `canceled`, or `ended` (every contact finished).
        started_at:
          type: string
          nullable: true
        canceled_at:
          type: string
          nullable: true
        ended_at:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
        item_counts:
          type: object
          description: >-
            Number of contacts per contact status. Present in the list response
            only.
          additionalProperties:
            type: integer
  responses:
    Unauthorized:
      description: No credential was sent, or the API key is invalid or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid or revoked token
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: >-
        Your organization API key (it starts with `anek_org_`). The same key
        works on the Voice API and the Support API. See
        [Authentication](/authentication).

````

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