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

# Update Campaign Lead

> Correct a campaign lead's phone number, metadata, or notes before the call is placed. Locked once dialling begins.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. A public v1 replacement is not currently listed in the v1 reference. This endpoint remains available for existing integrations until then.
</Warning>

Updates editable fields on a campaign lead, the `phone_number`, the `metadata` object that holds dynamic variables, and any free-form notes. Updates are only permitted while the lead is in `pending` status; once a call has been initiated, the lead's data is locked so the call log can be reconciled cleanly against the configuration in effect at dial time.

## When to use this

* **Data quality fixes**: you discovered a typo in a phone number after uploading a batch and want to correct it before the campaign reaches that row.
* **Late variable updates**: you want to add a personalization variable (for example `customer_first_name`) that was missing from the original upload, before the lead is dialled.
* **Re-categorization**: you want to tag the lead with a different `product` or `segment` so the agent's prompt branches correctly.

If the lead has already been dialled, the cleanest path is to leave the existing record alone and enroll a corrected version with [Upload Campaign Leads](/docs/api-reference/campaign-leads/upload). Removing and re-adding preserves the original call log for audit while letting the corrected record be re-attempted.

## Path parameters

| Parameter | Description                                           |
| --------- | ----------------------------------------------------- |
| `id`      | The campaign-lead ID, for example `cmp_5tw8vz2rnx1q`. |

## Errors

* `404 Not Found` is returned when the lead does not exist or has been removed.
* `409 Conflict` is returned when the lead has already been dialled and its data is locked.
* `400 Bad Request` is returned when `phone_number` is not in E.164 format.

## Related endpoints

* [Get Campaign Lead](/docs/api-reference/campaign-leads/get): confirm the new values.
* [Upload Campaign Leads](/docs/api-reference/campaign-leads/upload): bulk-add or re-add corrected leads.
* [Remove Campaign Lead](/docs/api-reference/campaign-leads/delete): remove the lead instead of editing.
* [Dynamic Variables](/docs/agents/dynamic-variables): how `metadata` is referenced in agent prompts.


## OpenAPI

````yaml PATCH /campaigns-leads/{id}
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /campaigns-leads/{id}:
    patch:
      tags:
        - Campaign Leads
      summary: Update a lead for a specific campaign
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: CampaignsLeadsController_update
      parameters:
        - name: campaignId
          required: true
          in: path
          description: ID of the campaign
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: ID of the lead
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignLeadDto'
      responses:
        '200':
          description: Lead updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignLead'
        '404':
          description: Lead not found
        '500':
          description: Internal server error
      deprecated: true
components:
  schemas:
    UpdateCampaignLeadDto:
      type: object
      properties:
        name:
          type: string
          example: Jane Doe
          description: Updated name of the lead
        phoneNumber:
          type: number
          example: '+919876543211'
          description: Updated phone number of the lead
        countryCode:
          type: string
          example: '+91'
          description: Updated country code
        organisationId:
          type: string
          example: org_abc123xyz789
          description: Updated organisation ID (string of length 14)
        campaignId:
          type: string
          example: 6
          description: Updated campaign ID
        notes:
          type: object
          example:
            customer_id: '123'
            follow_up: true
            tags:
              - vip
              - renewal
          description: Optional notes JSON for the lead. Maximum 15 top-level keys.
    CampaignLead:
      type: object
      properties:
        id:
          type: string
          example: lead_abc123
          description: Signed lead ID
      required:
        - id
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````