Skip to content

Examples

Each example below shows a complete curl request against POST /enterprise/{enterpriseId}/autoupdatelead. Replace {enterpriseId} with your enterprise ID and YOUR_ASYNC_TOKEN with a valid Async token.

Minimal lead

A new lead with only the lead identifier (default: phone).

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": {
      "phone": "919999999999"
    }
  }'

Lead with standard fields

Standard fields (name, email, status) plus the identifier. If a lead with this phone already exists, it is updated; otherwise it is created.

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",
      "status": "Fresh"
    }
  }'

Lead with custom fields

Custom fields are referenced by their workspace API name. Each value must match the field's defined type.

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",
      "contact_source": "Website",
      "interests": ["VIP", "Returning"],
      "deal_size": 1000,
      "follow_up_date": "01/06/2026 10:30:00"
    }
  }'

Lead with a custom action

The custom action's type must use the ACTION_<code> format. Find the code under Settings → Custom Actions in the dashboard.

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"
    },
    "actions": [
      {
        "type": "ACTION_1001",
        "fields": {
          "note": "Site visit completed",
          "outcome": "Interested"
        }
      }
    ]
  }'

Lead with a payment action

Payment actions require type, status, currency, and amount. See Actions for the full enum lists.

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"
    },
    "actions": [
      {
        "type": "PAYMENT",
        "status": "COMPLETED",
        "currency": "INR",
        "amount": "5000"
      }
    ]
  }'

Lead with mixed actions

Multiple actions can be sent in one request. They are appended to the timeline in the order given.

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"
    },
    "actions": [
      {
        "type": "ACTION_1001",
        "fields": { "note": "Demo scheduled" }
      },
      {
        "type": "PAYMENT",
        "status": "PENDING",
        "currency": "INR",
        "amount": "10000"
      }
    ]
  }'