Asset types
Delete multiple asset types
/a/AssetTypes_delete
Invoke the single asset-type delete route for each value in a legacy request array.
When to use this endpoint
AssetTypes_delete is a legacy bulk wrapper. Prefer individual AssetType_delete calls so the caller can detect in-use types and other failures.
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 | Array | Yes | Native request array of asset-type IDs. Despite the plural operation and its error text, the wire key is singular id. A scalar is not normalized to an array. |
Example request
$result = FM_api('AssetTypes_delete', [
'id' => ['47', '58'],
]);
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: ids"} | The singular wire key id is absent. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- IDs are processed sequentially in supplied order. There is no transaction or rollback.
- A scalar
idis not safely supported: the loop has no valid items but the handler still reaches its success response. - Each successful child call permanently deletes its type-specific layout and writes deletion history; each in-use type remains unchanged.
Side effects
- Can hard-delete any subset of the supplied types and their CRM2 layouts. The wrapper itself records no aggregate audit or per-item result.
See it in Fieldmotion
CRM1
No production CRM1 caller was found; CRM1 deletes one type at a time.
CRM2
No production CRM2 caller was found; CRM2 also loops over selected IDs and calls AssetType_delete individually so it can report failures.
Related endpoints
AssetType_deleteexposes the essential in-use result and permanent-delete behavior.