Get punctuality and punch-source insights
/hr_attendance_log/summaryattendance/view_reportsRequires feature attendanceAvailable in Claudeattendance_log.summaryOver the log rows matching every filter (status included): how many completed days started on time and the on-time rate, the median check-in time (HH:MM in the company's timezone), and how people punched (mobile app, web, device, manual entry, automatic close).
Completed days are those with status present, early leave or late; days still open or missing a check-out are left out so today does not read 100%. On time = no counted late arrival (pending or deducted; one HR excused is on time). Sources count punches, not days: a check-in and a check-out are two. Weekends and holidays are not rows.
When to use: "what share of check-ins were on time in July?", "when do people usually arrive?", "how many still punch on the web?".
Prerequisites: none. department_id and location ids from employees.meta_data.
Side effects: none.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
from | query | string (date) | First day of the period, YYYY-MM-DD, included. A calendar date in the company's timezone (the timezone set on the company, e.g. Asia/Riyadh), not UTC. Defaults to the first day of the current month in that timezone. from to to may span at most 366 days. | 2026-07-01 |
to | query | string (date) | Last day of the period, YYYY-MM-DD, included, in the company's timezone. Defaults to the last day of the current month (a future date for most of the month; future days hold no attendance yet, so they change no number). Must be on or after from. | 2026-07-31 |
department_id | query | integer | Only employees of this department (id from employees.meta_data, departments). An id that does not exist answers 422. | 4 |
search | query | string | Name or employee number contains this text, case-insensitive. The name matched is the full name in the request's language (Accept-Language): the English name for en, the Arabic name for ar. | Sara |
status | query | string | Only rows with this day status: present (on time, full day), late (a counted late arrival), early_leave (left early, not late), working (checked in, day still open), missing_check_out (checked in, the day is over and no check-out), absent or on_leave.Allowed values: present, late, early_leave, working, missing_check_out, absent, on_leave | late |
source | query | string | Only rows where the check-in or the check-out came from: mobile (QHR mobile app), web (QHR in a browser), app (QHR app, client not recorded), device (attendance device), manual (entered or adjusted by HR/manager) or system (closed automatically).Allowed values: mobile, web, app, device, manual, system | mobile |
location | query | string | Only rows punched at this place: a location id (from employees.meta_data, locations) matched on either side, or remote for a check-in or check-out marked remote. | remote |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The insights.
| Field | Type | Description |
|---|---|---|
punctuality | object | How many completed days started on time. |
punctuality.completed_check_ins | integer | Completed days: status present, early_leave or late (open days and missing check-outs are left out). |
punctuality.on_time | integer | Completed days without a counted late arrival. |
punctuality.on_time_rate | number | on_time ÷ completed_check_ins × 100, one decimal; null with no completed day. |
punctuality.median_check_in | string | Median check-in time of day, HH:MM in the company's timezone; null with no check-in. |
sources | object | How people punched. Counts punches, not days: a day with a check-in and a check-out counts twice. |
sources.total | integer | All punches. |
sources.items | array<object> | Each source that has punches, most used first. |
sources.items[].source | string | mobile, web, app, device, manual or system. |
sources.items[].count | integer | Punches from it. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 401 | token_missing | No Authorization: Bearer … header, or it is malformed. | Send Authorization: Bearer qhr_… with the full token. |
| 401 | token_invalid | The 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. |
| 401 | token_expired | The token is past its expiry date. | Create a new token. |
| 401 | token_revoked | The 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. |
| 401 | tenant_inactive | The company account is suspended. | Contact QHR support. |
| 403 | forbidden | The token owner's role lacks the permission this operation needs. | Ask an admin to grant the permission shown on this operation (x-permission). |
| 403 | employee_inactive | The token owner's employee record is not active. | HR must reactivate the employee record. |
| 403 | tenant_access_revoked | The 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. |
| 422 | validation_failed | A filter is not valid: a date not in YYYY-MM-DD, from after to, a period longer than 366 days, a department_id that does not exist, or a status, source or location outside its list. error says which. | Fix the parameter named in error and send again. |
entitlement_blocked · 429 rate_limited · 500 internal_error