User clock-ins
Set general clock-in notes
POST
/a/UserClockin_setNotes
Replace the general notes value for one clock-in session.
When to use this endpoint
Use UserClockin_setNotes for the CRM1 Clock-ins Notes dialog. The normal value is a JSON note array.
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. |
notes | JSON text | No | Complete replacement for the JSON column; omission becomes an empty string. The handler does not validate JSON before attempting the write. |
Example request
$result = FM_api('UserClockin_setNotes', [
'id' => '481',
'notes' => json_encode([[
'content' => 'Approved by supervisor',
'noteTime' => 1790445600000,
'createdby' => 18,
]]),
]);
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":"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 stored string is a successful no-op. Notes are replaced rather than merged.
- General notes are used as the fallback adjustment reason when a changed start/end has no usable dedicated note.
Side effects
- Attempts to update only
notesand invalidates the user-clock-ins cache. It creates no generic audit history.
See it in Fieldmotion
CRM1
Open the Notes cell on Users → Clock-ins and edit the note list.
CRM2
No direct CRM2 caller was found; CRM2 uses UserClockin_updateData.
Related endpoints
UserClockin_setClockinNotesandUserClockin_setClockoutNotesstore adjustment-specific notes.UserClockins_getExportDataderives adjustment-reason text.