Create an absence type (hr:admin)
POST /api/hr/v1/absence-types
Module: HR · operationId: createAbsenceType · Tag: Configuration · Auth: access token (Authorization: Bearer <accessToken>)
Request body
application/json (required)
key(string, required): Stable key of the typename(string, required): Display nameallowHalfDays(boolean): Half days may be requestedarchived(boolean): Archived: no longer offered for new data, kept for existing datacolor(string): Semantic colour of the type in calendars (one ofprimary,info,success,warning,error,neutral)countsAgainstVacation(boolean): Days of this type are taken from the vacation accounticon(string): Lucide icon (i-lucide-…)id(string): Id of the absence typepaid(boolean): The absence is paid timerequiresApproval(boolean): Requests start as requested and need a decision; otherwise they are approved when enteredsensitive(boolean): Colleagues see only "abwesend"sortOrder(integer): Position in lists (ascending)timeEffect(string): credit: counts as worked; none: the time account pays (Überstundenabbau); reduce_target: no target (unpaid) (one ofcredit,none,reduce_target)version(integer): Version for optimistic locking: send the version you read with a change (stale: 409 version_conflict)
Example:
{
"allowHalfDays": false,
"archived": false,
"color": "info",
"countsAgainstVacation": false,
"icon": "i-lucide-school",
"id": "1a3c5e7a-9c1e-4a3c-8e5a-7c9e1a3c5e15",
"key": "berufsschule",
"name": "Berufsschule",
"paid": true,
"requiresApproval": false,
"sensitive": false,
"sortOrder": 80,
"timeEffect": "credit",
"version": 1
}
Responses
- 201 Created (
application/json) - 400 Error (
application/json) - 409 Error (
application/json)
Fields of the 201 answer:
key(string, required): Stable key of the typename(string, required): Display nameallowHalfDays(boolean): Half days may be requestedarchived(boolean): Archived: no longer offered for new data, kept for existing datacolor(string): Semantic colour of the type in calendars (one ofprimary,info,success,warning,error,neutral)countsAgainstVacation(boolean): Days of this type are taken from the vacation accounticon(string): Lucide icon (i-lucide-…)id(string): Id of the absence typepaid(boolean): The absence is paid timerequiresApproval(boolean): Requests start as requested and need a decision; otherwise they are approved when enteredsensitive(boolean): Colleagues see only "abwesend"sortOrder(integer): Position in lists (ascending)timeEffect(string): credit: counts as worked; none: the time account pays (Überstundenabbau); reduce_target: no target (unpaid) (one ofcredit,none,reduce_target)version(integer): Version for optimistic locking: send the version you read with a change (stale: 409 version_conflict)
Example 201 answer:
{
"allowHalfDays": false,
"archived": false,
"color": "info",
"countsAgainstVacation": false,
"icon": "i-lucide-school",
"id": "1a3c5e7a-9c1e-4a3c-8e5a-7c9e1a3c5e15",
"key": "berufsschule",
"name": "Berufsschule",
"paid": true,
"requiresApproval": false,
"sensitive": false,
"sortOrder": 80,
"timeEffect": "credit",
"version": 1
}
Example request
curl -X POST 'https://api.mbcom.cloud/api/hr/v1/absence-types' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"allowHalfDays":false,"archived":false,"color":"info","countsAgainstVacation":false,"icon":"i-lucide-school","id":"1a3c5e7a-9c1e-4a3c-8e5a-7c9e1a3c5e15","key":"berufsschule","name":"Berufsschule","paid":true,"requiresApproval":false,"sensitive":false,"sortOrder":80,"timeEffect":"credit","version":1}'