Skip to main content

Update Lead

PUT /leads/{id}

Update any field on an existing lead. Metadata updates use shallow merge semantics: existing keys are preserved, new keys are added, and matching keys are overwritten. Non-metadata fields (first_name, phone, campaign_id, etc.) are replaced directly.

Path Parameters

ParameterTypeRequiredDescription
idstring (uuid)YesLead ID

Request Body

All fields are optional. Only include the fields you want to update.

FieldTypeDescription
first_namestringLead's first name
last_namestring | nullLead's last name
emailstring | nullLead's email address
phonestring | nullLead's phone number
companystring | nullLead's company name
titlestring | nullLead's job title
sourcestringLead source
campaign_idstring (uuid) | nullCampaign ID. Set to null to remove campaign
metadataobjectKey-value pairs to merge into existing metadata

Examples

Update basic fields

curl -X PUT https://api.getnexor.ai/api/public/leads/123e4567-e89b-12d3-a456-426614174000 \
-H "Content-Type: application/json" \
-H "X-API-Key: nxr_live_your_api_key" \
-d '{
"first_name": "Carlos",
"last_name": "Rodriguez",
"company": "New Corp"
}'

Update a single metadata key

Other existing metadata keys are preserved.

curl -X PUT https://api.getnexor.ai/api/public/leads/123e4567-e89b-12d3-a456-426614174000 \
-H "Content-Type: application/json" \
-H "X-API-Key: nxr_live_your_api_key" \
-d '{
"metadata": {
"estado_lead": "calificado"
}
}'

Update fields and metadata together

curl -X PUT https://api.getnexor.ai/api/public/leads/123e4567-e89b-12d3-a456-426614174000 \
-H "Content-Type: application/json" \
-H "X-API-Key: nxr_live_your_api_key" \
-d '{
"phone": "+56987654321",
"campaign_id": "123e4567-e89b-12d3-a456-426614174001",
"metadata": {
"estado_lead": "calificado",
"broker_asociado": "Maria Gonzalez"
}
}'

Responses

200 — Lead updated successfully

{
"success": true,
"lead": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"first_name": "Carlos",
"last_name": "Rodriguez",
"phone": "+56987654321",
"metadata": {
"edad": 35,
"utm_source": "google",
"estado_lead": "calificado",
"broker_asociado": "Maria Gonzalez"
},
"created_at": "2026-02-10T12:00:00Z"
}
}

400 — Validation error

{
"error": "Validation error",
"message": "No fields to update"
}

401 — Authentication error

See Authentication.

404 — Lead not found

{
"error": "Not found",
"message": "Lead not found or does not belong to your account"
}

500 — Internal server error