Assets
Retrieve an asset owner
/a/Asset_getOwner
Return an asset’s current owner ID, optionally joined to the customer name.
When to use this endpoint
Use Asset_getOwner when a job, invoice, pricing, or location-history workflow needs the asset’s owner without loading the complete asset.
Set name=1 only when the customer display name is also needed.
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, customer, or asset permission is checked.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive server-side asset ID. App IDs are not accepted. |
name | Integer string | No | Converted to an integer; any nonzero value adds the joined customer name. Omitted, blank, and zero return only owner_id. |
Example request
$owner = FM_api('Asset_getOwner', [
'id' => '4821',
'name' => '1',
]);
Example response
{
"owner_id": "1088",
"name": "Example Engineering"
}
An asset with no owner returns {"owner_id":"0"}, or {"owner_id":"0","name":null} when name is enabled.
A missing or soft-deleted asset returns the JSON value false.
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":"missing or invalid parameter: id"} | id is omitted or does not convert to a positive integer. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The asset lookup excludes soft-deleted rows but includes inactive and archived assets.
- The optional customer join does not filter inactive or soft-deleted customers. A missing customer leaves
nameasnullwhile preserving the stored owner ID. - No customer existence or ownership authorization is applied.
- This is a single-record lookup with no filtering or pagination.
See it in Fieldmotion
CRM1
Open Asset Location History, prepare an invoice email for an asset-linked job, or calculate owner-specific schedule-of-rates pricing and filter Network requests for Asset_getOwner. Location History supplies name=1; pricing and invoice flows normally need only the ID.
CRM2
Prepare an invoice email from an asset-linked job and filter Network requests for Asset_getOwner. CRM2 uses the returned owner ID to load the customer email.
Related endpoints
Asset_setOwnerchanges the owner and records movement history.Asset_getreturns the owner ID with other selected asset fields and supports optional owner-name enrichment.Asset_getAddresscan fall back to the owner’s address.