curl --request POST \
--url https://api.absentify.com/api/v1/requests \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"start": "<string>",
"end": "<string>",
"leave_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requester_member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>",
"representative_member_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"ignoreRepresentativeRequirement": true
}
'import requests
url = "https://api.absentify.com/api/v1/requests"
payload = {
"start": "<string>",
"end": "<string>",
"leave_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requester_member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>",
"representative_member_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"ignoreRepresentativeRequirement": True
}
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({
start: '<string>',
end: '<string>',
leave_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
requester_member_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
reason: '<string>',
representative_member_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
ignoreRepresentativeRequirement: true
})
};
fetch('https://api.absentify.com/api/v1/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.absentify.com/api/v1/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([
'start' => '<string>',
'end' => '<string>',
'leave_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'requester_member_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'reason' => '<string>',
'representative_member_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'ignoreRepresentativeRequirement' => true
]),
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.absentify.com/api/v1/requests"
payload := strings.NewReader("{\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"leave_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requester_member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reason\": \"<string>\",\n \"representative_member_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ignoreRepresentativeRequirement\": true\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.absentify.com/api/v1/requests")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"leave_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requester_member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reason\": \"<string>\",\n \"representative_member_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ignoreRepresentativeRequirement\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/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 \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"leave_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requester_member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reason\": \"<string>\",\n \"representative_member_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ignoreRepresentativeRequirement\": true\n}"
response = http.request(request)
puts response.read_body"3c90c3cc-0d44-4b50-8888-8dd25736052a"{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Create a request
Create a leave request.
Date/Time Format: All dates must be in ISO 8601 format with UTC timezone (e.g., ‘2024-01-15T09:00:00Z’).
Day-based leave types (leave_unit: days):
- Use start_at: ‘morning’ or ‘afternoon’ to specify when the absence starts
- Use end_at: ‘lunchtime’ or ‘end_of_day’ to specify when the absence ends
- Example full day: start=‘2024-01-15T00:00:00Z’, end=‘2024-01-15T00:00:00Z’, start_at=‘morning’, end_at=‘end_of_day’
- Example half day (morning): start=‘2024-01-15T00:00:00Z’, end=‘2024-01-15T00:00:00Z’, start_at=‘morning’, end_at=‘lunchtime’
- If start_at/end_at are omitted, they default to ‘morning’/‘end_of_day’ (full day)
- For leave types with leave_unit ‘days’ (full days only), start_at=‘afternoon’ or end_at=‘lunchtime’ is rejected (each on its own) — use a ‘half_days’ leave type for half-day absences
Hour-based leave types (leave_unit: hours):
- Include the exact time in the start and end timestamps
- The start_at and end_at parameters are ignored
- Example: start=‘2024-01-15T09:00:00Z’, end=‘2024-01-15T12:30:00Z’ for a 9:00-12:30 UTC absence
Representatives: If the leave type or member requires representatives, pass representative_member_ids. Admin API keys creating for another member may instead set ignoreRepresentativeRequirement: true.
Employment period: The absence must fall entirely inside the member’s employment period. A request starting before employment_start_date or ending after employment_end_date is rejected with 400. Both boundary dates are themselves bookable, and a null boundary means open ended on that side. A range that straddles a boundary is rejected rather than truncated.
The check compares calendar days, not exact timestamps. For an hour-based leave type, any time of day on employment_end_date is still inside the period (e.g. start=‘2024-09-30T09:00:00Z’, end=‘2024-09-30T17:00:00Z’ with employment_end_date ‘2024-09-30’ is accepted) — midnight is not the cutoff. The same applies to employment_start_date.
curl --request POST \
--url https://api.absentify.com/api/v1/requests \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"start": "<string>",
"end": "<string>",
"leave_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requester_member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>",
"representative_member_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"ignoreRepresentativeRequirement": true
}
'import requests
url = "https://api.absentify.com/api/v1/requests"
payload = {
"start": "<string>",
"end": "<string>",
"leave_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requester_member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>",
"representative_member_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"ignoreRepresentativeRequirement": True
}
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({
start: '<string>',
end: '<string>',
leave_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
requester_member_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
reason: '<string>',
representative_member_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
ignoreRepresentativeRequirement: true
})
};
fetch('https://api.absentify.com/api/v1/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.absentify.com/api/v1/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([
'start' => '<string>',
'end' => '<string>',
'leave_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'requester_member_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'reason' => '<string>',
'representative_member_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'ignoreRepresentativeRequirement' => true
]),
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.absentify.com/api/v1/requests"
payload := strings.NewReader("{\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"leave_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requester_member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reason\": \"<string>\",\n \"representative_member_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ignoreRepresentativeRequirement\": true\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.absentify.com/api/v1/requests")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"leave_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requester_member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reason\": \"<string>\",\n \"representative_member_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ignoreRepresentativeRequirement\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/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 \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"leave_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requester_member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reason\": \"<string>\",\n \"representative_member_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ignoreRepresentativeRequirement\": true\n}"
response = http.request(request)
puts response.read_body"3c90c3cc-0d44-4b50-8888-8dd25736052a"{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Body
Start/end of the request in ISO 8601. For day-based leave types (leave_unit: days) send the date at midnight UTC (e.g. 2026-06-01T00:00:00Z) and use start_at / end_at to set half-days. For hour-based leave types include the exact time of day (e.g. 2026-06-01T09:00:00Z); start_at / end_at are then ignored.
Start/end of the request in ISO 8601. For day-based leave types (leave_unit: days) send the date at midnight UTC (e.g. 2026-06-01T00:00:00Z) and use start_at / end_at to set half-days. For hour-based leave types include the exact time of day (e.g. 2026-06-01T09:00:00Z); start_at / end_at are then ignored.
Member IDs to assign as representatives. Required for leave types that mandate representatives; omitting them returns REQUIRED_REPRESENTATIVES_COUNT_NOT_MET (as a 400 on create, as rejection.code on preview).
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Response
Successful response
The response is of type string<uuid>.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Was this page helpful?