# Get Leave Balances Retrieve leave balances for users within a given date range. Requires date_from and date_to parameters. Endpoint: GET /leaves/balances Version: 2.0.0 Security: oauth2, apiKey ## Query parameters: - `workspace_id` (integer, required) ID of the workspace Example: 1 - `user_id` (integer) Filter by user ID Example: 100 - `date_from` (string, required) Start date for balance calculation (YYYY-MM-DD) Example: "2024-01-01" - `date_to` (string, required) End date for balance calculation (YYYY-MM-DD) Example: "2024-12-31" - `page` (integer) Page number for pagination Example: 1 ## Response 200 fields (application/json): - `success` (boolean) Example: true - `data` (array) - `data.user_id` (integer) ID of the user Example: 100 - `data.user_name` (string) Full name of the user Example: "John Doe" - `data.leave_information` (array) Array of leave balance information by leave type - `data.leave_information.leave_type` (string) Name of the leave type Example: "Vacation" - `data.leave_information.balance` (string) Remaining balance Example: "10 days" - `data.total_balance` (string,null) Total leave balance (if balance mode is total) Example: "15 days" - `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 422 fields (application/json): - `success` (boolean, required) - `message` (string, required) Example: "Validation failed" - `errors` (object, required) Object containing validation error messages for each field Example: {"email":["The email field is required.","The email must be a valid email address."],"firstname":["The firstname field is required."],"role":["The selected role is invalid."]} - `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)