Create or Update Lead
Queues a lead for create-or-update. The lead is matched against the workspace's lead identifier:
- Match found — the existing lead is updated with the supplied fields. Fields not present in the request are left unchanged.
- No match — a new lead is created.
Any actions in the request are appended to the lead's timeline in the order provided.
The response reports what happened — Created or Updated — and carries the affected lead's ID.
Request
| Field | Value |
|---|---|
| Method | POST |
| URL | https://next-api.telecrm.in/enterprise/{enterpriseId}/autoupdatelead |
| Auth | Bearer token (Async-typed). See Authentication. |
| Headers | Content-Type: application/json |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enterpriseId | string | yes | The enterprise (workspace) ID. Find it under Settings → Website and API in the dashboard. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
fields | object | yes | Lead field values keyed by field API name. Must include the lead identifier. Each value must conform to its field type. |
actions | array of object | no | List of actions to append to the lead's timeline. Each entry is either a custom action (with ACTION_-prefixed type) or a PAYMENT action. |
Example request
bash
curl -X POST "https://next-api.telecrm.in/enterprise/{enterpriseId}/autoupdatelead" \
-H "Authorization: Bearer YOUR_ASYNC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"name": "Jane Doe",
"phone": "919999999999",
"email": "jane.doe@example.com"
},
"actions": [
{
"type": "ACTION_1001",
"fields": {
"note": "Site visit completed"
}
}
]
}'Responses
200 OK
json
{
"index": 0,
"uniqueIdentifier": "919999999999",
"modifiedLeadIds": ["603d2b2f9b1e8a001c8e4f5c"],
"status": "Created",
"errorMessage": ""
}| Field | Description |
|---|---|
status | Created, Updated, or Error. |
modifiedLeadIds | IDs of the leads created or updated. Usually one entry. |
uniqueIdentifier | The identifier value the lead was matched on. |
errorMessage | Populated when status is Error; empty otherwise. |
index | Position of this lead in the request. Always 0 on the single-lead endpoint. |
WARNING
A 200 still isn't confirmation that every field landed. Individual fields and actions that fail validation are dropped without appearing in this response — there is no remarks array here, unlike the Sync API. Check status and errorMessage for the lead-level outcome, and verify field-level ingestion through the dashboard or the Sync API.
400 Bad Request
The body is missing fields, or is otherwise unusable. The response is plain text, not the Sync API's error envelope:
INVALID_AUTO_UPDATE_LEAD_BODY403 Forbidden
Returned — not 401 — when the token is missing, invalid, or of the wrong type (a Sync token used on the Async endpoint). The body is the plain-text string NOT_AUTHORIZED.
429 Too Many Requests
The token has exceeded its rate limit. Back off and retry.
Notes
- Each action entry may carry a top-level
employeeidholding a team member's email, attributing the action to that person instead of the telecrm system user. See Actions → Attributing an action. - The Async API does not use the Sync API's
{ "error": { … } }envelope. Every non-2xx body here is a plain-text string. - Fields not defined in the workspace are dropped during processing, and are not reported in the response.
- Action types other than
PAYMENTand workspace-defined custom actions are dropped. - See Pitfalls for the most common ways requests fail silently.
- See Examples for end-to-end payloads.