User clock-ins
Delete a clock-in session
/a/UserClockin_delete
Permanently remove one tenant clock-in row after recording an app-sync deletion marker.
When to use this endpoint
Use UserClockin_delete for the CRM clock-ins screen’s single-row or repeated bulk-delete workflow.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session.
The handler checks neither clock-in page permissions nor row ownership. Any authenticated caller that can reach the tenant route can delete any clock-in ID in that tenant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Existing tenant clock-in ID after integer conversion; it must be nonzero. |
Example request
$result = FM_api('UserClockin_delete', [
'id' => '481',
]);
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"} | id is absent or integer-converts to zero. Negative IDs pass this check but normally produce the not-found error. |
{"error":"user_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
- The response does not include the deleted data. Database failures from either write are not converted into an operation-specific error.
- The deletion marker’s
user_idis the affected clock-in user, not the acting CRM user.
Side effects
- First inserts a
deletesrow withtable_name="clockins", the clock-in ID, current server datetime,app_id=0, and the affected user ID. - Then permanently deletes the
user_clockinsrow and invalidates the clock-in/deletion caches. The two writes are not transactional and no generic audit event is created.
See it in Fieldmotion
CRM1
Open Users → Clock-ins and delete a row. CRM1 asks for typed confirmation before calling this route.
CRM2
Open Users → Clock-ins. Single and bulk deletion call this route once per selected row.
Related endpoints
UserClockins_getDTserves the CRM1 table.UserClockins_getDataTableserves the CRM2 table.