QHR Developers

List documents with an expiry date

GET/documents
Read token is enoughView own documents document/viewRequires feature documentAvailable in Claudedocuments.list

Returns the employees' documents that have an expiry date — iqamas, passports, licences, contracts, certificates — newest upload first, each with its expiry state (valid, expiring_soon, expired), whether HR has verified it and whose it is. Only the latest version of each document is listed, and documents with no expiry date are left out (see them per employee with folders.list).

When to use: to answer "whose documents expire this month?", "which iqamas have expired?" or "which uploads still need verifying?". Filter with q[expiry_date_gteq] / q[expiry_date_lteq] for a date range, q[expiry_date_lt] set to today for expired ones, q[verified_eq]=false for unverified ones and q[employee_name_cont] for one person. The "expiring soon" window is in document_settings.show.

Prerequisites: none. Admins see every employee's documents; anyone else sees their own and their direct reports'.

Side effects: none. Up to 50 per page.

Parameters

NameInTypeDescriptionExample
pagequeryintegerPage number, starting at 1.
min 1
1
per_pagequeryintegerRecords per page. Each list states its maximum.
min 1
20
q[employee_name_cont]querystringEmployee's name contains (in the language of Accept-Language).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. Send today's date for the expired documents.2027-02-27
q[verified_eq]querybooleantrue for verified documents only, false for the ones HR has not checked yet.false
q[s]querystringSort, <field> asc|desc, on expiry_date, title, verified, employee_name or created_at. 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 A page of documents.

FieldTypeDescription
recordsRequiredarray<object>The documents on this page.
records[].idRequiredintegerDocument id. Each version has its own id.
records[].titleRequiredstringThe document's name, e.g. "Iqama" or "Employment contract".
records[].expiry_datestring (date)When the document expires (YYYY-MM-DD); null when it does not expire.
records[].expiry_stateRequiredstringvalid, expiring_soon (within the window set in document_settings.show) or expired. A document with no expiry date is always valid.
Allowed values: valid, expiring_soon, expired
records[].verifiedRequiredbooleanHR has checked the file. Uploaded by HR: verified; uploaded by the employee to their own folder: not verified until HR marks it.
records[].reminders_enabledRequiredbooleanExpiry reminders are on. false means muted for every version of the document.
records[].version_numberRequiredinteger1 for the first upload; each renewal adds one.
records[].current_versionRequiredbooleanThis is the latest version. Older versions are kept for history only.
records[].attachable_typestringFolder when the document is filed in a folder.
records[].attachable_idintegerThe folder's id (see folders.list).
records[].employeeobjectThe employee whose folder holds the document.
records[].employee.idintegerEmployee id.
records[].employee.namestringFirst and last name.
records[].file_namestringThe uploaded file's name.
records[].file_sizeintegerFile size in bytes.
records[].content_typestringapplication/pdf, image/jpeg or image/png.
records[].file_urlstringA link to download the file. It is temporary: fetch the document again for a fresh one.
records[].created_atstringWhen this version was uploaded, in UTC (YYYY-MM-DD HH:MM:SS UTC).
records[].updated_atstringWhen this version last changed, in UTC.
paginationRequiredobject
pagination.current_pageRequiredintegerThis page's number.
pagination.per_pageRequiredintegerRecords per page.
pagination.total_entriesRequiredintegerRecords across all pages.
pagination.pagesRequiredintegerNumber of pages.

Errors

HTTPCodeMeaningHow to fix
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.
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.
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 →