When to use this endpoint

Use Customer_setFlagged to reproduce the flagged/unflagged control shown in CRM1 for a known customer.

Use 0 or 1 for interoperability even though the endpoint accepts every integer.

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 ID; it must convert to a positive integer.
valueInteger stringYesValue stored in is_flagged after integer conversion. The handler does not restrict it to 0 or 1.

Example request

$result = FM_api('Customer_setFlagged', [
	'id' => '1088',
	'value' => '1',
]);

Example response

{
  "ok": 1
}

This response is also returned for a nonexistent ID and for an unchanged value.

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: value"}value was omitted; a present blank string is accepted and becomes 0.

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

Behaviour and edge cases

  • Input uses PHP integer conversion; non-numeric strings and blank become 0.
  • There is no active/deleted filter and no no-change short circuit.
  • Values such as -1 and 5 are stored even though CRM controls use a Boolean-like value.
  • This is a single-record mutation; it provides no list filtering or pagination.

Side effects

  • The update attempts to set is_flagged, last_edited, and edited_uuid, and invalidates the customer cache.
  • It writes a customer audit-log entry and fires Customer_edit even when the customer ID does not match a row.

See it in Fieldmotion

CRM1

Toggle the flag in the legacy Customers table or the customer edit page and filter Network requests for Customer_setFlagged. Both controls send value.

CRM2

No direct production CRM2 caller was found. CRM2 uses layout-driven customer updates.

Related endpoints

  • Customer_get can confirm whether the row exists and which value was stored.
  • Customers_list can locate the target customer before flagging it.