# Leaves

Manage leave requests, balances, and policies

## Get All Leaves

 - [GET /leaves](https://api-docs.webwork-tracker.com/api/leaves/getleaves.md): Retrieve all leave requests for a specific workspace. Requires workspace_id as query parameter.

## Request Leave

 - [POST /leaves](https://api-docs.webwork-tracker.com/api/leaves/createleaverequest.md)

## Get Leave Balances

 - [GET /leaves/balances](https://api-docs.webwork-tracker.com/api/leaves/getleavebalances.md)

## Get Leave Policies

 - [GET /leaves/policies](https://api-docs.webwork-tracker.com/api/leaves/getleavepolicies.md)

## Approve Leave Request

 - [PUT /leaves/{leaveRequestId}/approve](https://api-docs.webwork-tracker.com/api/leaves/approveleaverequest.md): Approve a pending leave request.

Multi-level workspaces: approval is sequential and role-gated, exactly like the web app. A request must be approved level by level (level 1, then level 2, …); each call approves the current pending level, and the request stays pending until the final level approves. You may only approve a level whose configured roles include your own role — approving a level you are not eligible for returns 403. (Levels assigned to roles you do not hold must be approved by those role-holders in the web/app.) The per-level progress is visible in the approval_steps array on the Get Leaves response.

Single-level workspaces: behaves as before — one call fully approves the request.

## Reject Leave Request

 - [PUT /leaves/{leaveRequestId}/reject](https://api-docs.webwork-tracker.com/api/leaves/rejectleaverequest.md): Reject a pending leave request. A reason is required.

Multi-level workspaces: rejection is role-gated like approval — you may only reject the current pending level, and only if its configured roles include your own role (otherwise 403). Rejecting any level rejects the whole request; approvers who already signed off earlier levels are notified.

Single-level workspaces: behaves as before.

