When to use this endpoint

Use CustomerTypes_getById when an integration already knows the IDs and needs a narrow raw-column response, including trigger text.

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
idsJSON array string or native arrayYesRequested IDs. Values are converted to integers and duplicates are removed; zero is retained if supplied.
fieldsJSON array string or native arrayYesUnique fields selected from id, name, allowed_next, last_edited, and triggers. colour_hex is not available from this endpoint.

Example request

$types = FM_api('CustomerTypes_getById', [
	'ids' => json_encode([12, 13]),
	'fields' => json_encode(['id', 'name', 'triggers']),
]);

Example response

[
  {"id": "12", "name": "Commercial", "triggers": "[]"},
  {"id": "13", "name": "Residential", "triggers": "[]"}
]

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: ids"}The ids key is absent.
{"error":"missing required parameter: fields"}The fields key is absent.
{"error":"no fields selected"}No supplied field is in the allowlist.

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

Behaviour and edge cases

  • Missing IDs are omitted. The response contains exactly the accepted raw column names; trigger JSON is not decoded.
  • The SQL query has no explicit ordering, so response order is not guaranteed to match ids. There is no pagination.

See it in Fieldmotion

CRM1

No direct production CRM1 caller was found.

CRM2

No direct production CRM2 caller was found; most CRM2 forms use CustomerType_getRequestedDetails.

Related endpoints