When to use this endpoint

Use AssetType_updateData for configurable CRM2 Asset Type edit layouts. It updates mapped columns and writes generic audit entries.

Use focused legacy setters only when their extra rules are required—for example, AssetType_setName checks duplicate names.

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

ParameterTypeRequiredDescription
idInteger string or arrayYesTarget ID or IDs. Scalar mode returns that row’s warning/error; array mode loops over IDs but always returns {"ok":1}, discarding each per-row result.
nameStringNoReplacement name. Blank and duplicate values are accepted because the focused name validation is not called.
metaString or JSON-compatible valueNoReplaces complete metadata. Structured input is JSON-encoded.
attrs / rentalTypeIDInteger stringsNoReplace the attribute bitmask and rental-type ID. Values are integer-converted and references are not validated.
metaURLStringNoMerges one value at meta.url. If meta is also supplied, this mapped field is applied afterward.
lastEditedDatetime stringNoAccepted by the map, but every changed update appends current server last_edited after mapped values, so callers cannot preserve their supplied timestamp.
noRecordArrayNoMapped field keys whose generic audit entry should be marked hidden. It does not suppress the update.

Example request

$result = FM_api('AssetType_updateData', [
	'id' => '47',
	'name' => 'Mobile Compressor',
	'attrs' => '2',
	'metaURL' => 'https://example.test/assets',
]);

Example response

{
  "ok": 1
}

Scalar no-op input can return {"warning":"No Change."}; a missing row can return {"warning":"No data."}; only unknown update keys return {"warning":"no updated fields."}. Supplying only id returns {"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":"missing or invalid parameter: id"}The id key 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

  • Unknown request keys are ignored. If no recognized fields remain, scalar mode returns a warning.
  • Layout readonly/hidden flags are not API authorization. The route does not enforce unique names or validate rental types.
  • No custom-layout group or legacy-template merge occurs when metadata changes.

Side effects

  • Changed rows receive current last_edited, asset-type cache invalidation, and per-field generic audit entries.
  • The operation is not atomic across an ID array.

See it in Fieldmotion

CRM1

No primary production CRM1 save uses this route; CRM1 uses focused setters.

CRM2

Edit an Asset Type through the configurable edit dialog or main layout and inspect AssetType_updateData. The shared layout registry selects this update route.

Related endpoints