import { Kombo } from "@kombo-api/sdk";
const kombo = new Kombo({
integration_id: "workday:HWUTwvyx2wLoSUHphiWVrp28",
api_key: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await kombo.hris.createAbsence({
employee_id: "wXJMxwDvPAjrJ4CyqdV9",
absence_type_id: "3YKtQ7qedsrcCady1jSyAkY1",
start_date: new Date("2019-09-17T00:00:00Z"),
end_date: new Date("2019-09-21T00:00:00Z"),
employee_note: "Visiting the aliens",
start_time: "08:30:00",
end_time: "16:00:00",
});
console.log(result);
}
run();require 'kombo'
Models = ::Kombo::Models
s = ::Kombo::Kombo.new(
integration_id: 'workday:HWUTwvyx2wLoSUHphiWVrp28',
security: Models::Shared::Security.new(
api_key: '<YOUR_BEARER_TOKEN_HERE>'
)
)
res = s.hris.create_absence(body: Models::Shared::PostHrisAbsencesRequestBody.new(
employee_id: 'wXJMxwDvPAjrJ4CyqdV9',
absence_type_id: '3YKtQ7qedsrcCady1jSyAkY1',
start_date: DateTime.iso8601('2019-09-17T00:00:00Z'),
end_date: DateTime.iso8601('2019-09-21T00:00:00Z'),
employee_note: 'Visiting the aliens',
start_time: '08:30:00',
end_time: '16:00:00'
))
unless res.post_hris_absences_positive_response.nil?
# handle response
endfrom kombo import Kombo
from kombo.utils import parse_datetime
with Kombo(
integration_id="workday:HWUTwvyx2wLoSUHphiWVrp28",
api_key="<YOUR_BEARER_TOKEN_HERE>",
) as k_client:
res = k_client.hris.create_absence(employee_id="wXJMxwDvPAjrJ4CyqdV9", absence_type_id="3YKtQ7qedsrcCady1jSyAkY1", start_date=parse_datetime("2019-09-17T00:00:00Z"), end_date=parse_datetime("2019-09-21T00:00:00Z"), employee_note="Visiting the aliens", status="REQUESTED", start_half_day=False, end_half_day=False, start_time="08:30:00", end_time="16:00:00")
# Handle response
print(res)curl --request POST \
--url https://api.kombo.dev/v1/hris/absences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Integration-Id: <x-integration-id>' \
--data '
{
"employee_id": "wXJMxwDvPAjrJ4CyqdV9",
"absence_type_id": "3YKtQ7qedsrcCady1jSyAkY1",
"start_date": "2019-09-17",
"end_date": "2019-09-21",
"start_time": "08:30:00",
"end_time": "16:00:00",
"start_half_day": false,
"end_half_day": false,
"employee_note": "Visiting the aliens"
}
'const options = {
method: 'POST',
headers: {
'X-Integration-Id': '<x-integration-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
employee_id: 'wXJMxwDvPAjrJ4CyqdV9',
absence_type_id: '3YKtQ7qedsrcCady1jSyAkY1',
start_date: '2019-09-17',
end_date: '2019-09-21',
start_time: '08:30:00',
end_time: '16:00:00',
start_half_day: false,
end_half_day: false,
employee_note: 'Visiting the aliens'
})
};
fetch('https://api.kombo.dev/v1/hris/absences', 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.kombo.dev/v1/hris/absences",
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([
'employee_id' => 'wXJMxwDvPAjrJ4CyqdV9',
'absence_type_id' => '3YKtQ7qedsrcCady1jSyAkY1',
'start_date' => '2019-09-17',
'end_date' => '2019-09-21',
'start_time' => '08:30:00',
'end_time' => '16:00:00',
'start_half_day' => false,
'end_half_day' => false,
'employee_note' => 'Visiting the aliens'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Integration-Id: <x-integration-id>"
],
]);
$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.kombo.dev/v1/hris/absences"
payload := strings.NewReader("{\n \"employee_id\": \"wXJMxwDvPAjrJ4CyqdV9\",\n \"absence_type_id\": \"3YKtQ7qedsrcCady1jSyAkY1\",\n \"start_date\": \"2019-09-17\",\n \"end_date\": \"2019-09-21\",\n \"start_time\": \"08:30:00\",\n \"end_time\": \"16:00:00\",\n \"start_half_day\": false,\n \"end_half_day\": false,\n \"employee_note\": \"Visiting the aliens\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Integration-Id", "<x-integration-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.kombo.dev/v1/hris/absences")
.header("X-Integration-Id", "<x-integration-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"employee_id\": \"wXJMxwDvPAjrJ4CyqdV9\",\n \"absence_type_id\": \"3YKtQ7qedsrcCady1jSyAkY1\",\n \"start_date\": \"2019-09-17\",\n \"end_date\": \"2019-09-21\",\n \"start_time\": \"08:30:00\",\n \"end_time\": \"16:00:00\",\n \"start_half_day\": false,\n \"end_half_day\": false,\n \"employee_note\": \"Visiting the aliens\"\n}")
.asString();{
"status": "success",
"data": {
"id": "22st2Ji8XpncEYEak8mvQgQF",
"remote_id": "1348",
"employee_id": "JDdUy9kiH5APaGizFrgNmQjM",
"approver_id": "AgXEispYPP1BbToHpqnqcpxy",
"start_date": "2022-08-04",
"end_date": "2022-08-05",
"start_half_day": true,
"end_half_day": false,
"start_time": "13:15:00",
"end_time": "17:00:00",
"amount": 2,
"unit": "DAYS",
"status": "APPROVED",
"employee_note": "Visiting my family.",
"type_id": "xzZoKssDaMZAd62kxayzzQvD",
"remote_created_at": "2022-08-07T14:01:29.196Z",
"remote_updated_at": "2022-08-07T14:01:29.196Z",
"changed_at": "2022-08-07T14:01:29.196Z",
"remote_deleted_at": "2022-08-07T14:01:29.196Z",
"remote_data": null
},
"warnings": [
{
"message": "This is an example warning!"
}
]
}Create absence
Create a new absence.
import { Kombo } from "@kombo-api/sdk";
const kombo = new Kombo({
integration_id: "workday:HWUTwvyx2wLoSUHphiWVrp28",
api_key: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await kombo.hris.createAbsence({
employee_id: "wXJMxwDvPAjrJ4CyqdV9",
absence_type_id: "3YKtQ7qedsrcCady1jSyAkY1",
start_date: new Date("2019-09-17T00:00:00Z"),
end_date: new Date("2019-09-21T00:00:00Z"),
employee_note: "Visiting the aliens",
start_time: "08:30:00",
end_time: "16:00:00",
});
console.log(result);
}
run();require 'kombo'
Models = ::Kombo::Models
s = ::Kombo::Kombo.new(
integration_id: 'workday:HWUTwvyx2wLoSUHphiWVrp28',
security: Models::Shared::Security.new(
api_key: '<YOUR_BEARER_TOKEN_HERE>'
)
)
res = s.hris.create_absence(body: Models::Shared::PostHrisAbsencesRequestBody.new(
employee_id: 'wXJMxwDvPAjrJ4CyqdV9',
absence_type_id: '3YKtQ7qedsrcCady1jSyAkY1',
start_date: DateTime.iso8601('2019-09-17T00:00:00Z'),
end_date: DateTime.iso8601('2019-09-21T00:00:00Z'),
employee_note: 'Visiting the aliens',
start_time: '08:30:00',
end_time: '16:00:00'
))
unless res.post_hris_absences_positive_response.nil?
# handle response
endfrom kombo import Kombo
from kombo.utils import parse_datetime
with Kombo(
integration_id="workday:HWUTwvyx2wLoSUHphiWVrp28",
api_key="<YOUR_BEARER_TOKEN_HERE>",
) as k_client:
res = k_client.hris.create_absence(employee_id="wXJMxwDvPAjrJ4CyqdV9", absence_type_id="3YKtQ7qedsrcCady1jSyAkY1", start_date=parse_datetime("2019-09-17T00:00:00Z"), end_date=parse_datetime("2019-09-21T00:00:00Z"), employee_note="Visiting the aliens", status="REQUESTED", start_half_day=False, end_half_day=False, start_time="08:30:00", end_time="16:00:00")
# Handle response
print(res)curl --request POST \
--url https://api.kombo.dev/v1/hris/absences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Integration-Id: <x-integration-id>' \
--data '
{
"employee_id": "wXJMxwDvPAjrJ4CyqdV9",
"absence_type_id": "3YKtQ7qedsrcCady1jSyAkY1",
"start_date": "2019-09-17",
"end_date": "2019-09-21",
"start_time": "08:30:00",
"end_time": "16:00:00",
"start_half_day": false,
"end_half_day": false,
"employee_note": "Visiting the aliens"
}
'const options = {
method: 'POST',
headers: {
'X-Integration-Id': '<x-integration-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
employee_id: 'wXJMxwDvPAjrJ4CyqdV9',
absence_type_id: '3YKtQ7qedsrcCady1jSyAkY1',
start_date: '2019-09-17',
end_date: '2019-09-21',
start_time: '08:30:00',
end_time: '16:00:00',
start_half_day: false,
end_half_day: false,
employee_note: 'Visiting the aliens'
})
};
fetch('https://api.kombo.dev/v1/hris/absences', 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.kombo.dev/v1/hris/absences",
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([
'employee_id' => 'wXJMxwDvPAjrJ4CyqdV9',
'absence_type_id' => '3YKtQ7qedsrcCady1jSyAkY1',
'start_date' => '2019-09-17',
'end_date' => '2019-09-21',
'start_time' => '08:30:00',
'end_time' => '16:00:00',
'start_half_day' => false,
'end_half_day' => false,
'employee_note' => 'Visiting the aliens'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Integration-Id: <x-integration-id>"
],
]);
$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.kombo.dev/v1/hris/absences"
payload := strings.NewReader("{\n \"employee_id\": \"wXJMxwDvPAjrJ4CyqdV9\",\n \"absence_type_id\": \"3YKtQ7qedsrcCady1jSyAkY1\",\n \"start_date\": \"2019-09-17\",\n \"end_date\": \"2019-09-21\",\n \"start_time\": \"08:30:00\",\n \"end_time\": \"16:00:00\",\n \"start_half_day\": false,\n \"end_half_day\": false,\n \"employee_note\": \"Visiting the aliens\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Integration-Id", "<x-integration-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.kombo.dev/v1/hris/absences")
.header("X-Integration-Id", "<x-integration-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"employee_id\": \"wXJMxwDvPAjrJ4CyqdV9\",\n \"absence_type_id\": \"3YKtQ7qedsrcCady1jSyAkY1\",\n \"start_date\": \"2019-09-17\",\n \"end_date\": \"2019-09-21\",\n \"start_time\": \"08:30:00\",\n \"end_time\": \"16:00:00\",\n \"start_half_day\": false,\n \"end_half_day\": false,\n \"employee_note\": \"Visiting the aliens\"\n}")
.asString();{
"status": "success",
"data": {
"id": "22st2Ji8XpncEYEak8mvQgQF",
"remote_id": "1348",
"employee_id": "JDdUy9kiH5APaGizFrgNmQjM",
"approver_id": "AgXEispYPP1BbToHpqnqcpxy",
"start_date": "2022-08-04",
"end_date": "2022-08-05",
"start_half_day": true,
"end_half_day": false,
"start_time": "13:15:00",
"end_time": "17:00:00",
"amount": 2,
"unit": "DAYS",
"status": "APPROVED",
"employee_note": "Visiting my family.",
"type_id": "xzZoKssDaMZAd62kxayzzQvD",
"remote_created_at": "2022-08-07T14:01:29.196Z",
"remote_updated_at": "2022-08-07T14:01:29.196Z",
"changed_at": "2022-08-07T14:01:29.196Z",
"remote_deleted_at": "2022-08-07T14:01:29.196Z",
"remote_data": null
},
"warnings": [
{
"message": "This is an example warning!"
}
]
}Supported integrations
Supported integrations
Personio
SAP SuccessFactors
Factorial
BambooHR
HiBob
Deel
Sesame HR
HR WORKS
AlexisHR
Simployer
Paycor
HR4YOU
SD Worx
Absence.io
a3innuva Nómina
DATEV LODAS
DATEV Lohn & Gehalt
Kombo Sandbox
Example Request Body
{
"employee_id": "wXJMxwDvPAjrJ4CyqdV9",
"absence_type_id": "3YKtQ7qedsrcCady1jSyAkY1",
"start_date": "2019-09-17",
"end_date": "2019-09-21",
"start_time": "08:30:00",
"end_time": "16:00:00",
"start_half_day": false,
"end_half_day": false,
"employee_note": "Visiting the aliens"
}
Authorizations
Headers
ID of the integration you want to interact with.
Body
POST /hris/absences Request body
The ID of the employee in Kombo or their ID in the remote system by prefixing it with remote: (e.g., remote:12312)
The ID of the absence type in Kombo (not its remote_id).
The date that the absence starts. This is a plain date (i.e., yyyy-MM-dd), with all time information discarded.
^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?)?Z?$When the absence ends.The date that the absence ends. This is a plain date (i.e., yyyy-MM-dd), with all time information discarded.
^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?)?Z?$A note describing the reason for this absence.
The state that the absence should be created in. Some tools may approve absences automatically if they were created for an absence type that does not require approval.
REQUESTED, APPROVED true if the absence should start in the middle of the day.
true if the absence should end in the middle of the day.
The amount of time of the absence. Specifying this also requires specifying unit. This is supported by very few tools.
x >= 0The time unit of the amount value. Specifying this also requires specifying amount.
HOURS, DAYS The time of when the absence begins. Follows the format HH:mm or HH:mm:ss (e.g., 14:45:15). If start_time is specified, end_time has to be specified as well.
^(?:2[0-3]|[01]?\d):[0-5]?\d(:[0-5]?\d)?$The time of when the absence ends. Follows the format HH:mm or HH:mm:ss (e.g., 14:45:15). If end_time is specified, start_time has to be specified as well.
^(?:2[0-3]|[01]?\d):[0-5]?\d(:[0-5]?\d)?$Additional fields that we will pass through to specific HRIS systems.
Show child attributes
Show child attributes
Response
POST /hris/absences Positive response
"success"Show child attributes
Show child attributes
{
"id": "22st2Ji8XpncEYEak8mvQgQF",
"remote_id": "1348",
"employee_id": "JDdUy9kiH5APaGizFrgNmQjM",
"approver_id": "AgXEispYPP1BbToHpqnqcpxy",
"start_date": "2022-08-04",
"end_date": "2022-08-05",
"start_half_day": true,
"end_half_day": false,
"start_time": "13:15:00",
"end_time": "17:00:00",
"amount": 2,
"unit": "DAYS",
"status": "APPROVED",
"employee_note": "Visiting my family.",
"type_id": "xzZoKssDaMZAd62kxayzzQvD",
"remote_created_at": "2022-08-07T14:01:29.196Z",
"remote_updated_at": "2022-08-07T14:01:29.196Z",
"changed_at": "2022-08-07T14:01:29.196Z",
"remote_deleted_at": "2022-08-07T14:01:29.196Z",
"remote_data": null
}
These are the interaction warnings that are shown in the dashboard. They are meant to provide debug information to you. We recommend logging them to the console.
Show child attributes
Show child attributes
Was this page helpful?