QHR Developers

Export the company's leave requests to Excel or CSV

GET/hr_leaves/export
Needs a read & write tokenExport Employees, Documents, Leaves and Attendance lists to Excel/CSV exports/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

NameInTypeDescriptionExample
formatRequiredquerystringFile type: xlsx (Excel) or csv. Without it the answer is 400 bad_format.
Allowed values: xlsx, csv
xlsx
columns[]Requiredqueryarray<string>Column keys from hr_leaves.export_columns, in the order wanted; repeat the parameter per column.employee_name,start_date,end_date,status
stagequerystringAs in hr_leaves.requests.
Allowed values: hr, manager
hr
q[status_eq]querystringOnly this status, as in hr_leaves.requests.
Allowed values: pending, approved, rejected, cancelled, revoked
approved
q[start_date_gteq]querystring (date)Leave starting on or after this date.2026-01-01
q[start_date_lteq]querystring (date)Leave starting on or before this date.2026-12-31
Accept-LanguageheaderstringLanguage 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

HTTPCodeMeaningHow to fix
400bad_formatformat is missing or not xlsx / csv.Send format=xlsx or format=csv.
400no_columnsNo columns[] sent.Send column keys from hr_leaves.export_columns.
400unknown_columnA column key is not offered to you on this list.Use only keys from hr_leaves.export_columns.
400bad_filtersA filter is malformed.Check the filters against hr_leaves.requests.
401token_missingNo Authorization: Bearer … header, or it is malformed.Send Authorization: Bearer qhr_… with the full token.
401token_invalidThe 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.
401token_expiredThe token is past its expiry date.Create a new token.
401token_revokedThe 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.
401tenant_inactiveThe company account is suspended.Contact QHR support.
403token_read_onlyThis token can only read; the operation makes changes.Use a token created with "Allow changes".
403forbiddenThe token owner's role lacks the permission this operation needs.Ask an admin to grant the permission shown on this operation (x-permission).
403employee_inactiveThe token owner's employee record is not active.HR must reactivate the employee record.
403tenant_access_revokedThe 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.
409export_in_progressThe token's owner already has an export of this list being built; export describes it.Wait for that export to finish, then try again.
422no_dataNo request matches the filters.Widen the filters.
422too_largeMore than 20,000 rows would be written; row_count and max_rows say how many.Narrow the filters or the date range.
This endpoint can also return the errors that can happen on any endpoint →402 / 412 / 425 entitlement_blocked · 429 rate_limited · 500 internal_error

See the full error catalogue →