Customers
Set a customer flag
/a/Customer_setFlagged
Set the integer flag value on a customer row for CRM visual highlighting.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Customer ID; it must convert to a positive integer. |
value | Integer string | Yes | Value 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
| Response | Condition |
|---|---|
{"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
-1and5are 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, andedited_uuid, and invalidates the customer cache. - It writes a customer audit-log entry and fires
Customer_editeven 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_getcan confirm whether the row exists and which value was stored.Customers_listcan locate the target customer before flagging it.