Assets
Set an asset model
/a/Asset_setModel
Replace the model text on one asset.
When to use this endpoint
Use Asset_setModel for a focused edit of a known asset’s model.
The value is free text; no model catalogue or make relationship is validated.
Authentication and permissions
The handler requires an authenticated tenant context, established by signed API-key fields or a CRM session. It checks the tenant table prefix but does not separately require a logged-in user ID.
No page, role, or asset permission is checked.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Server-side asset ID after integer conversion. The existence check includes soft-deleted assets. |
val | String | Yes | Replacement model, stored without trimming. Blank and surrounding whitespace are accepted. The endpoint does not enforce the schema’s 45-character limit. |
Example request
$result = FM_api('Asset_setModel', [
'id' => '4821',
'val' => 'CX4',
]);
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 omitted. |
{"error":"no val provided"} | val is omitted. |
{"error":"asset does not exist"} | No asset row has the converted ID. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- There is no no-change shortcut or normalization.
- The endpoint can update archived or soft-deleted assets.
- This is a single-record mutation; it provides no list filtering or pagination.
Side effects
- Attempts to update
modelandlast_edited, setsedited_uuidtoAsset_setModel, invalidates the asset cache, and writes an asset audit entry.
See it in Fieldmotion
CRM1
Open an asset edit page or the editor in a customer’s Assets tab, change Model, and filter Network requests for Asset_setModel.
CRM2
No direct production CRM2 call to Asset_setModel was found; CRM2 uses its broader update contract.
Related endpoints
Asset_setMakechanges the companion make field.Asset_getreturns model when requested.Asset_newaccepts model during creation.