When to use this endpoint

Use Asset_getAllContracts only for the CRM2 asset-module contract filter that needs a lightweight list.

Despite its name, it does not return contract details and it does not accept an asset ID. The optional filter is an asset-owner customer ID.

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
customerIDFilterInteger stringNoWhen present, only non-deleted assets whose owner_id equals this integer contribute IDs. A present blank value therefore filters for owner ID zero.

Example request

$contracts = FM_api('Asset_getAllContracts', [
	'customerIDFilter' => '1042',
]);

Example response

[
  {"id": "901", "name": "Annual maintenance"},
  {"id": "944", "name": "Emergency cover"}
]

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.
[]No non-deleted asset is in scope, or no contract’s legacy link text matches the collected asset IDs.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Only non-deleted assets contribute IDs. Archived and inactive assets are still included.
  • Contracts themselves are not filtered by deleted or active state. Results are de-duplicated by SQL DISTINCT.
  • There is no search, pagination, or explicit ordering.
  • The endpoint is read-only and does not validate that customerIDFilter names a customer.

See it in Fieldmotion

CRM1

No direct production CRM1 caller was found; CRM1 uses the richer asset Contracts table endpoint.

CRM2

The Assets module loads this route as contractFilter. Open the CRM2 Assets module and inspect its initial batched network requests.

Related endpoints