Withdraw my approval of a permission waiting for HR
/permission_requests/{id}/withdrawattendance/view_teamRequires feature attendanceAvailable in Claudepermission_requests.withdrawLets the manager take back their approval of a permission request (hourly leave of absence) on the manager_and_hr route while it still waits for HR (pending_hr). The request ends as revoked with revoke_type: withdrawn, leaves HR's queue and stays in HR's history; the employee may file a new one. A note is required. Only the employee's current manager who approved it may withdraw.
When to use: when the manager changed their mind before HR decided. For a request already finally approved, use permission_requests.revoke.
Prerequisites: the request id from permission_requests.team_decided where actions.can_withdraw is true.
Side effects: the employee is notified (in-app and email). Attendance is not touched, since the request was never approved, so a closed payroll does not block it. Recorded in the audit log.
Before you call this
You will need ids that come from these operations:
permission_requests.team_decided— List team permissions I can still take backactions.can_withdraw
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
idRequired | path | integer | Permission request id, from permission_requests.list, permission_requests.team_pending, permission_requests.team_decided or permission_requests.hr_list. | 4812 |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Request body
application/json
| Field | Type | Description |
|---|---|---|
noteRequired | string | Why, up to 500 characters. Required. |
Response
200 The withdrawn request.
| Field | Type | Description |
|---|---|---|
recordRequired | object | A permission request: an hourly leave of absence on one working day. |
record.idRequired | integer | Permission request id. |
record.reference | string | Reference shown to people, PRM-<id>. |
record.employee_idRequired | integer | The employee who asked. |
record.employee_no | string | Their employee number. |
record.employee_name | string | Their full name. |
record.dateRequired | string (date) | The working day the permission is for. |
record.start_timeRequired | string | Start, wall-clock time HH:MM in the attendance profile's timezone. |
record.end_timeRequired | string | End, wall-clock time HH:MM in the attendance profile's timezone. |
record.starts_at | string (date-time) | Absolute start, in UTC. For an overnight shift it may fall on the next calendar day. |
record.ends_at | string (date-time) | Absolute end, in UTC. |
record.minutes | integer | Length in minutes. |
record.hours | number | Length in hours, two decimals. |
record.kind | string | What the window is, worked out by QHR from the shift: late_arrival (starts when the shift starts), early_leave (ends when the shift ends), mid_shift (inside the shift) or flexible (a day with no fixed hours).Allowed values: late_arrival, early_leave, mid_shift, flexible |
record.note | string | The employee's reason (up to 500 characters). |
record.statusRequired | string | pending_manager (waiting for the employee's manager), pending_hr (waiting for HR), approved, rejected, cancelled (by the employee) or revoked (an approval taken back).Allowed values: pending_manager, pending_hr, approved, rejected, cancelled, revoked |
record.approval_route | string | Who approves, fixed when the request was filed from the attendance profile: manager, hr, or manager_and_hr (the manager first, then HR).Allowed values: manager, hr, manager_and_hr |
record.revoke_type | string | For a revoked request: withdrawn (the manager took back their approval before HR decided) or revoked (a final approval taken back). Null otherwise. |
record.current_approver_name | string | Who must decide now: the manager's name, or "HR". Null once decided. |
record.attachment | object | Supporting file, if one was added in the QHR app: filename, content_type, byte_size and a temporary download url. |
record.actions | object | What the token owner may do with this request now. blocked_reason explains why approve is off for an approver: payroll_locked or incident_decided. |
record.actions.can_edit | boolean | May edit it (permission_requests.update). |
record.actions.can_cancel | boolean | May cancel it (permission_requests.cancel). |
record.actions.can_approve | boolean | May approve it (permission_requests.approve). |
record.actions.can_reject | boolean | May reject it (permission_requests.reject). |
record.actions.can_withdraw | boolean | May withdraw their approval (permission_requests.withdraw). |
record.actions.can_revoke | boolean | May revoke the approval (permission_requests.revoke). |
record.actions.blocked_reason | string | Why approving is blocked, or null. |
record.manager | object | The manager's decision, once they acted. |
record.manager.id | integer | Employee id of the person who acted. |
record.manager.name | string | Their full name. |
record.manager.acted_at | string (date-time) | When, in UTC. |
record.manager.note | string | The note they left. |
record.hr | object | HR's decision, once HR acted. |
record.hr.id | integer | Employee id of the person who acted. |
record.hr.name | string | Their full name. |
record.hr.acted_at | string (date-time) | When, in UTC. |
record.hr.note | string | The note they left. |
record.revoked | object | Who withdrew or revoked the approval, and why. |
record.revoked.id | integer | Employee id of the person who acted. |
record.revoked.name | string | Their full name. |
record.revoked.acted_at | string (date-time) | When, in UTC. |
record.revoked.note | string | The note they left. |
record.cancelled_at | string (date-time) | When the employee cancelled it, in UTC. |
record.created_at | string (date-time) | When it was filed, in UTC. |
record.attendance_profile | object | Only on permission_requests.show: the employee's shift that day (shift_start, shift_end, day_type, flexible, scheduled_hours, grace_period_minutes). |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 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. |
| 404 | not_found | The record does not exist, or you cannot see it. | Check the id. List the records first to get a valid one. |
| 422 | note_required | A note is required for this action. | Read error. Reload the request with permission_requests.show and act only where actions allows it. |
| 422 | own_request | Nobody decides their own request. | Read error. Reload the request with permission_requests.show and act only where actions allows it. |
| 422 | not_withdrawable | Only the manager who approved it can withdraw, while it waits for HR on the manager_and_hr route. | Read error. Reload the request with permission_requests.show and act only where actions allows it. |
| 422 | employee_required | The token's owner is a company user with no employee record, so they cannot act as a manager or HR approver. | Use a token created by a user who is linked to an employee, or ask HR to link this user to their employee record. |
entitlement_blocked · 429 rate_limited · 500 internal_error