Controller : Leave Type

VERSION: 4.0, DEPRECATED: NO

Calls: {root}/leave type


POST/ create
Route {root}/v4/leave-type/create
Request type BODY
User level SUPER USER
Requires authentication Yes
Response type Single

Parameters

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":
}
]
POST/ retrieve
Route {root}/v4/leave-type/retrieve
Request type BODY
User level SUPER USER
Requires authentication Yes
Response type Array()

Parameters

Sample cURL

curl --location --request POST "{{ROOT}}leave-type/retrieve/" \
-H "Authorization: Bearer {{BEARER_TOKEN}}" \
-H "app-id:{{APP_ID}}" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "accept: */*" \
--data '{"status_id": "0"}'

Sample response

[
{
"object_name":"leave_type_id",
"type":"Int32",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"name",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"code",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"colour",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"deduct_allowance_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"no",
"value":"0"
},
{
"name":"yes",
"value":"1"
},
{
"name":"no hours only",
"value":"2"
}]
"note":
},
{
"object_name":"requires_approval",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"consecutive_duration",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"notes_visible_to_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"staff",
"value":"100"
},
{
"name":"approver",
"value":"200"
},
{
"name":"super user",
"value":"300"
},
{
"name":"super user with staff hub",
"value":"310"
}]
"note":
},
{
"object_name":"available_to_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"staff",
"value":"100"
},
{
"name":"approver",
"value":"200"
},
{
"name":"super user",
"value":"300"
},
{
"name":"super user with staff hub",
"value":"310"
}]
"note":
},
{
"object_name":"seen_by_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"staff",
"value":"100"
},
{
"name":"approver",
"value":"200"
},
{
"name":"super user",
"value":"300"
},
{
"name":"super user with staff hub",
"value":"310"
}]
"note":
},
{
"object_name":"min_notice_period",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"cancellation_period",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"include_department_level",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"note_required",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"email_request_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"none",
"value":"0"
},
{
"name":"staff approver notifier",
"value":"1"
},
{
"name":"staff only",
"value":"2"
},
{
"name":"staff approver",
"value":"3"
},
{
"name":"approver only",
"value":"4"
}]
"note":
},
{
"object_name":"email_approve_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"none",
"value":"0"
},
{
"name":"staff approver notifier",
"value":"1"
},
{
"name":"staff only",
"value":"2"
},
{
"name":"staff approver",
"value":"3"
},
{
"name":"approver only",
"value":"4"
}]
"note":
},
{
"object_name":"email_cancel_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"none",
"value":"0"
},
{
"name":"staff approver notifier",
"value":"1"
},
{
"name":"staff only",
"value":"2"
},
{
"name":"staff approver",
"value":"3"
},
{
"name":"approver only",
"value":"4"
}]
"note":
},
{
"object_name":"status_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"disabled",
"value":"0"
},
{
"name":"active",
"value":"1"
}]
"note":
},
{
"object_name":"staff_url",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"staff_note",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"approver_url",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"approver_note",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"message",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
}
]
GET/ retrieve-by-id
Route {root}/v4/leave-type/retrieve-by-id
Request type URL
User level SUPER USER
Requires authentication Yes
Response type Single
Sample call{root}/v4/leave-type/retrieve-by-id/12345678

Parameters

Sample cURL

curl --location --request GET "{{ROOT}}leave-type/retrieve-by-id/12345678-H "Authorization: Bearer {{BEARER_TOKEN}}" \
-H "app-id:{{APP_ID}}" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "accept: */*" \

Sample response

[
{
"object_name":"leave_type_id",
"type":"Int32",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"name",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"code",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"colour",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"deduct_allowance_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"no",
"value":"0"
},
{
"name":"yes",
"value":"1"
},
{
"name":"no hours only",
"value":"2"
}]
"note":
},
{
"object_name":"requires_approval",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"consecutive_duration",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"notes_visible_to_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"staff",
"value":"100"
},
{
"name":"approver",
"value":"200"
},
{
"name":"super user",
"value":"300"
},
{
"name":"super user with staff hub",
"value":"310"
}]
"note":
},
{
"object_name":"available_to_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"staff",
"value":"100"
},
{
"name":"approver",
"value":"200"
},
{
"name":"super user",
"value":"300"
},
{
"name":"super user with staff hub",
"value":"310"
}]
"note":
},
{
"object_name":"seen_by_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"staff",
"value":"100"
},
{
"name":"approver",
"value":"200"
},
{
"name":"super user",
"value":"300"
},
{
"name":"super user with staff hub",
"value":"310"
}]
"note":
},
{
"object_name":"min_notice_period",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"cancellation_period",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"include_department_level",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"note_required",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"email_request_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"none",
"value":"0"
},
{
"name":"staff approver notifier",
"value":"1"
},
{
"name":"staff only",
"value":"2"
},
{
"name":"staff approver",
"value":"3"
},
{
"name":"approver only",
"value":"4"
}]
"note":
},
{
"object_name":"email_approve_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"none",
"value":"0"
},
{
"name":"staff approver notifier",
"value":"1"
},
{
"name":"staff only",
"value":"2"
},
{
"name":"staff approver",
"value":"3"
},
{
"name":"approver only",
"value":"4"
}]
"note":
},
{
"object_name":"email_cancel_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"none",
"value":"0"
},
{
"name":"staff approver notifier",
"value":"1"
},
{
"name":"staff only",
"value":"2"
},
{
"name":"staff approver",
"value":"3"
},
{
"name":"approver only",
"value":"4"
}]
"note":
},
{
"object_name":"status_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"disabled",
"value":"0"
},
{
"name":"active",
"value":"1"
}]
"note":
},
{
"object_name":"staff_url",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"staff_note",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"approver_url",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"approver_note",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"message",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
}
]
GET/ retrieve-for-user
Route {root}/v4/leave-type/retrieve-for-user
Request type URL
User level STAFF
Requires authentication Yes
Response type Array()
Sample call{root}/v4/leave-type/retrieve-for-user/?/

Parameters

Sample cURL

curl --location --request GET "{{ROOT}}leave-type/retrieve-for-user/?status_id=0option_id=0-H "Authorization: Bearer {{BEARER_TOKEN}}" \
-H "app-id:{{APP_ID}}" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "accept: */*" \

Sample response

[
{
"object_name":"leave_type_id",
"type":"Int32",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"name",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"code",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"colour",
"type":"String",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"deduct_allowance_id",
"type":"custom",
"is_nullable":false,
"nest":null,
"custom":[
{
"name":"no",
"value":"0"
},
{
"name":"yes",
"value":"1"
},
{
"name":"no hours only",
"value":"2"
}]
"note":
},
{
"object_name":"consecutive_duration",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"min_notice_period",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"note_required",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"can_request",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"can_record",
"type":"Boolean",
"is_nullable":false,
"nest":null,
"custom":null
"note":
},
{
"object_name":"cancellation_period",
"type":"minute(int32)",
"is_nullable":false,
"nest":null,
"custom":null
"note":
}
]
PUT/ update
Route {root}/v4/leave-type/update
Request type BODY
User level SUPER USER
Requires authentication Yes
Response type Single

Parameters

Sample cURL

curl --location --request PUT "{{ROOT}}leave-type/update/" \
-H "Authorization: Bearer {{BEARER_TOKEN}}" \
-H "app-id:{{APP_ID}}" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "accept: */*" \
--data '{"leave_type_id": "123456","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":
}
]
DELETE/ del
Route {root}/v4/leave-type/del
Request type URL
User level SUPER USER
Requires authentication Yes
Response type Single
Sample call{root}/v4/leave-type/del/12345678/true

Parameters

Sample cURL

curl --location --request DELETE "{{ROOT}}leave-type/del/12345678true-H "Authorization: Bearer {{BEARER_TOKEN}}" \
-H "app-id:{{APP_ID}}" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "accept: */*" \

Sample response

Standard response object returned, see API Overview for structure.


Don't have a WhosOff account yet?

Instantly reduce time spent on leave management with your FREE, no obligation trial today!
Sign up today and get until Tuesday, 25th November 2025 to try the full service, for Free!

Get your instant FREE account today
Close [X]
Schedule your personalised demo

Let us show you, in 20 minutes, how WhosOff can elevate your leave management process.

Simply enter your email address in the space provided below and one of our team will reach out and setup a personalised platform demonstration.


Book your demonstration now

Manage Cookie Consent

Cookies are used to store and/or access device information. Providing consent to these technologies allows us to process data such as browsing behaviour. Not consenting or removing consent may adversely affect some features and functions.

AdvertisingEnables storage related to advertising, for example, advertising campaign.
AnalyticsEnables storage related to analytics, for example, visit duration.
TargetingSets consent for sending user data to Google for online advertising purposes.
MarketingSets consent for personalized advertising.
Cookie Policy
Manage cookies