Get one employee's leave summary
GET
/hr_leaves/employees/{id}Read token is enoughView others' time off
time_off/view_othersRequires feature time_offAvailable in Claudehr_leaves.employeeReturns one employee's leave picture, the same row as hr_leaves.employees: headline and other balances, leave they are on today, pending requests and, when leaving, the last working day. Works for employees who have left too.
When to use: for a quick "where does Sara stand on leave?". For every policy's full figures use time_off.balances; for the requests themselves time_off.leave_requests.
Prerequisites: the employee's id from hr_leaves.employees or employees.list. Needs "View others' time off".
Side effects: none.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
idRequired | path | integer | Employee id, from hr_leaves.employees or employees.list. Leavers can be read too. | 1203 |
leave_policy_id | query | integer | Show this policy as primary_balance (null if not held). | 7 |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The employee's leave summary.
| Field | Type | Description |
|---|---|---|
recordRequired | object | One employee with their leave picture today. |
record.id | integer | Employee id. |
record.employee_no | string | Employee number. |
record.name | string | Full name. |
record.job_title | string | Job title. |
record.department | object | Department. |
record.department.id | integer | Department id. |
record.department.name | string | Department name. |
record.manager | object | Direct manager. |
record.manager.id | integer | Employee id. |
record.manager.full_name | string | Full name. |
record.employment_status | string | active, notice_period or inactive. |
record.last_working_day | string (date) | Last working day of a started offboarding; null otherwise. |
record.on_leave | object | The approved leave they are on today; null when at work. |
record.on_leave.leave_type | string | Leave policy name. |
record.on_leave.until | string (date) | Last day of that leave. |
record.pending | object | Requests waiting on a decision. |
record.pending.count | integer | How many. |
record.pending.days | string | Their days together, one decimal, as a string. |
record.primary_balance | object | The headline policy: the one asked for with leave_policy_id, else annual leave, else the first by name. Null when the employee holds none. |
record.primary_balance.leave_policy_id | integer | Leave policy id. |
record.primary_balance.name | string | Leave policy name. |
record.primary_balance.unit | string | Unit the policy counts in, e.g. days. |
record.primary_balance.unmetered | boolean | True for a per_event policy: no balance, each request justified on its own. |
record.primary_balance.available | string | Days still available this year. Days with one decimal, as a string ("12.5"); null on a per_event policy, which has no balance. |
record.primary_balance.entitled | string | Days entitled this year. Days with one decimal, as a string ("12.5"); null on a per_event policy, which has no balance. |
record.primary_balance.taken | string | Days in approved requests. Days with one decimal, as a string ("12.5"); null on a per_event policy, which has no balance. |
record.primary_balance.pending_days | string | Days held by pending requests. Days with one decimal, as a string ("12.5"); null on a per_event policy, which has no balance. |
record.other_balances | array<object> | The employee's other active policies. |
record.other_balances[].leave_policy_id | integer | Leave policy id. |
record.other_balances[].name | string | Leave policy name. |
record.other_balances[].unit | string | Unit the policy counts in, e.g. days. |
record.other_balances[].unmetered | boolean | True for a per_event policy: no balance, each request justified on its own. |
record.other_balances[].available | string | Days still available this year. Days with one decimal, as a string ("12.5"); null on a per_event policy, which has no balance. |
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. |
| 404 | not_found | The record does not exist, or you cannot see it. | Check the id. List the records first to get a valid one. |
entitlement_blocked · 429 rate_limited · 500 internal_error