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

# Update Lead

> Update an existing lead in your campaigns

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

```bash cURL theme={null}
curl -X PUT "https://app.lacy.ai/api/user/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"
    }
  }'
```

```json Success Response theme={null}
{
  "message": "Lead updated successfully"
}
```

```json Error Response - Lead Not Found theme={null}
{
  "message": "Lead not found"
}
```

```json Error Response - Campaign Not Found theme={null}
{
  "message": "Campaign not found"
}
```

```json Error Response - Invalid Phone Number theme={null}
{
  "message": "Invalid phone number"
}
```

```json Error Response - Validation Failed theme={null}
{
  "message": "Validation failed",
  "errors": {
    "campaign_id": ["The selected campaign does not exist"],
    "status": ["This status is assigned automatically and cannot be set manually"],
    "variables": ["Variables must be an array"]
  }
}
```

```json Error Response - Invalid Fields theme={null}
{
  "message": "Invalid fields: invalid_field, another_invalid_field"
}
```

## 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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.