Download my leave requests as a spreadsheet
/leave_requests/exportexports/hr_dataRequires feature leave_requestNot available in Claudeleave_requests.export- It also needs: View own leave history
leave_request/view
Builds an Excel (format=xlsx) or CSV (format=csv) file of the rows leave_requests.list shows for the same filters (the current month when q[from] / q[to] are omitted), with the columns you choose, headed in the requested language. format is required: without it the answer is 400 bad_format.
Up to 10,000 rows the file comes back at once (200). Above that it is built in the background and the answer is 202 with the export record (export); the file is then collected from QHR › Exports. Above 20,000 rows the export is refused (422 too_large).
When to use: to hand a person or another system a file of leave requests. To read the requests, use leave_requests.list.
Prerequisites: columns[] from leave_requests.export_columns. employee_id exports another employee's requests and needs "View others' leave requests".
Side effects: each attempt is recorded in the company's export history and the audit log; a background export emails its owner when the file is ready. One export of this page per user runs at a time (409 export_in_progress). Not offered to Claude: it returns a file, not JSON.
Not available in Claude: it returns a file, not JSON.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
formatRequired | query | string | The file type: xlsx (Excel) or csv.Allowed values: xlsx, csv | xlsx |
columns[]Required | query | array<string> | The columns, in order (key from leave_requests.export_columns). | leave_type_name,start_date,end_date,balance,status |
q[from] | query | string (date) | Window start, as in leave_requests.list. | 2026-03-01 |
q[to] | query | string (date) | Window end, as in leave_requests.list. | 2026-03-31 |
q[status_eq] | query | string | Only this status. Allowed values: pending, approved, rejected, cancelled, revoked | approved |
employee_id | query | integer | Another employee's requests. Needs "View others' leave requests". | 1203 |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The file (Excel or CSV, as asked).
Returns a file, not JSON: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_format | format is missing or is not xlsx or csv. | Send format=xlsx or format=csv. |
| 400 | no_columns | No column was sent in columns[]. | Send at least one key from the export's columns operation. |
| 400 | unknown_column | A column in columns[] does not exist on this export, or you may not see it. | Send only key values from the export's columns operation. |
| 400 | bad_request | A date filter is not a valid date. | Send dates as YYYY-MM-DD. |
| 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 | token_read_only | This token can only read; the operation makes changes. | Use a token created with "Allow changes". |
| 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. |
| 409 | export_in_progress | You already have an export of this page running; export describes it. | Wait for it to finish (QHR › Exports), then export again. |
| 422 | no_data | No row matches the filters. | Widen the filters. |
| 422 | too_large | More than 20,000 rows would be written; row_count and max_rows say how many. | Narrow the filters or the date range. |
entitlement_blocked · 429 rate_limited · 500 internal_error