Assign a member to an allowance rule
curl --request POST \
--url https://api.absentify.com/api/v1/members/{member_id}/rule-assignments \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_start_date": "<string>",
"reason": "<string>",
"rule_end_date": "<string>"
}
'import requests
url = "https://api.absentify.com/api/v1/members/{member_id}/rule-assignments"
payload = {
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_start_date": "<string>",
"reason": "<string>",
"rule_end_date": "<string>"
}
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({
rule_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
allowance_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rule_start_date: '<string>',
reason: '<string>',
rule_end_date: '<string>'
})
};
fetch('https://api.absentify.com/api/v1/members/{member_id}/rule-assignments', 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/{member_id}/rule-assignments",
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([
'rule_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'allowance_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rule_start_date' => '<string>',
'reason' => '<string>',
'rule_end_date' => '<string>'
]),
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/{member_id}/rule-assignments"
payload := strings.NewReader("{\n \"rule_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_start_date\": \"<string>\",\n \"reason\": \"<string>\",\n \"rule_end_date\": \"<string>\"\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/members/{member_id}/rule-assignments")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rule_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_start_date\": \"<string>\",\n \"reason\": \"<string>\",\n \"rule_end_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{member_id}/rule-assignments")
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 \"rule_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_start_date\": \"<string>\",\n \"reason\": \"<string>\",\n \"rule_end_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"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": []
}Allowance Management
Assign a member to an allowance rule
Creates a new rule assignment for a member. Assignments for one allowance type form a chain, so an end date is only accepted on the day before the next assignment starts or on the member’s last employment day; leave rule_end_date null when nothing follows. Gaps or overlaps that already existed are tolerated, but a write may not widen them. Allowance values are automatically recalculated.
POST
/
members
/
{member_id}
/
rule-assignments
Assign a member to an allowance rule
curl --request POST \
--url https://api.absentify.com/api/v1/members/{member_id}/rule-assignments \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_start_date": "<string>",
"reason": "<string>",
"rule_end_date": "<string>"
}
'import requests
url = "https://api.absentify.com/api/v1/members/{member_id}/rule-assignments"
payload = {
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_start_date": "<string>",
"reason": "<string>",
"rule_end_date": "<string>"
}
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({
rule_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
allowance_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rule_start_date: '<string>',
reason: '<string>',
rule_end_date: '<string>'
})
};
fetch('https://api.absentify.com/api/v1/members/{member_id}/rule-assignments', 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/{member_id}/rule-assignments",
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([
'rule_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'allowance_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rule_start_date' => '<string>',
'reason' => '<string>',
'rule_end_date' => '<string>'
]),
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/{member_id}/rule-assignments"
payload := strings.NewReader("{\n \"rule_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_start_date\": \"<string>\",\n \"reason\": \"<string>\",\n \"rule_end_date\": \"<string>\"\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/members/{member_id}/rule-assignments")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rule_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_start_date\": \"<string>\",\n \"reason\": \"<string>\",\n \"rule_end_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{member_id}/rule-assignments")
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 \"rule_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_start_date\": \"<string>\",\n \"reason\": \"<string>\",\n \"rule_end_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"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": []
}Autorisierungen
Pfadparameter
Pattern:
^([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
application/json
Pattern:
^([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})$Pattern:
^([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})$First day the rule applies (inclusive), in YYYY-MM-DD format.
Pattern:
^\d{4}-\d{2}-\d{2}$Why this assignment is being created — stored in the rule audit log.
Required string length:
3 - 500Last day the rule applies (inclusive), in YYYY-MM-DD format, or null for open-ended. To cover a member through 2026-08-31, send 2026-08-31.
Pattern:
^\d{4}-\d{2}-\d{2}$Antwort
Successful response
War diese Seite hilfreich?