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

# Bulk Update Leads in Campaign

> Updates multiple existing leads in the specified campaign in a single request. Each item is processed individually and per-lead results are returned. `phone_number` is required in every item to identify the lead. Only provided fields are changed.

## Authentication
All requests require an `Authorization` header using Bearer token authentication:
`Authorization: Bearer <api_key>`



## OpenAPI

````yaml PATCH /api/v2/voice-campaigns/{campaign_id}/leads/update/bulk
openapi: 3.1.0
info:
  title: VoiceAIWrapper API
  description: >-
    REST API for managing campaigns, leads, clients, web widgets, and voice
    providers on VoiceAIWrapper.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.voiceaiwrapper.app
security:
  - bearerAuth: []
paths:
  /api/v2/voice-campaigns/{campaign_id}/leads/update/bulk:
    patch:
      tags:
        - Leads (v2)
      summary: Bulk Update Leads in Campaign
      description: >-
        Updates multiple existing leads in the specified campaign in a single
        request. Each item is processed individually and per-lead results are
        returned. `phone_number` is required in every item to identify the lead.
        Only provided fields are changed.


        ## Authentication

        All requests require an `Authorization` header using Bearer token
        authentication:

        `Authorization: Bearer <api_key>`
      operationId: bulkUpdateLeadsInCampaignV2
      parameters:
        - name: campaign_id
          in: path
          required: true
          description: Identifier of the campaign. Required.
          schema:
            type: string
            example: camp_abc123
      requestBody:
        required: true
        description: >-
          Array of lead update objects. Each object must include `phone_number`
          to identify the lead.
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UpdateLeadRequest'
              minItems: 1
              example:
                - phone_number: '+14155552671'
                  first_name: Jane
                  last_name: Smith
                - phone_number: '+14155559999'
                  do_not_call: true
      responses:
        '200':
          description: Bulk update completed. Per-lead results are included in `results`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          description: Zero-based position of the lead in the request array
                        phone_number:
                          type: string
                          description: Phone number from the request item
                        success:
                          type: boolean
                          description: >-
                            Whether this individual lead was updated
                            successfully
                        message:
                          type: string
                          description: Result message for this lead
                        error:
                          type: array
                          items:
                            type: string
                          description: >-
                            Validation errors for this lead, present only when
                            `success` is false
              example:
                status: success
                message: Bulk lead update completed
                results:
                  - index: 0
                    phone_number: '+14155552671'
                    success: true
                    message: Lead updated successfully
                  - index: 1
                    phone_number: '+14155559999'
                    success: false
                    message: Lead not found
        '400':
          description: Invalid request data. Request body must be a non-empty JSON array.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Body must be a non-empty list
        '401':
          description: Authentication failed. Ensure the Bearer token is present and valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal server error. Contact support if this persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Internal server error
components:
  schemas:
    UpdateLeadRequest:
      type: object
      required:
        - phone_number
      properties:
        phone_number:
          type: string
          description: Phone number of the lead to update (used as identifier). Required.
          example: '+14155552671'
        first_name:
          type: string
          description: Updated first name. Optional.
          example: Jane
        last_name:
          type: string
          description: Updated last name. Optional.
          example: Doe
        email:
          type: string
          format: email
          description: Updated email address. Optional.
          example: jane.doe@example.com
        do_not_call:
          type: boolean
          description: >-
            When true, marks the lead as opted out and prevents future calls.
            Optional.

             Allowed values: true, false.
          example: false
        custom_fields:
          type: object
          additionalProperties: true
          description: Updated custom key-value fields. Optional.
          example:
            plan: pro
        mark_as_unanswered:
          type: boolean
          description: >-
            When true, resets the lead's answered status and re-queues them for
            outbound calling. Only applies when the lead is currently marked as
            answered. Optional. 


            Allowed values: true, false.
          example: true
    ErrorMessage:
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````