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

ParameterTypeRequiredDescription
idInteger stringYesPositive server-side asset ID. App IDs are not accepted.
nameInteger stringNoConverted 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

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"}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 name as null while 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_setOwner changes the owner and records movement history.
  • Asset_get returns the owner ID with other selected asset fields and supports optional owner-name enrichment.
  • Asset_getAddress can fall back to the owner’s address.