Skip to main content
PATCH
/
campaigns-leads
/
{id}
Update a campaign lead
curl --request PATCH \
  --url https://api.dialnexa.com/v1/campaigns-leads/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "phoneNumber": "<string>",
  "countryCode": "<string>",
  "notes": {}
}
'
{
  "id": "lead_abc123",
  "name": "Priya Sharma",
  "phone_number": "+919876543210",
  "campaign_id": "cmp_xyz789",
  "status": "completed",
  "notes": {
    "loan_amount": "250000",
    "product": "home_loan"
  },
  "call_log_id": "log_abc123",
  "created_at": "2024-03-01T10:00:00.000Z"
}
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. Removing and re-adding preserves the original call log for audit while letting the corrected record be re-attempted.

Path parameters

ParameterDescription
idThe campaign-lead ID, for example cmp_5tw8vz2rnx1q.

Body parameters

FieldDescription
phone_numberCorrected E.164 phone number.
metadataNew metadata object. Replaces the existing object, include every key you want to keep.
notesFree-form notes attached to this lead.

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.

Request

curl -X PATCH "https://api.dialnexa.com/v1/campaigns-leads/cmp_5tw8vz2rnx1q" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone_number": "+919876543211"}'

Response

{
  "id": "lead_m4b7zx9nq2pw",
  "campaign_id": "cmp_5tw8vz2rnx1q",
  "phone_number": "+919876543211",
  "metadata": { "customer_name": "Priya Sharma", "product": "home_loan" },
  "status": "pending",
  "created_at": "2024-05-01T09:05:00.000Z"
}

Authorizations

Authorization
string
header
required

Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string
required

Body

application/json
name
string
phoneNumber
string
countryCode
string
notes
object

Response

Success.

id
string
Example:

"lead_abc123"

name
string
Example:

"Priya Sharma"

phone_number
string
Example:

"+919876543210"

campaign_id
string
Example:

"cmp_xyz789"

status
string
Example:

"completed"

notes
object
Example:
{
  "loan_amount": "250000",
  "product": "home_loan"
}
call_log_id
string | null
Example:

"log_abc123"

created_at
string<date-time>
Example:

"2024-03-01T10:00:00.000Z"