# Get All Leave Requests Retrieve all leave requests in your workspace. Supports filtering by ID, policy_id, is_paid, status, date range, and user_id. Results are paginated. Endpoint: GET /leaves Version: 2.0.0 Security: oauth2, apiKey ## Query parameters: - `workspace_id` (integer, required) ID of the workspace Example: 1 - `id` (string) UUID of the leave request Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - `policy_id` (integer) Filter by leave policy ID Example: 5 - `is_paid` (string) Filter by paid/unpaid status Enum: "yes", "no" - `status` (string) Filter by leave request status Enum: "pending", "approved", "rejected" - `date_from` (string) Filter leave requests from this date (YYYY-MM-DD) Example: "2024-01-01" - `date_to` (string) Filter leave requests to this date (YYYY-MM-DD) Example: "2024-01-31" - `user_id` (integer) Filter by user ID Example: 100 - `page` (integer) Page number for pagination Example: 1 - `per_page` (integer) Number of items per page (max 100) Example: 20 ## Response 200 fields (application/json): - `success` (boolean) Example: true - `data` (array) - `data.id` (string, required) UUID of the leave request Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - `data.user_id` (integer,null) ID of the user who requested the leave Example: 100 - `data.status` (string) Status of the leave request Enum: "pending", "approved", "rejected" - `data.note` (string,null) Note attached to the leave request Example: "Family vacation" - `data.is_paid` (string) Whether the leave is paid Enum: "yes", "no" - `data.created_by` (integer,null) ID of the user who created the leave request Example: 100 - `data.approved_by` (integer,null) ID of the user who approved the leave request Example: 101 - `data.rejected_by` (integer,null) ID of the user who rejected the leave request Example: 101 - `data.reject_reason` (string,null) Reason for rejection (if rejected) Example: "Insufficient leave balance" - `data.start_date` (string,null) Start date of the leave Example: "2024-02-01" - `data.end_date` (string,null) End date of the leave Example: "2024-02-05" - `data.created_on` (string,null) Date when the leave request was created Example: "2024-01-15" - `data.total` (object,null) - `data.total.days` (number,null) Total days (if time unit is days) Example: 5 - `data.total.hours` (number,null) Total hours (if time unit is hours) Example: 40 - `meta` (object) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 400 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 401 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 403 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 500 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string)