QHR Developers

Download the Documents list as Excel or CSV

GET/documents/export
Needs a read & write tokenExport Employees, Documents, Leaves and Attendance lists to Excel/CSV exports/hr_dataRequires feature documentNot available in Claudedocuments.export
  • It also needs: View own documents document/view

Builds a spreadsheet of the same documents documents.list returns for the same filters — documents with an expiry date, latest version only — with the columns you pick. Choose the file type with format=xlsx (Excel) or format=csv.

When to use: to hand HR or a government-relations officer a file of expiring or expired documents. For questions about a few documents, documents.list is lighter.

Prerequisites: at least one column key from documents.export_columns in columns[]. Needs the HR data export permission as well as viewing documents. You only get the employees you can see.

Side effects: each attempt is recorded in your exports history and the audit log. Up to 10,000 documents the file comes straight back; above that the answer is 202 and the file is built in the background and emailed to you when ready. At most 20,000 rows, and one Documents export at a time per person. 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

NameInTypeDescriptionExample
formatRequiredquerystringFile format: xlsx (Excel) or csv.
Allowed values: xlsx, csv
xlsx
columns[]Requiredqueryarray<string>Column keys from documents.export_columns, in the order you want them. Repeat the parameter for each column.employee_name,title,expiry_date,expiry_state
q[employee_name_cont]querystringEmployee's name contains.Layla
q[expiry_date_gteq]querystring (date)Expires on or after this date.2027-03-01
q[expiry_date_lteq]querystring (date)Expires on or before this date.2027-03-31
q[expiry_date_gt]querystring (date)Expires after this date.2027-03-01
q[expiry_date_lt]querystring (date)Expires before this date (today's date: the expired ones).2027-02-27
q[verified_eq]querybooleanVerified (true) or not yet verified (false) only.false
q[s]querystringRow order, <field> asc|desc (as in documents.list). Newest upload first when omitted.expiry_date asc
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 The file (`xlsx` or `csv`, as asked with `format`).

Returns a file, not JSON: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Errors

HTTPCodeMeaningHow to fix
400bad_formatformat is missing or is not xlsx or csv.Send format=xlsx or format=csv.
400no_columnsNo columns[] was sent.Send at least one key from documents.export_columns.
400unknown_columnA column key is not one of documents.export_columns.Use only the keys documents.export_columns returns.
400bad_filtersA filter value (q[...]) cannot be read.Send dates as YYYY-MM-DD and sorts as <field> asc|desc.
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_progressYour previous Documents export is still being built; export describes it.Wait for its email, then export again.
422no_dataNo document matches the filters.Widen or remove the filters.
422too_largeMore than 20,000 rows; row_count and max_rows give the numbers.Narrow the filters, e.g. a shorter expiry 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 →