When to use this endpoint

Use UserClockin_setClockinDiff for the CRM1 Clock-ins detail editor. New integrations should normally use 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, user-ownership, or actor check; any reachable row in the current tenant can be changed.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesExisting clock-in ID; must integer-convert above zero.
diffInteger secondsNoReplacement signed offset in seconds. Omission and nonnumeric text become 0; negative values are allowed.

Example request

$result = FM_api('UserClockin_setClockinDiff', [
	'id' => '481',
	'diff' => '1800',
]);

Example response

{
  "ok": 1
}

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.
{"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 value is a successful no-op. Write failures are not surfaced and the endpoint still returns {"ok":1}.
  • The CRM1 editor displays this value as minutes but sends seconds. The export endpoint formats positive offsets while raw exports preserve seconds.

Side effects

  • Updates only clockin_diff and invalidates the user-clock-ins cache. It does not modify the clock-in time, duration, creation time, flag, or audit history.

See it in Fieldmotion

CRM1

Open a Clock-ins row’s Clock-in detail and change Lateness; the UI multiplies minutes by 60.

CRM2

No direct CRM2 caller was found; CRM2 uses the mapped update route.

Related endpoints