Customers
Restore a deleted customer
/a/Customer_restore
Restore one soft-deleted customer through the Admin undelete workflow.
When to use this endpoint
Use Customer_restore only from the Admin console when an authorized operator has identified the exact deleted customer to recover.
Normal API credentials and ordinary CRM sessions are deliberately insufficient. Integrations should not automate this recovery route.
Authentication and permissions
The request requires a logged-in session whose login_source is exactly admin-console. Signed API-key authentication is rejected even when it belongs to an administrator.
The Admin session still supplies the tenant context; the ID is resolved only in that tenant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Soft-deleted customer ID to restore. |
Example request
jwtGet('/a/Customer_restore', {
id: 1042
}, result => {
console.log(result);
}); // run only inside an Admin-console-authenticated CRM session
Example response
{
"ok": 1,
"type": "customer",
"id": 1042,
"label": "Customer #1042 (Northwind Service Centre)",
"summary": {
"type": "customer",
"id": 1042,
"name": "Northwind Service Centre"
}
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: id"} | id is absent or not positive. |
{"error":"admin console login required"} | The request is not from an Admin-console session. |
{"error":"deleted customer not found"} | The ID is missing or its customer row is not currently marked deleted. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The customer row is restored by setting
deleted=0andddate=0. Other fields, includingis_active, are left unchanged. - The most recent active deletion-log row is marked with restored metadata, the restoring user ID, timestamp, and route name.
- Repeated restoration is not idempotent: after the first success, a second call returns
deleted customer not found. - There is no pagination.
Side effects
- Invalidates the customer and deletion-log caches.
- Does not recreate disabled recurrences, future jobs, integration upload queues, or any other data removed during deletion/deactivation.
See it in Fieldmotion
CRM1
There is no ordinary CRM1 action. Recovery is exposed through Admin’s deleted-object tools.
CRM2
There is no ordinary CRM2 action. The generic Admin undelete screen can call DeletedObjects_restore, which delegates to the same restore helper.
Related endpoints
Customer_deletesoft-deletes one or more comma-separated customer IDs.Customer_enablereactivates a retained inactive customer; it does not restore a deleted row.