Assets
Restore a deleted asset
/a/Asset_restore
Restore one soft-deleted asset through the Admin undelete workflow.
When to use this endpoint
Use Asset_restore only from the Admin console when an authorized operator has selected the exact deleted asset to recover.
Normal API credentials and ordinary CRM sessions are deliberately insufficient. Integrations should not automate this 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 supplies the tenant context; the asset ID is resolved only in that tenant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Soft-deleted asset ID to restore. |
Example request
jwtGet('/a/Asset_restore', {
id: 4821
}, result => {
console.log(result);
}); // only inside an Admin-console-authenticated CRM session
Example response
{
"ok": 1,
"type": "asset",
"id": 4821,
"label": "Asset #4821 (Compressor 4)",
"summary": {
"type": "asset",
"id": 4821,
"name": "Compressor 4",
"code": "CMP-004"
}
}
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 asset not found"} | The ID is missing or its asset row is not currently soft-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 row is restored by setting
deleted=0andddate=0. Fields such asactiveandarchivedare not changed. - The most recent active deletion-log row is retained and marked with restored metadata, restoring user ID, timestamp, and
Asset_restore. - Restoration is not idempotent: a second call returns
deleted asset not found. There is no pagination.
Side effects
- Invalidates the asset and deletion-log caches.
- Does not recreate or alter movement history, jobs, contracts, files, maintenance recurrences, or related records affected by the original deletion workflow.
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 helper.
Related endpoints
Asset_deletesoft-deletes an asset.Asset_unarchiveclears the separate archived flag; it does not restore a soft-deleted row.