QHR Developers

List the leave requests waiting on my team

GET/team_leaves/pending_requests
Read token is enoughView others' leave requests leave_request/view_othersRequires feature leave_requestAvailable in Claudeteam_leaves.pending_requests

Returns every leave request waiting for a decision that concerns the token owner as a manager: the pending requests and cancellation requests of their direct reports, plus any request escalated to them because the employee's own manager is on leave today. Newest submitted first. can_act says whether the owner can decide it now (false when it waits for HR or another manager). Not paginated: the whole list comes back.

When to use: for "what do I need to approve?" and to get the id for leave_requests.approve, leave_requests.reject, leave_requests.approve_cancellation or leave_requests.withdraw. scope=mine keeps only those the owner can decide. Totals alone come from team_leaves.stat_cards.

Prerequisites: none — the manager is the token's owner. Empty when they have no team.

Side effects: none.

Parameters

NameInTypeDescriptionExample
scopequerystringall (every waiting request) or mine (only those you can decide now).
Allowed values: all, mine
mine
sortquerystringNewest (submission_date_desc) or oldest (submission_date_asc) submitted first.
Allowed values: submission_date_desc, submission_date_asc
submission_date_asc
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 The waiting requests.

FieldTypeDescription
recordsRequiredarray<object>Every waiting request (not paginated).
records[].idintegerLeave request id, for leave_requests.show, leave_requests.approve and leave_requests.reject.
records[].employee_idintegerId of the employee taking the leave.
records[].employee_nostringTheir employee number.
records[].employee_namestringTheir full name, in the requested language.
records[].employee_imagestringReserved; always null for now.
records[].start_datestring (date)First day of leave.
records[].end_datestring (date)Last day of leave.
records[].balancestringWorking days the request charges, as a decimal string.
records[].leave_type_namestringLeave category name (Annual, Sick…).
records[].compensation_typestringfully_paid, tiered_pay or unpaid.
records[].compensation_type_labelstringThe same, translated.
records[].submission_datestring (date-time)When it was submitted, in UTC.
records[].current_stagestringawaiting_manager, awaiting_hr or cancellation_review (the employee asked to cancel an approved leave).
records[].can_actbooleanTrue when you can decide it now. False when it waits for HR, or for another manager.
records[].approver_actionsobjectWhat the caller may do with this request as an approver. All false on your own requests.
records[].approver_actions.can_withdrawbooleanTrue when you may take back your manager approval with leave_requests.withdraw.
records[].approver_actions.can_revokebooleanTrue when you may take back the final approval with leave_requests.revoke.
records[].approver_actions.revoke_blocked_reasonstringWhy revoking is blocked right now although you hold the right: payroll_locked or cancellation_pending. Null otherwise.
Allowed values: payroll_locked, cancellation_pending, null

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 →