Update a lead
Updates fields on an existing lead. Only the fields supplied in the request body are changed; omitted fields are left unchanged.
Request
| Field | Value |
|---|---|
| Method | POST |
| URL | https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId} |
| Auth | Bearer token (Sync-typed). See Authentication. |
| Headers | Content-Type: application/json |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enterpriseId | string | yes | The enterprise (workspace) ID. |
leadId | string | yes | The lead's ID. |
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
hidePII | boolean | false | When true, personal data on the returned lead is redacted. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
fields | object | yes | Fields to update, keyed by API name. Each value must conform to its field type. |
WARNING
The lead's identifier field (default: phone) cannot be modified through this endpoint. Including it returns 403 INVALID_LEAD.
Example request
bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/603d2b2f9b1e8a001c8e4f5c" \
-H "Authorization: Bearer YOUR_SYNC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"status": "Qualified",
"rating": 4
}
}'Responses
200 OK
Returns the lead's current state (actions are not included).
json
{
"id": "603d2b2f9b1e8a001c8e4f5c",
"fields": {
"name": "Jane Doe",
"phone": "919999999999",
"status": "Qualified",
"rating": 4
},
"remarks": [
{ "field": "fields.rating", "status": "IGNORED", "remark": "Rating must be between 1 and 5" }
]
}remarks is present only when at least one field was rejected, and id is always present.
WARNING
Update is a partial-success endpoint. A field whose value fails validation is dropped and reported in remarks — the call still returns 200. A successful status is not confirmation that every field was written.
401 Unauthorized
See the universal 401 in the overview.
403 Forbidden
Attempted to modify the lead identifier.
json
{
"error": {
"code": "INVALID_LEAD",
"message": "Cannot modify lead identifier field"
}
}404 Not Found
json
{
"error": {
"code": "LEAD_NOT_FOUND",
"message": "Lead with ID 62ab16e was not found."
}
}Notes
- To change a lead's status, set
fields.statusto a valid label from the workspace's lead stage pipeline. A label that doesn't resolve to an active status is silently reverted to the lead's current status, and a default lost reason may be assigned alongside a status in aLOSTstage. - Field values are validated against their defined type. Invalid values do not produce a
400— they are ignored and listed inremarks. - Three further reasons a field is silently ignored, each with its own remark: the API name doesn't exist in the workspace (
Field <name> not found), the field is hidden from the default view (Field <name> is hidden), or the field is configured withlockAfterCreateand already holds a value (Field <name> is locked after creation). - Adding actions to an existing lead is a separate call — see
POST /lead/{leadId}/action.