Create a leave request
deputy_create_leave_requestAdd a leave request for an employee. By default it waits for manager approval (status 0); pass status 1 only when your system is the source of truth and the leave is already approved. Deputy tracks leave in hours, so give exact start and end times. Find leave type ids with deputy_query_resource on LeaveRules. Deputy: POST /api/v1/resource/Leave.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | 0 awaiting approval (default), 1 already approved. | |
| comment | Yes | The employee's note to the manager. | |
| end_date | Yes | Last day, YYYY-MM-DD. | |
| end_time | Yes | Leave end: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times). | |
| start_date | Yes | First day, YYYY-MM-DD. | |
| start_time | Yes | Leave start: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times). | |
| employee_id | Yes | The employee id. | |
| location_id | Yes | Location (Company id) the leave is recorded against. | |
| leave_rule_id | Yes | Leave type (LeaveRules id), e.g. annual leave. | |
| approval_comment | No | Manager's comment, when status is 1. |