Asset types
Set asset-type metadata
/a/AssetType_setMeta
Set one arbitrary top-level property in an asset type’s legacy metadata object.
When to use this endpoint
Use AssetType_setMeta only for compatibility code that must merge one known property into asset_types.meta. Prefer focused routes such as AssetType_setUrl or the current layout APIs where available.
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 | Existing asset-type ID. |
name | String | Yes | Top-level metadata property name. Blank is accepted when the key is present. Reserved properties such as template and url are not protected. |
val | Mixed | Yes | Value assigned to the property. Null is rejected as absent; arrays and objects are preserved through JSON encoding. |
Example request
$result = FM_api('AssetType_setMeta', [
'id' => '47',
'name' => 'service_class',
'val' => 'compressor',
]);
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":"no ID provided"} | id is absent. |
{"error":"no name provided"} | name is absent. |
{"error":"no val provided"} | val is absent or null. |
{"error":"asset_type does not exist"} | The asset type is not found. |
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 stored metadata is decoded, one top-level property is assigned, and the entire object is encoded again.
- There is no no-change check and no schema validation for the chosen property or value.
Side effects
- Updates
metaand invalidates the asset-type cache. It does not updatelast_editedor write an audit entry.
See it in Fieldmotion
CRM1
No direct production CRM1 UI call was found outside test/setup code; focused UI paths use AssetType_setTemplate and AssetType_setUrl.
CRM2
No direct production CRM2 caller was found.
Related endpoints
AssetType_setTemplatedecodes and stores the legacy template while refreshinglast_edited.AssetType_setUrlchanges only the legacy QR redirect URL.