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

ParameterTypeRequiredDescription
fieldsNative array or JSON array textNoOptional requested names. Only clockin and clockout are accepted; id is always returned and unknown names are ignored.
user_idInteger stringNoExact user filter when nonzero. Omission does not default to the signed-in user.
dateYYYY-MM-DD-looking stringNoExact stored-date filter when it matches the numeric pattern. Calendar validity is not checked; invalid/malformed values are silently ignored.
open_onlyInteger-likeNoExact 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

ResponseCondition
{"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 errorValid calls return an array, including [] when no rows match.
Runtime/database errorA 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=1 there 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