POST/ create
Route | {root}/v4/leave-type/create |
Request type | BODY |
User level | SUPER USER |
Requires authentication | Yes |
Response type | Single |
Parameters
Name | Type | Nullable? | Required? | Min. | Max. | Nest | Custom |
---|---|---|---|---|---|---|---|
name | STRING | REQUIRED | 0 | 50 | - | - | |
code | STRING | REQUIRED | 0 | 2 | - | - | |
colour | STRING | REQUIRED | 0 | 7 | - | - | |
deduct_allowance_id | CUSTOM | REQUIRED | 0 | 2 | - | ||
requires_approval | [BOOLEAN] | REQUIRED | - | - | |||
consecutive_duration | MINUTE(INT32) | REQUIRED | 0 | 2147483647 | - | - | |
notes_visible_to_id | CUSTOM | REQUIRED | 100 | 310 | - | ||
available_to_id | CUSTOM | REQUIRED | 100 | 310 | - | ||
seen_by_id | CUSTOM | REQUIRED | 100 | 310 | - | ||
min_notice_period | [INT32] | REQUIRED | -2147483648 | 2147483647 | - | - | |
cancellation_period | [INT32] | REQUIRED | -2147483648 | 2147483647 | - | - | |
include_department_level | [BOOLEAN] | REQUIRED | - | - | |||
note_required | [BOOLEAN] | REQUIRED | - | - | |||
email_request_id | CUSTOM | REQUIRED | 0 | 4 | - | ||
email_approve_id | CUSTOM | REQUIRED | 0 | 4 | - | ||
email_cancel_id | CUSTOM | REQUIRED | 0 | 4 | - | ||
status_id | CUSTOM | REQUIRED | 0 | 1 | - | ||
staff_url | STRING | OPTIONAL | 0 | 500 | - | - | |
staff_note | STRING | OPTIONAL | 0 | 500 | - | - | |
approver_url | STRING | OPTIONAL | 0 | 500 | - | - | |
approver_note | STRING | OPTIONAL | 0 | 500 | - | - | |
message | STRING | OPTIONAL | 0 | 500 | - | - |
Sample cURL
curl --location --request POST "{{ROOT}}leave-type/create/" \ -H "Authorization: Bearer {{BEARER_TOKEN}}" \ -H "app-id:{{APP_ID}}" \ -H "Content-Type: application/json" \ -H "Accept-Encoding: gzip" \ -H "accept: */*" \ --data '{"name": "sample","code": "sample","colour": "sample","deduct_allowance_id": "0","requires_approval": false,"notes_visible_to_id": "100","available_to_id": "100","seen_by_id": "100","min_notice_period": "123456","cancellation_period": "123456","include_department_level": false,"note_required": false,"email_request_id": "0","email_approve_id": "0","email_cancel_id": "0","status_id": "0","staff_url": "sample","staff_note": "sample","approver_url": "sample","approver_note": "sample","message": "sample"}'
Sample response
[
{
"object_name":"leave_type_id",
"type":"Int32",
"is_nullable":false,
"nest":null,
"custom":null
"note":
}
]