Assets
Delete an asset
/a/Asset_delete
Soft-delete one asset, timestamp the deletion, and publish it to the tenant deletion log.
When to use this endpoint
Use Asset_delete when the caller has explicitly confirmed that one asset should be removed. CRM1 exposes it from archived asset rows and import-history cleanup; CRM2 exposes it as a delete action.
Use Asset_archive when the asset should remain recoverable through the normal archived-assets view.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive server-side asset ID. The target must currently have deleted=0; archived state is irrelevant. |
Example request
$result = FM_api('Asset_delete', [
'id' => '4821',
]);
Example response
{
"ok": 1
}
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 does not convert to a positive integer. This validation precedes login enforcement. |
{"error":"asset does not exist"} | The asset is missing or already 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 soft-deleted with
deleted=1; it is not physically removed. ddateis stored as the current Unix timestamp, whilelast_editedis stored as a server date-time.edited_uuidis not changed.- Inactive, live, and archived assets can all be deleted.
- This is a single-record mutation with no filtering or pagination.
Side effects
- Invalidates the
assetscache and inserts anassetsdeletion-log row for offline/app synchronization. - Writes an asset audit-log entry. The asset update, deletion log, and audit entry are not wrapped in one transaction.
See it in Fieldmotion
CRM1
From the archived view in Assets or a customer’s Assets tab, confirm Delete and filter Network requests for Asset_delete. Import History also calls this endpoint while removing imported asset rows.
CRM2
In the CRM2 Assets module, choose Delete Asset and complete its explicit confirmation; filter Network requests for Asset_delete. CRM2 Import History also uses it for imported assets.
Related endpoints
Asset_archivehides an asset without setting its soft-delete fields.Asset_unarchiveonly reverses archival and does not restore this soft deletion.Asset_getexcludes the asset after deletion.