User clock-ins
List clock-in IDs and times
/a/UserClockins_list
Return clock-in IDs and optional start/end epochs for lightweight tenant/user/date/open-session lookups.
When to use this endpoint
Use UserClockins_list for quick clock-in/out controls or another small lookup that needs only IDs and raw epochs.
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 |
|---|---|---|---|
fields | Native array or JSON array text | No | Optional requested names. Only clockin and clockout are accepted; id is always returned and unknown names are ignored. |
user_id | Integer string | No | Exact user filter when nonzero. Omission does not default to the signed-in user. |
date | YYYY-MM-DD-looking string | No | Exact stored-date filter when it matches the numeric pattern. Calendar validity is not checked; invalid/malformed values are silently ignored. |
open_only | Integer-like | No | Exact integer 1 requires a positive start and null/zero end, and enables newest-first ordering. |
Example request
$open = FM_api('UserClockins_list', [
'user_id' => '18',
'open_only' => '1',
'fields' => ['clockin', 'clockout'],
]);
Example response
[
{"id":"481","clockin":"1790413200","clockout":null}
]
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. |
No operation-specific error | Valid calls return an array, including [] when no rows match. |
Runtime/database error | A malformed decoded fields value or query failure is not translated into a stable endpoint error. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Open rows are ordered by clock-in descending and then ID descending, which lets callers choose the newest session even when it began on an earlier date.
- Without
open_only=1there is no explicit ordering. Returned database values are strings/null rather than normalized integers. - There is no pagination, permission/department filter, deleted state, or join to verify the user record.
See it in Fieldmotion
CRM1
Header and clock-in/clock-out widgets request the signed-in user’s open sessions.
CRM2
The quick-clock menu uses the same lookup. The mobile app itself synchronizes clock-ins through the mobile gateway rather than this route.
Related endpoints
UserClockin_newstarts a session.UserClockin_setClockoutTimeends the selected open session.