Skip to content

Actions — Examples

Replace {enterpriseId} with your enterprise ID, {leadId} with the target lead's ID, and YOUR_SYNC_TOKEN with a valid Sync token.

Create a custom action on an existing lead

bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action" \
  -H "Authorization: Bearer YOUR_SYNC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "actions": [
      {
        "type": "1001",
        "fields": {
          "note": "Site visit completed",
          "outcome": "Interested"
        }
      }
    ]
  }'

Find your custom action codes under Settings → Custom Actions in the dashboard.

Create a payment action, then update its status

Step 1 — record a pending payment:

bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action" \
  -H "Authorization: Bearer YOUR_SYNC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "actions": [
      {
        "type": "PAYMENT",
        "status": "PENDING",
        "currency": "INR",
        "amount": "10000"
      }
    ]
  }'

The response contains the new payment's action_id. Step 2 — mark it completed once payment clears:

bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action/{actionId}" \
  -H "Authorization: Bearer YOUR_SYNC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "PAYMENT",
    "status": "COMPLETED"
  }'

amount and currency are immutable once the payment exists — only status changes.

Search the timeline for outgoing calls

bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action/search" \
  -H "Authorization: Bearer YOUR_SYNC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "OUTGOING_CALL",
    "created_on": {
      "from": "01/04/2026 00:00:00",
      "to": "30/04/2026 23:59:59"
    }
  }'

OUTGOING_CALL is one of many built-in types — see the full list under Action Types.

Read a single payment action by ID

bash
curl "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action/{actionId}" \
  -H "Authorization: Bearer YOUR_SYNC_TOKEN"

Returns:

json
{
  "type": "PAYMENT",
  "status": "COMPLETED",
  "currency": "INR",
  "amount": "10000"
}

Mixed batch with a partial failure

Two actions sent together, one with a bad field:

bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action" \
  -H "Authorization: Bearer YOUR_SYNC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "actions": [
      {
        "type": "1001",
        "fields": { "note": "Demo scheduled" }
      },
      {
        "type": "PAYMENT",
        "status": "PENDING",
        "currency": "INR",
        "amount": "0"
      }
    ]
  }'

The first action succeeds, the second is rejected because amount must be greater than zero:

json
{
  "lead_id": "{leadId}",
  "actions": [
    { "action_id": "603d2b2f9b1e8a001c8e4f5d", "status": "CREATED" },
    { "action_id": null, "status": "IGNORED" }
  ],
  "remarks": [
    { "field": "actions[1].fields.amount", "status": "IGNORED", "remark": "Amount must be greater than 0" }
  ]
}