PUT
/
api
/
leads
/
{id}
curl -X PUT "https://api.example.com/api/leads/123" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": 456,
    "phone_number": "+1234567890",
    "variables": {
      "name": "John Doe",
      "company": "Acme Corp"
    }
  }'
{
  "message": "Lead updated successfully"
}
Update a lead by providing the lead ID and the fields you want to modify. Only the fields provided in the request will be updated.

Path Parameters

id
integer
required
The ID of the lead to update

Body Parameters

campaign_id
integer
The ID of the campaign to assign the lead to
phone_number
string
The phone number of the lead (will be formatted to E164)
status
string
The status of the lead. Must be one of: created, completed, reached-max-retries
variables
object
Custom variables to merge with existing lead variables

Response

message
string
Success message indicating the lead was updated
curl -X PUT "https://api.example.com/api/leads/123" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": 456,
    "phone_number": "+1234567890",
    "variables": {
      "name": "John Doe",
      "company": "Acme Corp"
    }
  }'
{
  "message": "Lead updated successfully"
}

Notes

  • The lead must belong to the authenticated user
  • If updating the campaign, the new campaign must also belong to the authenticated user
  • Phone numbers are automatically formatted and validated
  • Variables are merged with existing variables (not replaced)
  • Only allowed fields can be updated: campaign_id, phone_number, status, variables
  • The status field has restricted values for data integrity