Assets
List assets
/a/Assets_list
Return selected fields for non-deleted assets using compact picker and availability filters.
When to use this endpoint
Use Assets_list for an unpaged asset lookup where the caller controls a small field allowlist. Use the DataTable endpoints for server paging.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login or an established tenant database context and performs no additional Asset-page or role-permission check unless the page says otherwise.
Every query and write uses the authenticated tenant’s tables. CRM1 and CRM2 may hide actions through client-side permissions that these collection routes do not repeat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
all | Presence flag | No | When absent, excludes archived assets. Any present value, including 0, includes archived rows. |
type_id | Native array | No | Type IDs; used only when the first value is a positive integer. |
name | String | No | Trimmed, lowercase substring search on asset name. |
active | Integer-compatible | No | Exact active flag. Presence matters, so blank filters as 0. |
always_include | Integer-compatible | No | Positive ID included even when it fails archive, type, name, active, or date filters, but never when soft-deleted. |
date_from / date_to | Unix timestamps | No | When both are positive and date_from<date_to, excludes assets whose movement intervals overlap the inclusive local datetime window. |
fields | JSON array string or native array | No | Allowlisted fields: id, name, code, owner_id, type_id, last_edited, and location_id. Defaults to id,name when none are valid. |
Example request
$assets = FM_api('Assets_list', [
'type_id' => ['17'],
'fields' => json_encode(['id', 'name', 'code']),
]);
Example response
[
{"id": "4821", "name": "Compressor 4", "code": "CMP-004"}
]
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. |
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 explicit ordering, pagination, or result limit. Database scalar values remain strings.
- The date window is an availability exclusion based on movement history, not an asset creation/edit-date filter.
- Movement rows tied to a deleted or missing job do not block availability; retained history without a job still participates. Deleting a job does not erase historical movements.
See it in Fieldmotion
CRM1
Asset selectors, the Asset Timeline, maintenance selectors, and migration tools call this route with different allowlists.
CRM2
CRM2 migration tooling calls it during controlled data replacement; primary CRM2 Asset screens use Assets_getDataTable.
Related endpoints
Assets_listSomeadds owner/whereabouts filters but has a broader include exception.Assets_getByIdenriches a known batch.