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 endpoint returns immediately once the request is accepted into the processing queue. No lead ID or processing outcome is returned.

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

The request was accepted into the processing queue.

json
{ "status": "QUEUED" }

WARNING

A 200 response does not confirm that the lead was created or updated successfully. Validation failures during background processing — wrong field types, missing identifier, missing ACTION_ prefix — are not reported back. Verify ingestion either through the telecrm dashboard or by reading the lead through the Sync API.

401 Unauthorized

The token is missing, invalid, or of the wrong type (a Sync token used on the Async endpoint).

json
{
  "error": {
    "code": "NOT_AUTHORIZED",
    "message": "Invalid or missing access token."
  }
}

429 Too Many Requests

The token has exceeded the rate limit of 18,000 requests/hour. Back off and retry.

Notes

  • Fields not defined in the workspace are dropped during processing.
  • 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.