When to use this endpoint

Use Customer_setMobile for a focused edit to a known customer mobile number.

Normalize and validate the number in the caller if it will be used for messaging or matching; this endpoint treats it as opaque 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
idInteger stringYesCustomer to update; it must convert to a positive integer.
valStringYesNew mobile value, stored exactly as supplied. Blank clears the field; whitespace is not trimmed.

Example request

$result = FM_api('Customer_setMobile', [
	'id' => '1088',
	'val' => '+44 7700 900123',
]);

Example response

{
  "ok": 1
}

An exact unchanged string returns {"ok":1,"msg":"no change needed"}.

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 absent or invalid.
{"error":"missing or invalid parameter: val"}val was omitted.
{"error":"customer does not exist"}No matching customer row exists.

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 lookup has no active/deleted filter.
  • The handler applies no trimming, phone-format, length, or uniqueness validation.
  • The no-change comparison is byte-for-byte string comparison.
  • This is a single-record mutation; it provides no list filtering or pagination.

Side effects

  • A real change updates mobile, last_edited, and edited_uuid. It does not explicitly invalidate the customer cache.
  • It writes a customer audit-log entry and fires Customer_edit. It sends no SMS.

See it in Fieldmotion

CRM1

Open the legacy customer edit popup, change Mobile, and filter Network requests for Customer_setMobile.

CRM2

No direct production CRM2 caller was found. CRM2 customer forms use the mapped layout update contract.

Related endpoints