Export the company's leave requests to Excel or CSV
/hr_leaves/exportexports/hr_dataRequires feature time_offNot available in Claudehr_leaves.export- It also needs: View others' time off
time_off/view_others
Builds a file of the leave requests hr_leaves.requests would list for the same filters (the waiting queue by default), with the columns you choose: Excel with format=xlsx, CSV with format=csv. Up to 10,000 rows the file comes back at once; above that it is built in the background and the answer is 202 with the export record (its download_url is set once the file is ready); above 20,000 it is refused.
When to use: when someone wants the list as a file. To answer a question, read hr_leaves.requests instead.
Prerequisites: column keys from hr_leaves.export_columns. Needs "Export HR data" and "View others' time off".
Side effects: every attempt past the parameter checks is recorded as an export of the token's owner and in the audit log. One export of this list per person runs at a time.
Not offered to Claude: it returns a file, not JSON, and copies the company's leave data out of QHR.
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 | File type: xlsx (Excel) or csv. Without it the answer is 400 bad_format.Allowed values: xlsx, csv | xlsx |
columns[]Required | query | array<string> | Column keys from hr_leaves.export_columns, in the order wanted; repeat the parameter per column. | employee_name,start_date,end_date,status |
stage | query | string | As in hr_leaves.requests.Allowed values: hr, manager | hr |
q[status_eq] | query | string | Only this status, as in hr_leaves.requests.Allowed values: pending, approved, rejected, cancelled, revoked | approved |
q[start_date_gteq] | query | string (date) | Leave starting on or after this date. | 2026-01-01 |
q[start_date_lteq] | query | string (date) | Leave starting on or before this date. | 2026-12-31 |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The file: Excel for `format=xlsx`, CSV (`text/csv`) for `format=csv`.
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 not xlsx / csv. | Send format=xlsx or format=csv. |
| 400 | no_columns | No columns[] sent. | Send column keys from hr_leaves.export_columns. |
| 400 | unknown_column | A column key is not offered to you on this list. | Use only keys from hr_leaves.export_columns. |
| 400 | bad_filters | A filter is malformed. | Check the filters against hr_leaves.requests. |
| 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 | The token's owner already has an export of this list being built; export describes it. | Wait for that export to finish, then try again. |
| 422 | no_data | No request 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