Change my leave request before anyone decides it
/leave_requests/{id}leave_request/createRequires feature leave_requestAvailable in Claudeleave_requests.updateChanges the policy, the dates or the reason of one of the token owner's own requests; fields you leave out keep their value. The days are counted again and the same rules as leave_requests.create apply (balance, approved overlap, working days, last working day).
Only while nobody has decided anything on it: once a manager or HR has approved, rejected or sent it on, or a cancellation is under review, the edit is refused (422) — cancel with leave_requests.cancel and request again. A request HR or the manager filed for you (on_behalf: true) cannot be edited.
When to use: when a person wants to move or shorten leave they asked for and that is still waiting.
Prerequisites: the request's id from leave_requests.list; a new leave_policy_id from leave_requests.assigned_leave_policies.
Side effects: the reserved days follow the new count (a warning says when the count changed). The approvers are emailed again to look at the new version, and the change is written to the request's history (which fields moved) and the audit log. The request keeps its place in the approval chain.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
idRequired | path | integer | Leave request id, from leave_requests.list (your own) or team_leaves.pending_requests (your team's). | 5120 |
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 |
|---|---|---|
leave_requestRequired | object | The leave being requested. |
leave_request.leave_policy_id | integer | The leave policy (Annual, Sick…). Must be assigned to the employee and active. |
leave_request.start_date | string (date) | First day of leave (YYYY-MM-DD), in this year or the next. Not in the past unless the policy allows past dates. |
leave_request.end_date | string (date) | Last day of leave, on or after start_date, and not after the employee's last working day. |
leave_request.reason | string | Why, up to 500 characters. Optional. |
Response
200 The request after the change, with a warning when the day count moved.
| Field | Type | Description |
|---|---|---|
recordRequired | object | One leave request with its approval history. |
record.idRequired | integer | Leave request id. |
record.employee_idRequired | integer | Id of the employee taking the leave. |
record.employee_no | string | Their employee number. |
record.employee_name | string | Their full name. |
record.start_dateRequired | string (date) | First day of leave. |
record.end_dateRequired | string (date) | Last day of leave. |
record.balance | string | Working days the request charges to the leave balance, as a decimal string ("3.0"). Weekends, days off and public holidays are not counted. |
record.statusRequired | string | Request status: pending (waiting for a decision), approved, rejected, cancelled, or revoked (an approval was taken back).Allowed values: pending, approved, rejected, cancelled, revoked |
record.reason | string | The employee's reason, up to 500 characters. |
record.created_at | string | When the request was submitted, in UTC (2026-03-02 06:00:00 UTC). |
record.leave_type_name | string | Leave policy name, in the requested language. |
record.cancellation_requested_at | string | When the employee asked to cancel this leave, while that is under review. |
record.on_behalf | boolean | True when HR or the manager filed it for the employee. |
record.document_url | string | Short-lived link to the attached supporting document. Null when there is none. |
record.document_filename | string | The attached document's file name. |
record.current_stage | string | Where the request sits in the approval chain: awaiting_manager, awaiting_hr, cancellation_review (the employee asked to cancel an approved leave) or terminal (decided).Allowed values: awaiting_manager, awaiting_hr, cancellation_review, terminal |
record.current_approver_name | string | Who must decide next, when the request is waiting. |
record.compensation_type | string | How the leave is paid: fully_paid, tiered_pay (pay drops after some days) or unpaid.Allowed values: fully_paid, tiered_pay, unpaid, null |
record.compensation_type_label | string | The same, translated. |
record.actions | array<object> | The approval history, oldest first: who did what, when, with their note. |
record.actions[].action | string | What happened: submitted, updated, manager_approved, pending_hr, hr_approved, manager_rejected, hr_rejected (sent back to the manager when a manager had approved), pending_cancellation, cancelled, cancellation_rejected, withdrawn or revoked. |
record.actions[].actioned_at | string | When, in UTC (2026-03-02 08:15:00 UTC). |
record.actions[].note | string | The note written with it. |
record.actions[].actioned_by | string | Who did it (full name). |
record.revoke_type | string | How the approval was taken back: withdrawn (the manager, while HR had not decided) or revoked (a final approval, before the leave started). Null unless revoked.Allowed values: withdrawn, revoked, null |
record.revocation | object | Who took the approval back, when and why. Null unless the status is revoked. |
record.revocation.by | object | A person: id (employee id) and full_name. |
record.revocation.by.id | integer | Employee id. |
record.revocation.by.full_name | string | Full name, in the requested language when known. |
record.revocation.at | string (date-time) | When, in UTC. |
record.revocation.note | string | The reason given. |
record.approver_actions | object | What the caller may do with this request as an approver. All false on your own requests. |
record.approver_actions.can_withdraw | boolean | True when you may take back your manager approval with leave_requests.withdraw. |
record.approver_actions.can_revoke | boolean | True when you may take back the final approval with leave_requests.revoke. |
record.approver_actions.revoke_blocked_reason | string | Why revoking is blocked right now although you hold the right: payroll_locked or cancellation_pending. Null otherwise.Allowed values: payroll_locked, cancellation_pending, null |
warning | string | Present when the edit went through with something to know: the day count changed, it overlaps another pending request, or it starts next year. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_request | A parameter is missing or malformed. | Check the parameters against this operation's documentation. |
| 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 | validation_failed | Someone already decided on the request (or it was filed for you, or a cancellation is under review), or the new values break a leave rule. error says which. | Cancel it with leave_requests.cancel and request again, or fix the values. |
| 422 | employee_required | The token's owner is a company user with no employee record, so they have no leave of their own. | Ask HR to link your user to your employee record, or use a token of a user who has one. |
entitlement_blocked · 429 rate_limited · 500 internal_error