User clock-ins
Set a clock-in review flag
POST
/a/UserClockin_setFlag
Set or clear the review flag on one clock-in session.
When to use this endpoint
Use UserClockin_setFlag for the CRM1 Clock-ins flag toggle. CRM2 writes the mapped flagged field through UserClockin_updateData.
Authentication and permissions
The API call needs an authenticated tenant context, but this legacy handler does not itself call the login guard.
It performs no page-permission or row-ownership check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Existing clock-in ID after integer conversion. |
flag | Integer-like | No | Replacement flag. After integer conversion only 0 or 1 is accepted; omission and nonnumeric text become 0. |
Example request
$result = FM_api('UserClockin_setFlag', [
'id' => '481',
'flag' => '1',
]);
Example response
{
"ok": 1
}
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"} | The ID integer-converts below 1. |
{"error":"invalid parameter: flag"} | The integer-converted flag is below zero or above one. |
{"error":"clockin does not exist"} | No tenant row has that ID. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- An unchanged flag is a successful no-op. Write failure is not surfaced.
- The flag has no automatic relationship to clock-in/out differences, geolocation differences, or tenant leeway settings.
Side effects
- Updates only
flaggedand invalidates the user-clock-ins cache. It creates no generic audit event.
See it in Fieldmotion
CRM1
Click the Flag cell on Users → Clock-ins.
CRM2
No direct CRM2 caller was found; the mapped updater handles the flag toggle.
Related endpoints
UserClockins_calendarcounts flagged rows by date.UserClockins_getDTcan filter the legacy table by flag.