QHR Developers

Check in for today

POST/attendances/check_in
Needs a read & write tokenCheck in/out and view own attendance history attendance/view_ownRequires feature attendanceAvailable in Claudeattendances.check_in

Records the token owner's arrival now, exactly like the Check in button of the QHR app. The day is the work date in the company's timezone (a check-in shortly after midnight on a night shift belongs to the shift that started the evening before). QHR compares the time with the employee's schedule: after the shift start plus the grace period the day is late, and a late-arrival deduction is opened for review.

When to use: when the person says they have arrived and wants to check in. Check first with attendances.check_in_status. To record someone else's day, a manager uses attendances.adjust.

Prerequisites: a token created by a user linked to an employee record. If geo_fencing in attendances.check_in_status requires coordinates, send latitude and longitude; a check-in from outside every allowed location or network is refused. The coordinates are the ones the client reports, so a token check-in is only as trustworthy as the system holding the token. The punch channel shown in the attendance log is set by the server for API calls.

Side effects: creates or updates today's attendance record with source app. A late arrival opens a time incident that the manager or HR decides on (time_incidents.list) and may become a payroll deduction. On a profile that tracks breaks, it starts the tracked day.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Request body

application/json

FieldTypeDescription
latitudenumberThe person's latitude, when their location fences check-in (geo_fencing.requires_coordinates).
longitudenumberThe person's longitude, with latitude.

Response

201 Today's attendance record.

FieldTypeDescription
idRequiredintegerAttendance record id.
dateRequiredstring (date)Work date, in the company's timezone. A night shift belongs to the date it started.
statusRequiredstringpresent, late (arrived after the start plus the grace period), incomplete (checked in, not out), absent, on_leave, holiday or weekend. An early leave stays present; it shows in incidents.
Allowed values: present, late, incomplete, absent, on_leave, holiday, weekend
check_in_atstring (date-time)Check-in time, UTC.
check_out_atstring (date-time)Check-out time, UTC.
hours_workednumberHours worked, net of breaks on a day that tracks breaks; null until the day is closed.
check_in_sourcestringHow that side was recorded: app (the QHR app or this API), device (a fingerprint or face device), manual (corrected by a manager or HR); null when there is no time.
Allowed values: app, device, manual, null
check_out_sourcestringHow that side was recorded: app (the QHR app or this API), device (a fingerprint or face device), manual (corrected by a manager or HR); null when there is no time.
Allowed values: app, device, manual, null
check_in_deviceobjectThe device scan behind that side, when it came from a device.
check_in_device.namestringDevice name.
check_in_device.external_employee_nostringThe employee's number on the device.
check_out_deviceobjectThe device scan behind that side, when it came from a device.
check_out_device.namestringDevice name.
check_out_device.external_employee_nostringThe employee's number on the device.
incidentsarray<object>Deductions this day produced (late arrival, early leave…), and whether the employee has explained each. Details with attendances.justification_context.
incidents[].idintegerTime incident id.
incidents[].kindstringabsence, late, early_leave, short_hours or incomplete.
incidents[].statusstringpending (under review), deducted or ignored.
incidents[].justification_statestringsubmitted or none.
permissionsarray<object>Approved and pending hourly permissions on this day (history only).
permissions[].idintegerPermission request id.
permissions[].kindstringPermission kind, e.g. late_arrival, early_leave.
permissions[].statusstringapproved or pending.
permissions[].start_timestringStart, HH:MM local.
permissions[].end_timestringEnd, HH:MM local.
tracks_breaksbooleanTrue when this day records breaks (pause / resume).
day_statestringOn a day that tracks breaks: working, paused or ended; null otherwise.
ended_bystringWho ended a tracked day: employee (from the app or a device) or system (closed automatically).
break_minutesintegerMinutes on break.
breaksarray<object>The day's breaks; empty when breaks are not tracked.
breaks[].started_atstring (date-time)Break start, UTC.
breaks[].ended_atstring (date-time)Break end, UTC; null while the break is running.
breaks[].started_viastringapp or device.
breaks[].ended_viastringapp or device.
breaks[].started_device_namestringDevice that started the break.
breaks[].ended_device_namestringDevice that ended the break.

Errors

HTTPCodeMeaningHow to fix
401token_missingNo Authorization: Bearer … header, or it is malformed.Send Authorization: Bearer qhr_… with the full token.
401token_invalidThe token is unknown or wrong, or its owner's account is locked.Check the token was copied in full, or create a new one in QHR › Settings › API & Integrations.
401token_expiredThe token is past its expiry date.Create a new token.
401token_revokedThe token was revoked by its owner or an admin, or the owner was removed from the company (which revokes all their tokens).Create a new token, or ask your admin. If the owner was removed, they must be re-invited to the company first.
401tenant_inactiveThe company account is suspended.Contact QHR support.
403token_read_onlyThis token can only read; the operation makes changes.Use a token created with "Allow changes".
403forbiddenThe token owner's role lacks the permission this operation needs.Ask an admin to grant the permission shown on this operation (x-permission).
403employee_inactiveThe token owner's employee record is not active.HR must reactivate the employee record.
403tenant_access_revokedThe token's owner is no longer an active member of this company. Rare: removing a member normally revokes their tokens, which answers 401 token_revoked instead.The owner must be re-invited to the company, then create a new token. If the owner is still a member, contact QHR support.
409conflictA device was saving scans for the same day at that moment, so the action was not recorded.Wait a few seconds and send the same request again.
422validation_failedRefused: already checked in today, a previous shift is still open, outside every allowed location or network (error says how far), the day is closed for payroll, or HR corrected the day.Read error, then check the day with attendances.check_in_status before trying again.
422employee_requiredThe token's owner is a company user with no employee record, so they have no attendance.Use a token created by a user who is linked to an employee, or ask HR to link this user to their employee record.
This endpoint can also return the errors that can happen on any endpoint →402 / 412 / 425 entitlement_blocked · 429 rate_limited · 500 internal_error

See the full error catalogue →