curl --request POST \
--url https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"content": {
"ewc": "2023-12-25",
"content_schema_version": 1,
"absence_type": "MATERNITY",
"actual_birth_date": "2023-12-25",
"stillbirth": false,
"evidence_received": false,
"evidence_received_at": "2023-12-25",
"planned_start_date": "2023-12-25",
"kit_days": [
{
"day": "2023-12-25",
"hours": 12
}
]
}
}
'import requests
url = "https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"content": {
"ewc": "2023-12-25",
"content_schema_version": 1,
"absence_type": "MATERNITY",
"actual_birth_date": "2023-12-25",
"stillbirth": False,
"evidence_received": False,
"evidence_received_at": "2023-12-25",
"planned_start_date": "2023-12-25",
"kit_days": [
{
"day": "2023-12-25",
"hours": 12
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-12-25',
end_date: '2023-12-25',
content: {
ewc: '2023-12-25',
content_schema_version: 1,
absence_type: 'MATERNITY',
actual_birth_date: '2023-12-25',
stillbirth: false,
evidence_received: false,
evidence_received_at: '2023-12-25',
planned_start_date: '2023-12-25',
kit_days: [{day: '2023-12-25', hours: 12}]
}
})
};
fetch('https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/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://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/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([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'content' => [
'ewc' => '2023-12-25',
'content_schema_version' => 1,
'absence_type' => 'MATERNITY',
'actual_birth_date' => '2023-12-25',
'stillbirth' => false,
'evidence_received' => false,
'evidence_received_at' => '2023-12-25',
'planned_start_date' => '2023-12-25',
'kit_days' => [
[
'day' => '2023-12-25',
'hours' => 12
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"content\": {\n \"ewc\": \"2023-12-25\",\n \"content_schema_version\": 1,\n \"absence_type\": \"MATERNITY\",\n \"actual_birth_date\": \"2023-12-25\",\n \"stillbirth\": false,\n \"evidence_received\": false,\n \"evidence_received_at\": \"2023-12-25\",\n \"planned_start_date\": \"2023-12-25\",\n \"kit_days\": [\n {\n \"day\": \"2023-12-25\",\n \"hours\": 12\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"content\": {\n \"ewc\": \"2023-12-25\",\n \"content_schema_version\": 1,\n \"absence_type\": \"MATERNITY\",\n \"actual_birth_date\": \"2023-12-25\",\n \"stillbirth\": false,\n \"evidence_received\": false,\n \"evidence_received_at\": \"2023-12-25\",\n \"planned_start_date\": \"2023-12-25\",\n \"kit_days\": [\n {\n \"day\": \"2023-12-25\",\n \"hours\": 12\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"content\": {\n \"ewc\": \"2023-12-25\",\n \"content_schema_version\": 1,\n \"absence_type\": \"MATERNITY\",\n \"actual_birth_date\": \"2023-12-25\",\n \"stillbirth\": false,\n \"evidence_received\": false,\n \"evidence_received_at\": \"2023-12-25\",\n \"planned_start_date\": \"2023-12-25\",\n \"kit_days\": [\n {\n \"day\": \"2023-12-25\",\n \"hours\": 12\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"content": {
"ewc": "2023-12-25",
"content_schema_version": 1,
"absence_type": "MATERNITY",
"actual_birth_date": "2023-12-25",
"stillbirth": false,
"evidence_received": false,
"evidence_received_at": "2023-12-25",
"planned_start_date": "2023-12-25",
"kit_days": [
{
"day": "2023-12-25",
"hours": "<string>"
}
]
},
"absence_id": "<string>",
"employee_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"country_code": "GB",
"external_ref": "<string>",
"is_cancelled": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Absence
Book an absence (first edition).
curl --request POST \
--url https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"content": {
"ewc": "2023-12-25",
"content_schema_version": 1,
"absence_type": "MATERNITY",
"actual_birth_date": "2023-12-25",
"stillbirth": false,
"evidence_received": false,
"evidence_received_at": "2023-12-25",
"planned_start_date": "2023-12-25",
"kit_days": [
{
"day": "2023-12-25",
"hours": 12
}
]
}
}
'import requests
url = "https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"content": {
"ewc": "2023-12-25",
"content_schema_version": 1,
"absence_type": "MATERNITY",
"actual_birth_date": "2023-12-25",
"stillbirth": False,
"evidence_received": False,
"evidence_received_at": "2023-12-25",
"planned_start_date": "2023-12-25",
"kit_days": [
{
"day": "2023-12-25",
"hours": 12
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-12-25',
end_date: '2023-12-25',
content: {
ewc: '2023-12-25',
content_schema_version: 1,
absence_type: 'MATERNITY',
actual_birth_date: '2023-12-25',
stillbirth: false,
evidence_received: false,
evidence_received_at: '2023-12-25',
planned_start_date: '2023-12-25',
kit_days: [{day: '2023-12-25', hours: 12}]
}
})
};
fetch('https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/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://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/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([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'content' => [
'ewc' => '2023-12-25',
'content_schema_version' => 1,
'absence_type' => 'MATERNITY',
'actual_birth_date' => '2023-12-25',
'stillbirth' => false,
'evidence_received' => false,
'evidence_received_at' => '2023-12-25',
'planned_start_date' => '2023-12-25',
'kit_days' => [
[
'day' => '2023-12-25',
'hours' => 12
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"content\": {\n \"ewc\": \"2023-12-25\",\n \"content_schema_version\": 1,\n \"absence_type\": \"MATERNITY\",\n \"actual_birth_date\": \"2023-12-25\",\n \"stillbirth\": false,\n \"evidence_received\": false,\n \"evidence_received_at\": \"2023-12-25\",\n \"planned_start_date\": \"2023-12-25\",\n \"kit_days\": [\n {\n \"day\": \"2023-12-25\",\n \"hours\": 12\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"content\": {\n \"ewc\": \"2023-12-25\",\n \"content_schema_version\": 1,\n \"absence_type\": \"MATERNITY\",\n \"actual_birth_date\": \"2023-12-25\",\n \"stillbirth\": false,\n \"evidence_received\": false,\n \"evidence_received_at\": \"2023-12-25\",\n \"planned_start_date\": \"2023-12-25\",\n \"kit_days\": [\n {\n \"day\": \"2023-12-25\",\n \"hours\": 12\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://preview.intermezzo.ai/organizations/{organization_id}/employees/{employee_id}/absences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"content\": {\n \"ewc\": \"2023-12-25\",\n \"content_schema_version\": 1,\n \"absence_type\": \"MATERNITY\",\n \"actual_birth_date\": \"2023-12-25\",\n \"stillbirth\": false,\n \"evidence_received\": false,\n \"evidence_received_at\": \"2023-12-25\",\n \"planned_start_date\": \"2023-12-25\",\n \"kit_days\": [\n {\n \"day\": \"2023-12-25\",\n \"hours\": 12\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"content": {
"ewc": "2023-12-25",
"content_schema_version": 1,
"absence_type": "MATERNITY",
"actual_birth_date": "2023-12-25",
"stillbirth": false,
"evidence_received": false,
"evidence_received_at": "2023-12-25",
"planned_start_date": "2023-12-25",
"kit_days": [
{
"day": "2023-12-25",
"hours": "<string>"
}
]
},
"absence_id": "<string>",
"employee_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"country_code": "GB",
"external_ref": "<string>",
"is_cancelled": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Get token from Auth0 and paste it here
Body
Create/amend payload: structural facts + typed content. PATCH (amend) uses the same whole-shape payload and appends an edition.
First day of leave (inclusive)
Last day of leave (inclusive); return to work is the next day
GB maternity content payload. ewc anchors the qualifying-week and MPP
derivations, so it must be the SUNDAY the expected week of childbirth
starts on (HMRC weeks run Sunday to Saturday); rejecting anything else is
correct-by-policy rather than silently normalising a caller bug.
Show child attributes
Show child attributes
"GB"AMS correlation reference
Response
Successful Response
One edition, as stored. created_at is the edition's transaction time.
First day of leave (inclusive)
Last day of leave (inclusive); return to work is the next day
GB maternity content payload. ewc anchors the qualifying-week and MPP
derivations, so it must be the SUNDAY the expected week of childbirth
starts on (HMRC weeks run Sunday to Saturday); rejecting anything else is
correct-by-policy rather than silently normalising a caller bug.
Show child attributes
Show child attributes
"GB"AMS correlation reference
Was this page helpful?