Update an action
Updates an existing action. Constraints by action type:
- Custom actions: any defined field except
FILEfields can be updated. Send the action'stypeand only the fields you want to change. SetFILEfields withPOST .../action/{actionId}/file. - Payment actions: only
statuscan be updated.amount,currency,paymentidandemployeeidare immutable on existing payments — sending a changed value for any of them returns400. - Attachment actions: cannot be updated — a request for one returns
400. Create a new attachment and delete the old file instead.
Request
| Field | Value |
|---|---|
| Method | POST |
| URL | https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/action/{actionId} |
| Auth | Bearer token (Sync-typed). See Authentication. |
| Headers | Content-Type: application/json |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enterpriseId | string | yes | The enterprise (workspace) ID. |
leadId | string | yes | The lead's ID. |
actionId | string | yes | The action's ID. |
Body
The body is the action object to update. The type field must match the action's existing type.
Custom action:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | The custom action's numeric code (e.g. "1001"). |
fields | object | no | Fields to update on the action. |
Payment action:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Must be "PAYMENT". |
status | string | no | New status. Only this field can change on existing payments. |
Example requests
Update a custom action's note:
bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/603d2b2f9b1e8a001c8e4f5c/action/603d2b2f9b1e8a001c8e4f5d" \
-H "Authorization: Bearer YOUR_SYNC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "1001",
"fields": {
"note": "Follow-up completed"
}
}'Mark a payment as completed:
bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/603d2b2f9b1e8a001c8e4f5c/action/603d2b2f9b1e8a001c8e4f5e" \
-H "Authorization: Bearer YOUR_SYNC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "PAYMENT",
"status": "COMPLETED"
}'Responses
200 OK
Returns the action's current state wrapped in an action key, alongside the lead's ID and any field-level remarks.
Custom action:
json
{
"leadid": "603d2b2f9b1e8a001c8e4f5c",
"action": {
"type": "ACTION_1001",
"fields": { "note": "Follow-up completed" }
},
"remarks": []
}Payment action:
json
{
"leadid": "603d2b2f9b1e8a001c8e4f5c",
"action": {
"type": "PAYMENT",
"status": "COMPLETED",
"currency": "INR",
"amount": 5000
}
}Individual fields that could not be applied — hidden on the action's display schema, or locked by lockAfterCreate — are listed in remarks while the rest of the update still succeeds. remarks is omitted when everything applied cleanly.
400 Bad Request
The update is not permitted — either the action type cannot be written through the API, or the request attempts to modify immutable payment fields.
json
{
"error": {
"code": "BAD_REQUEST",
"message": "Cannot update amount, currency, paymentid or employeeid fields for existing payment action"
}
}401 Unauthorized
See the universal 401 in the overview.
404 Not Found
json
{
"error": {
"code": "ACTION_NOT_FOUND",
"message": "Action with ID 62ab16e was not found in the lead."
}
}