curl --request PUT \
--url https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"allowance": 123,
"compensatory_time_off": 123,
"brought_forward": 123,
"reason": "<string>",
"overwrite_brought_forward": true,
"set_as_default": true,
"disabled": true
}
'import requests
url = "https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}"
payload = {
"allowance": 123,
"compensatory_time_off": 123,
"brought_forward": 123,
"reason": "<string>",
"overwrite_brought_forward": True,
"set_as_default": True,
"disabled": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowance: 123,
compensatory_time_off: 123,
brought_forward: 123,
reason: '<string>',
overwrite_brought_forward: true,
set_as_default: true,
disabled: true
})
};
fetch('https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}', 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/members/{id}/allowance/{allowance_type_id}/{year}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowance' => 123,
'compensatory_time_off' => 123,
'brought_forward' => 123,
'reason' => '<string>',
'overwrite_brought_forward' => true,
'set_as_default' => true,
'disabled' => 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/members/{id}/allowance/{allowance_type_id}/{year}"
payload := strings.NewReader("{\n \"allowance\": 123,\n \"compensatory_time_off\": 123,\n \"brought_forward\": 123,\n \"reason\": \"<string>\",\n \"overwrite_brought_forward\": true,\n \"set_as_default\": true,\n \"disabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"allowance\": 123,\n \"compensatory_time_off\": 123,\n \"brought_forward\": 123,\n \"reason\": \"<string>\",\n \"overwrite_brought_forward\": true,\n \"set_as_default\": true,\n \"disabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowance\": 123,\n \"compensatory_time_off\": 123,\n \"brought_forward\": 123,\n \"reason\": \"<string>\",\n \"overwrite_brought_forward\": true,\n \"set_as_default\": true,\n \"disabled\": 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": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Update a member's allowance (deprecated)
DEPRECATED: Use the new rule-based endpoints instead: POST /allowance-types//rules to create rules, POST /members//rule-assignments to assign members, and POST /members//adjustments for one-off changes. IMPORTANT: for a member who is on the rule-based model, the allowance field is an absolute target for the fiscal year and is applied as a single API-owned adjustment holding the difference between it and the member’s rule entitlement. That adjustment is overwritten in place on every send, so sending the same value repeatedly changes nothing, and it is removed again as soon as the value matches the rule entitlement. Adjustments an administrator created in absentify are never counted into that difference and are never modified by this endpoint, so both can coexist: the effective allowance is the value you send plus whatever an administrator added on top. The adjustment is visible in the member’s allowance history, labelled as set via the API, and an administrator can delete it there to return the member to the plain rule entitlement. For a member who has no allowance rule at all, the effect depends on the workspace: in a workspace that was moved to the rule-based model, allowance is still accepted and has no effect; in a workspace that still runs on the flat model, allowance keeps its original behaviour and updates the stored value directly. compensatory_time_off and brought_forward keep working unchanged wherever the request is accepted; a field you omit keeps its stored value. While a workspace is locked — a migration is running, or it was rolled back to the flat model — this endpoint rejects the whole request with a conflict instead of applying part of it. If the member has no allowance for the requested type and year — no allowance rule assigns them that type for that year, or the year lies outside their employment period — the endpoint returns 404 Not Found; this is a permanent condition, so do not retry it. Note: For day-based allowance types, prorated allowances are automatically rounded up to the nearest bookable increment (0.5 days if half-day booking is enabled, otherwise 1.0 days). The set_as_default and disabled fields still work here, but they are the only reason some integrations still call this endpoint at all — use PUT /members//allowance-type-configurations/ instead, which enforces the same invariants as the UI.
curl --request PUT \
--url https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"allowance": 123,
"compensatory_time_off": 123,
"brought_forward": 123,
"reason": "<string>",
"overwrite_brought_forward": true,
"set_as_default": true,
"disabled": true
}
'import requests
url = "https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}"
payload = {
"allowance": 123,
"compensatory_time_off": 123,
"brought_forward": 123,
"reason": "<string>",
"overwrite_brought_forward": True,
"set_as_default": True,
"disabled": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowance: 123,
compensatory_time_off: 123,
brought_forward: 123,
reason: '<string>',
overwrite_brought_forward: true,
set_as_default: true,
disabled: true
})
};
fetch('https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}', 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/members/{id}/allowance/{allowance_type_id}/{year}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowance' => 123,
'compensatory_time_off' => 123,
'brought_forward' => 123,
'reason' => '<string>',
'overwrite_brought_forward' => true,
'set_as_default' => true,
'disabled' => 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/members/{id}/allowance/{allowance_type_id}/{year}"
payload := strings.NewReader("{\n \"allowance\": 123,\n \"compensatory_time_off\": 123,\n \"brought_forward\": 123,\n \"reason\": \"<string>\",\n \"overwrite_brought_forward\": true,\n \"set_as_default\": true,\n \"disabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"allowance\": 123,\n \"compensatory_time_off\": 123,\n \"brought_forward\": 123,\n \"reason\": \"<string>\",\n \"overwrite_brought_forward\": true,\n \"set_as_default\": true,\n \"disabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{id}/allowance/{allowance_type_id}/{year}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowance\": 123,\n \"compensatory_time_off\": 123,\n \"brought_forward\": 123,\n \"reason\": \"<string>\",\n \"overwrite_brought_forward\": true,\n \"set_as_default\": true,\n \"disabled\": 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": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Autorisierungen
Pfadparameter
^([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})$^([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})$Body
Antwort
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})$War diese Seite hilfreich?