Skip to content

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 ​

FieldValue
MethodPOST
URLhttps://next-api.telecrm.in/enterprise/{enterpriseId}/autoupdatelead
AuthBearer token (Async-typed). See Authentication.
HeadersContent-Type: application/json

Path parameters ​

NameTypeRequiredDescription
enterpriseIdstringyesThe enterprise (workspace) ID. Find it under Settings → Website and API in the dashboard.

Body ​

FieldTypeRequiredDescription
fieldsobjectyesLead field values keyed by field API name. Must include the lead identifier. Each value must conform to its field type.
actionsarray of objectnoList 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": ""
}
FieldDescription
statusCreated, Updated, or Error.
modifiedLeadIdsIDs of the leads created or updated. Usually one entry.
uniqueIdentifierThe identifier value the lead was matched on.
errorMessagePopulated when status is Error; empty otherwise.
indexPosition 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_BODY

403 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 employeeid holding 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 PAYMENT and workspace-defined custom actions are dropped.
  • See Pitfalls for the most common ways requests fail silently.
  • See Examples for end-to-end payloads.