ConnectCloud Developers

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 type
  • name (string, required): Display name
  • allowHalfDays (boolean): Half days may be requested
  • archived (boolean): Archived: no longer offered for new data, kept for existing data
  • color (string): Semantic colour of the type in calendars (one of primary, info, success, warning, error, neutral)
  • countsAgainstVacation (boolean): Days of this type are taken from the vacation account
  • icon (string): Lucide icon (i-lucide-…)
  • id (string): Id of the absence type
  • paid (boolean): The absence is paid time
  • requiresApproval (boolean): Requests start as requested and need a decision; otherwise they are approved when entered
  • sensitive (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 of credit, 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 type
  • name (string, required): Display name
  • allowHalfDays (boolean): Half days may be requested
  • archived (boolean): Archived: no longer offered for new data, kept for existing data
  • color (string): Semantic colour of the type in calendars (one of primary, info, success, warning, error, neutral)
  • countsAgainstVacation (boolean): Days of this type are taken from the vacation account
  • icon (string): Lucide icon (i-lucide-…)
  • id (string): Id of the absence type
  • paid (boolean): The absence is paid time
  • requiresApproval (boolean): Requests start as requested and need a decision; otherwise they are approved when entered
  • sensitive (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 of credit, 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}'

View as Markdown · Interactive reference · OpenAPI