Check a day before asking for a permission
/permission_requests/day_contextattendance/view_ownRequires feature attendanceAvailable in Claudepermission_requests.day_contextDescribes one date for the token owner before they ask for an hourly leave of absence on it: whether their attendance profile allows permission requests (enabled), whether it is a working day, the shift (shift_start / shift_end in the profile's timezone, and the same as UTC instants), the required minutes, the grace period, the approval route a new request would follow (manager, hr or manager_and_hr), and the owner's pending or approved requests already on that day (existing).
When to use: before permission_requests.create, to choose a window inside the shift that does not overlap existing. A window that starts at the shift start is a late arrival, one that ends at the shift end is an early leave. Display only: create checks every rule again.
Prerequisites: a token created by a user who is linked to an employee record.
Side effects: none.
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
dateRequired | query | string (date) | The date to describe, YYYY-MM-DD. | 2026-11-30 |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The day, as the request form needs it.
| Field | Type | Description |
|---|---|---|
date | string (date) | The date. |
enabled | boolean | The profile allows permission requests on that date. |
working_day | boolean | It is a working day for the owner. |
day_type | string | working_day, weekend, holiday, leave… |
flexible | boolean | A flexible day: no fixed hours, only required minutes. |
shift_start | string | Shift start, HH:MM. |
shift_end | string | Shift end, HH:MM. |
shift_starts_at | string | Shift start, in UTC. |
shift_ends_at | string | Shift end, in UTC. |
required_minutes | integer | Minutes the owner must work that day. |
grace_period_minutes | integer | Grace minutes before a late arrival counts; 0 when off. |
approval_route | string | Who would approve a new request: manager, hr or manager_and_hr. |
profile_name | string | Attendance profile name. |
existing | array<object> | The owner's pending and approved requests that day. |
existing[].id | integer | Request id. |
existing[].kind | string | Kind. |
existing[].status | string | Status. |
existing[].start_time | string | Start, HH:MM. |
existing[].end_time | string | End, HH:MM. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_request | A parameter is missing or malformed. | Check the parameters against this operation's documentation. |
| 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 | invalid_date | date is not a real date. | Send the date as YYYY-MM-DD. |
| 422 | employee_required | The token's owner is a company user with no employee record, so they have no permission requests. | Use a token created by a user who is linked to an employee, or ask HR to link this user to their employee record. |
entitlement_blocked · 429 rate_limited · 500 internal_error