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

ParameterTypeRequiredDescription
idInteger stringYesServer-side asset ID after integer conversion. The existence check includes soft-deleted assets.
valStringYesReplacement 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

ResponseCondition
{"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 model and last_edited, sets edited_uuid to Asset_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