Submit a leave request
curl --request POST \
--url https://api.kuahr.com/v1/leave/requests \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"employeeId": "b2c3d4e5-0000-0000-0000-000000000001",
"leaveTypeId": "5e6f7a8b-0000-0000-0000-000000000001",
"startDate": "2026-08-03",
"endDate": "2026-08-07",
"reason": "Family trip"
}
'import requests
url = "https://api.kuahr.com/v1/leave/requests"
payload = {
"employeeId": "b2c3d4e5-0000-0000-0000-000000000001",
"leaveTypeId": "5e6f7a8b-0000-0000-0000-000000000001",
"startDate": "2026-08-03",
"endDate": "2026-08-07",
"reason": "Family trip"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
employeeId: 'b2c3d4e5-0000-0000-0000-000000000001',
leaveTypeId: '5e6f7a8b-0000-0000-0000-000000000001',
startDate: '2026-08-03',
endDate: '2026-08-07',
reason: 'Family trip'
})
};
fetch('https://api.kuahr.com/v1/leave/requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kuahr.com/v1/leave/requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'employeeId' => 'b2c3d4e5-0000-0000-0000-000000000001',
'leaveTypeId' => '5e6f7a8b-0000-0000-0000-000000000001',
'startDate' => '2026-08-03',
'endDate' => '2026-08-07',
'reason' => 'Family trip'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kuahr.com/v1/leave/requests"
payload := strings.NewReader("{\n \"employeeId\": \"b2c3d4e5-0000-0000-0000-000000000001\",\n \"leaveTypeId\": \"5e6f7a8b-0000-0000-0000-000000000001\",\n \"startDate\": \"2026-08-03\",\n \"endDate\": \"2026-08-07\",\n \"reason\": \"Family trip\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kuahr.com/v1/leave/requests")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"employeeId\": \"b2c3d4e5-0000-0000-0000-000000000001\",\n \"leaveTypeId\": \"5e6f7a8b-0000-0000-0000-000000000001\",\n \"startDate\": \"2026-08-03\",\n \"endDate\": \"2026-08-07\",\n \"reason\": \"Family trip\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kuahr.com/v1/leave/requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"employeeId\": \"b2c3d4e5-0000-0000-0000-000000000001\",\n \"leaveTypeId\": \"5e6f7a8b-0000-0000-0000-000000000001\",\n \"startDate\": \"2026-08-03\",\n \"endDate\": \"2026-08-07\",\n \"reason\": \"Family trip\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1a2b3c4d-0000-0000-0000-000000000001",
"employeeId": "b2c3d4e5-0000-0000-0000-000000000001",
"employeeName": null,
"leaveTypeId": "5e6f7a8b-0000-0000-0000-000000000001",
"leaveTypeName": null,
"startDate": "2026-08-03",
"endDate": "2026-08-07",
"workingDays": 5,
"reason": "Family trip",
"status": "Submitted",
"decisionComment": null,
"decidedAt": null,
"createdAt": "2026-07-25T10:00:00+00:00"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Leave
Submit a leave request
Creates a leave request for an employee. Requires leave:write.
POST
/
v1
/
leave
/
requests
Submit a leave request
curl --request POST \
--url https://api.kuahr.com/v1/leave/requests \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"employeeId": "b2c3d4e5-0000-0000-0000-000000000001",
"leaveTypeId": "5e6f7a8b-0000-0000-0000-000000000001",
"startDate": "2026-08-03",
"endDate": "2026-08-07",
"reason": "Family trip"
}
'import requests
url = "https://api.kuahr.com/v1/leave/requests"
payload = {
"employeeId": "b2c3d4e5-0000-0000-0000-000000000001",
"leaveTypeId": "5e6f7a8b-0000-0000-0000-000000000001",
"startDate": "2026-08-03",
"endDate": "2026-08-07",
"reason": "Family trip"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
employeeId: 'b2c3d4e5-0000-0000-0000-000000000001',
leaveTypeId: '5e6f7a8b-0000-0000-0000-000000000001',
startDate: '2026-08-03',
endDate: '2026-08-07',
reason: 'Family trip'
})
};
fetch('https://api.kuahr.com/v1/leave/requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kuahr.com/v1/leave/requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'employeeId' => 'b2c3d4e5-0000-0000-0000-000000000001',
'leaveTypeId' => '5e6f7a8b-0000-0000-0000-000000000001',
'startDate' => '2026-08-03',
'endDate' => '2026-08-07',
'reason' => 'Family trip'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kuahr.com/v1/leave/requests"
payload := strings.NewReader("{\n \"employeeId\": \"b2c3d4e5-0000-0000-0000-000000000001\",\n \"leaveTypeId\": \"5e6f7a8b-0000-0000-0000-000000000001\",\n \"startDate\": \"2026-08-03\",\n \"endDate\": \"2026-08-07\",\n \"reason\": \"Family trip\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kuahr.com/v1/leave/requests")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"employeeId\": \"b2c3d4e5-0000-0000-0000-000000000001\",\n \"leaveTypeId\": \"5e6f7a8b-0000-0000-0000-000000000001\",\n \"startDate\": \"2026-08-03\",\n \"endDate\": \"2026-08-07\",\n \"reason\": \"Family trip\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kuahr.com/v1/leave/requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"employeeId\": \"b2c3d4e5-0000-0000-0000-000000000001\",\n \"leaveTypeId\": \"5e6f7a8b-0000-0000-0000-000000000001\",\n \"startDate\": \"2026-08-03\",\n \"endDate\": \"2026-08-07\",\n \"reason\": \"Family trip\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1a2b3c4d-0000-0000-0000-000000000001",
"employeeId": "b2c3d4e5-0000-0000-0000-000000000001",
"employeeName": null,
"leaveTypeId": "5e6f7a8b-0000-0000-0000-000000000001",
"leaveTypeName": null,
"startDate": "2026-08-03",
"endDate": "2026-08-07",
"workingDays": 5,
"reason": "Family trip",
"status": "Submitted",
"decisionComment": null,
"decidedAt": null,
"createdAt": "2026-07-25T10:00:00+00:00"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Your API key, e.g. kua_live_… (or kua_test_… in test mode).
Body
application/json
Response
Created
A leave request and its decision state.
The request's unique id.
The employee taking leave.
The employee's name (present on list responses).
The type of leave requested.
The leave type's name (present on list responses).
First day of leave (inclusive).
Last day of leave (inclusive).
Working days (Mon–Fri) the request spans.
The reason given.
One of Submitted, Approved, Rejected, Cancelled.
Approver/rejecter comment (required on rejection).
When it was approved/rejected (null while pending).
When the request was submitted.
⌘I