When to use this endpoint

Use CustomerType_updateData when saving CRM2 configurable fields or applying the same mapped changes to multiple known type IDs.

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
idInteger string or native arrayYesOne ID or an already-decoded ID array. The plural key ids is not accepted. Array mode processes targets independently and discards individual results.
nameStringNoReplacement raw name. Blank and duplicate values are accepted.
allowedNextStringNoReplacement allowed_next text without transition-ID validation.
triggersString or JSON-compatible valueNoReplacement raw trigger value. Arrays/objects are JSON-encoded; strings are stored verbatim.
lastEditedDatetime stringNoRecognized mapped key, but an accepted update writes current server time rather than the supplied value.
colourHexStringNoReplacement colour without format or length validation.

Example request

$updated = FM_api('CustomerType_updateData', [
	'id' => '12',
	'name' => 'Commercial accounts',
	'colourHex' => '#224466',
]);

Example response

{
  "ok": 1
}

Scalar no-op input returns {"warning":"No Change."}; a missing row returns {"warning":"No data."}; unknown update keys return {"warning":"no updated fields."}. Supplying only id returns {"ok":1}.

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"}The id key is absent, including when only ids is supplied.

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

Behaviour and edge cases

  • Unknown keys are ignored. The primary id map entry is not treated as a writable business field by this multi-field operation.
  • The helper advances last_edited to current server time. In array mode, missing target IDs and per-row failures are hidden by the final {"ok":1}. The batch is not transactional.
  • The handler invokes the shared mention-notice helper, but this map has no note/mention field, so normal customer-type updates do not produce mention notifications.

Side effects

  • Updates accepted fields, invalidates the customer-type cache, and writes generic field audit entries.
  • It does not change existing customers or run saved email triggers.

See it in Fieldmotion

CRM1

No production CRM1 caller was found; CRM1’s legacy form uses CustomerType_save.

CRM2

Open Settings → Customer Types and save the configurable detail form. The shared display widget derives this endpoint from its API prefix.

Related endpoints