# Request Leave Endpoint: POST /leaves Version: 2.0.0 Security: oauth2, apiKey ## Request fields (application/json): - `workspace_id` (integer, required) ID of the workspace Example: 123 - `policy_id` (integer, required) ID of the leave policy Example: 456 - `start` (string, required) Start date in YYYY-MM-DD format Example: "2026-02-10" - `end` (string, required) End date in YYYY-MM-DD format Example: "2026-02-12" - `user_id` (integer, required) ID of the user Example: 789 - `start_time` (string) Start time in HH:mm format. (Required when policy is hour-based) Example: "09:00" - `end_time` (string) End time in HH:mm format. (Required when policy is hour-based) Example: "13:00" - `hours_per_day` (number) Required when policy is hour-based - `leave_period` (integer) Leave period (0: Full day, 1: 1st half, 2: 2nd half) - `reason` (string) Reason for the leave request ## Response 201 fields (application/json): - `success` (boolean) Example: true - `message` (string) - `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 404 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)