# Update Campaign

> PATCH /api/v1/campaign/{campaign_id} — request parameters and responses from the Menace Voice API schema.

`PATCH /api/v1/campaign/{campaign_id}`

{/* Generated by scripts/sync_docs_api.mjs. Edit the API schema source to change the contract. */}

See [authentication](/api-reference/authentication) for workspace API access. Public embed and artifact endpoints use their documented session or access tokens.

## API contract for documentation tools

Generated from the OpenAPI schema. Do not infer a different parameter type from an example. Authentication headers are alternatives as explained in the authentication guide.

### Parameters

| Name | Location | Type | Required | Description and constraints |
| --- | --- | --- | --- | --- |
| campaign_id | path | integer | yes |  |
| authorization | header | string or null | no |  |
| X-API-Key | header | string or null | no |  |

### Request body: application/json

Required body. Schema: UpdateCampaignRequest (object).

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| name | string or null | no |  |
| retry_config | RetryConfigRequest (object) or null | no |  |
| max_concurrency | integer or null | no |  |
| schedule_config | ScheduleConfigRequest (object) or null | no |  |
| circuit_breaker | CircuitBreakerConfigRequest (object) or null | no |  |

### Response 200

Successful Response

application/json: CampaignResponse (object).

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| id | integer | yes |  |
| name | string | yes |  |
| workflow_id | integer | yes |  |
| workflow_name | string | yes |  |
| state | string | yes |  |
| source_type | string | yes |  |
| source_id | string | yes |  |
| total_rows | integer or null | yes |  |
| processed_rows | integer | yes |  |
| failed_rows | integer | yes |  |
| created_at | string | yes | format: "date-time" |
| started_at | string or null | yes |  |
| completed_at | string or null | yes |  |
| retry_config | RetryConfigResponse (object) | yes |  |
| max_concurrency | integer or null | no |  |
| schedule_config | ScheduleConfigResponse (object) or null | no |  |
| circuit_breaker | CircuitBreakerConfigResponse (object) or null | no |  |
| executed_count | integer | no | default: 0 |
| total_queued_count | integer | no | default: 0 |
| parent_campaign_id | integer or null | no |  |
| redialed_campaign_id | integer or null | no |  |
| telephony_configuration_id | integer or null | no |  |
| telephony_configuration_name | string or null | no |  |
| logs | array of CampaignLogEntryResponse (object) | no |  |

### Response 404

Not found

### Response 422

Validation Error

application/json: HTTPValidationError (object).

| Field | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| detail | array of ValidationError (object) | no |  |

## OpenAPI

````yaml api-reference/openapi.json patch /api/v1/campaign/{campaign_id}
openapi: 3.1.0
info:
  title: Menace Voice API
  description: API for Menace Voice agents
  version: 1.0.0
servers:
  - url: https://voice.menaceui.com
    description: Production
  - url: http://localhost:8000
    description: Local development
paths:
  /api/v1/campaign/{campaign_id}:
    patch:
      tags:
        - main
      summary: Update Campaign
      description: Update campaign settings (name, retry config, max concurrency, schedule)
      operationId: update_campaign_api_v1_campaign__campaign_id__patch
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
            title: Campaign Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: "null"
            title: Authorization
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: "null"
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateCampaignRequest"
      responses:
        "200":
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CampaignResponse"
        "404":
          description: Not found
        "422":
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPValidationError"
components:
  schemas:
    CampaignLogEntryResponse:
      properties:
        ts:
          type: string
          title: Ts
        level:
          type: string
          title: Level
        event:
          type: string
          title: Event
        message:
          type: string
          title: Message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: "null"
          title: Details
      type: object
      required:
        - ts
        - level
        - event
        - message
      title: CampaignLogEntryResponse
      description: |-
        A single timestamped entry from the campaign's append-only log.

        Surfaced in the UI so operators can see why a campaign moved to
        paused / failed without digging through server logs.
    CampaignResponse:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        workflow_id:
          type: integer
          title: Workflow Id
        workflow_name:
          type: string
          title: Workflow Name
        state:
          type: string
          title: State
        source_type:
          type: string
          title: Source Type
        source_id:
          type: string
          title: Source Id
        total_rows:
          anyOf:
            - type: integer
            - type: "null"
          title: Total Rows
        processed_rows:
          type: integer
          title: Processed Rows
        failed_rows:
          type: integer
          title: Failed Rows
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: "null"
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: "null"
          title: Completed At
        retry_config:
          $ref: "#/components/schemas/RetryConfigResponse"
        max_concurrency:
          anyOf:
            - type: integer
            - type: "null"
          title: Max Concurrency
        schedule_config:
          anyOf:
            - $ref: "#/components/schemas/ScheduleConfigResponse"
            - type: "null"
        circuit_breaker:
          anyOf:
            - $ref: "#/components/schemas/CircuitBreakerConfigResponse"
            - type: "null"
        executed_count:
          type: integer
          title: Executed Count
          default: 0
        total_queued_count:
          type: integer
          title: Total Queued Count
          default: 0
        parent_campaign_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Parent Campaign Id
        redialed_campaign_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Redialed Campaign Id
        telephony_configuration_id:
          anyOf:
            - type: integer
            - type: "null"
          title: Telephony Configuration Id
        telephony_configuration_name:
          anyOf:
            - type: string
            - type: "null"
          title: Telephony Configuration Name
        logs:
          items:
            $ref: "#/components/schemas/CampaignLogEntryResponse"
          type: array
          title: Logs
      type: object
      required:
        - id
        - name
        - workflow_id
        - workflow_name
        - state
        - source_type
        - source_id
        - total_rows
        - processed_rows
        - failed_rows
        - created_at
        - started_at
        - completed_at
        - retry_config
      title: CampaignResponse
    CircuitBreakerConfigRequest:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: true
        failure_threshold:
          type: number
          maximum: 1
          minimum: 0
          title: Failure Threshold
          default: 0.5
        window_seconds:
          type: integer
          maximum: 600
          minimum: 30
          title: Window Seconds
          default: 120
        min_calls_in_window:
          type: integer
          maximum: 100
          minimum: 1
          title: Min Calls In Window
          default: 5
      type: object
      title: CircuitBreakerConfigRequest
    CircuitBreakerConfigResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: false
        failure_threshold:
          type: number
          title: Failure Threshold
          default: 0.5
        window_seconds:
          type: integer
          title: Window Seconds
          default: 120
        min_calls_in_window:
          type: integer
          title: Min Calls In Window
          default: 5
      type: object
      title: CircuitBreakerConfigResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: "#/components/schemas/ValidationError"
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RetryConfigRequest:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: true
        max_retries:
          type: integer
          maximum: 10
          minimum: 0
          title: Max Retries
          default: 2
        retry_delay_seconds:
          type: integer
          maximum: 3600
          minimum: 30
          title: Retry Delay Seconds
          default: 120
        retry_on_busy:
          type: boolean
          title: Retry On Busy
          default: true
        retry_on_no_answer:
          type: boolean
          title: Retry On No Answer
          default: true
        retry_on_voicemail:
          type: boolean
          title: Retry On Voicemail
          default: true
      type: object
      title: RetryConfigRequest
    RetryConfigResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
        max_retries:
          type: integer
          title: Max Retries
        retry_delay_seconds:
          type: integer
          title: Retry Delay Seconds
        retry_on_busy:
          type: boolean
          title: Retry On Busy
        retry_on_no_answer:
          type: boolean
          title: Retry On No Answer
        retry_on_voicemail:
          type: boolean
          title: Retry On Voicemail
      type: object
      required:
        - enabled
        - max_retries
        - retry_delay_seconds
        - retry_on_busy
        - retry_on_no_answer
        - retry_on_voicemail
      title: RetryConfigResponse
    ScheduleConfigRequest:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: true
        timezone:
          type: string
          title: Timezone
          default: UTC
        slots:
          items:
            $ref: "#/components/schemas/TimeSlotRequest"
          type: array
          maxItems: 50
          minItems: 1
          title: Slots
      type: object
      required:
        - slots
      title: ScheduleConfigRequest
    ScheduleConfigResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
        timezone:
          type: string
          title: Timezone
        slots:
          items:
            $ref: "#/components/schemas/TimeSlotResponse"
          type: array
          title: Slots
      type: object
      required:
        - enabled
        - timezone
        - slots
      title: ScheduleConfigResponse
    TimeSlotRequest:
      properties:
        day_of_week:
          type: integer
          maximum: 6
          minimum: 0
          title: Day Of Week
        start_time:
          type: string
          pattern: ^\d{2}:\d{2}$
          title: Start Time
        end_time:
          type: string
          pattern: ^\d{2}:\d{2}$
          title: End Time
      type: object
      required:
        - day_of_week
        - start_time
        - end_time
      title: TimeSlotRequest
    TimeSlotResponse:
      properties:
        day_of_week:
          type: integer
          title: Day Of Week
        start_time:
          type: string
          title: Start Time
        end_time:
          type: string
          title: End Time
      type: object
      required:
        - day_of_week
        - start_time
        - end_time
      title: TimeSlotResponse
    UpdateCampaignRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: "null"
          title: Name
        retry_config:
          anyOf:
            - $ref: "#/components/schemas/RetryConfigRequest"
            - type: "null"
        max_concurrency:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 1
            - type: "null"
          title: Max Concurrency
        schedule_config:
          anyOf:
            - $ref: "#/components/schemas/ScheduleConfigRequest"
            - type: "null"
        circuit_breaker:
          anyOf:
            - $ref: "#/components/schemas/CircuitBreakerConfigRequest"
            - type: "null"
      type: object
      title: UpdateCampaignRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
````
