When to use this endpoint

Use Asset_setValue for the focused asset-value field in CRM1.

Normalize and range-check monetary input before calling; this handler is more permissive than asset creation.

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.
valNumeric stringYesConverted with floatval and interpolated as a number. Nonnumeric text and blank become 0. Unlike Asset_new, this setter has no explicit maximum check.

Example request

$result = FM_api('Asset_setValue', [
	'id' => '4821',
	'val' => '1250.00',
]);

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 and negative values are not explicitly rejected.
  • 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 value and last_edited, sets edited_uuid to Asset_setValue, invalidates the asset cache, and writes an asset audit entry.

See it in Fieldmotion

CRM1

Edit Value on an asset edit page or customer Assets tab and filter Network requests for Asset_setValue. The customer Assets table coerces its input to a JavaScript number before sending it.

CRM2

No direct production CRM2 call to Asset_setValue was found; CRM2 uses its broader update contract.

Related endpoints

  • Asset_get returns the stored decimal value, normally as a JSON string.
  • Asset_new applies an explicit positive maximum during creation.