API · v1 · stabil
CODEMETA OS Developer Center
Konsole öffnen
Module

HR & Payroll

Das HR-Modul deckt den Mitarbeiter-Lebenszyklus ab — Stammdaten, Skills, Abwesenheiten, Zertifikate, Onboarding und Offboarding. Payroll integriert sich mit DATEV LODAS.

Resources – HR

ResourcePfadPermission-Präfix
Mitarbeiter-Profile/api/v1/employee_profilesemployee_profile
Zertifikate/api/v1/employee_certificationsemployee_certification
Personalakte/api/v1/employee_documentsemployee_document
Skill-Definitionen/api/v1/skill_definitionsskill_definition
Urlaubs-Anträge/api/v1/vacation_requestsvacation_request
Krankmeldungen/api/v1/sick_leavessick_leave

Resources – Schichten & Arbeitszeit

ResourcePfadPermission-Präfix
Schicht-Templates/api/v1/shift_templatesshift_template
Schicht-Zuweisungen/api/v1/shift_assignmentsshift_assignment
Schicht-Constraints/api/v1/shift_constraint_setsshift_constraint_set
Schicht-Präferenzen/api/v1/shift_preferencesshift_preference
Tausch-Anfragen/api/v1/shift_swap_requestsshift_swap_request
Fairness-Verlauf/api/v1/shift_fairness_recordsshift_fairness_record
Arbeitszeit-Modelle/api/v1/working_time_modelsworking_time_model
Arbeitszeit-Zuweisungen/api/v1/working_time_assignmentsworking_time_assignment

Resources – Payroll

ResourcePfadPermission-PräfixSequenz
Lohnabrechnungen/api/v1/payroll_recordspayroll_recordPAY-
Abrechnungs-Perioden/api/v1/payroll_periodspayroll_period
Rückforderungs-Settings/api/v1/payroll_recovery_configspayroll_recovery_config
Export-Logs/api/v1/payroll_exportspayroll_export
LODAS-Settings/api/v1/payroll_lodas_settingspayroll_lodas_settings
Payroll-Audit/api/v1/payroll_audit_eventspayroll_audit_event

Schemas

Employee

employee_profiles4 Permissions

Schema for validating employee profile entities (Personalstammdaten)

userId uuid optional

User UUID (optional link to users collection)

nullable
firstName string optional

First name (Vorname) — used when no user is linked

max 200 Zeichennullable
lastName string optional

Last name (Nachname) — used when no user is linked

max 200 Zeichennullable
employeeNumber string optional

Auto-generated employee number (e.g. MA-2026-00001)

max 50 Zeichenread-onlynullable
email string optional

Work email address. Used as the matching key for telephony integrations (Starface userlist → starfaceAccountId) so employees WITHOUT a linked user account can still be attributed in call analytics. Plain string (no strict format validation) to keep imports forgiving.

max 320 Zeichennullable
orgUnitId uuid optional

Primary org unit UUID (legacy — use primaryOrgUnitId going forward, ADR 0036b)

nullable
primaryOrgUnitId uuid optional

Arbeitsrechtlich maßgebliche Org-Unit (ADR 0036b). Wird vom Working-Time-Resolver für die Hierarchie-Auflösung benutzt. Bei Matrix-Orgs: eindeutig die primäre. Falls nicht gesetzt, fällt der Resolver auf orgUnitId zurück.

nullable
managerId uuid optional

Direct manager user UUID

nullable
employmentType string erforderlich

Type of employment (Beschäftigungsart)

FULL_TIMEPART_TIMEMINI_JOBWORKING_STUDENTINTERNFREELANCER
employmentStatus string erforderlich

Current employment status

ACTIVEONBOARDINGON_LEAVEOFFBOARDINGTERMINATED
Default: "ONBOARDING"
hireDate date erforderlich

First day of employment (ISO 8601 date: YYYY-MM-DD)

probationEndDate date optional

End of probation period (Probezeit)

nullable
terminationDate date optional

Last day of employment

nullable
terminationReason string optional

Reason for termination

max 1000 Zeichennullable
vacationDaysPerYear number optional

Annual vacation entitlement in days

0 – 365nullable
vacationDaysRemaining number optional

Remaining vacation days for current year

≥ 0nullable
vacationDaysCarryOver number optional

Carried over vacation days from previous year (Resturlaub)

≥ 0nullable
weeklySchedule object[] optional

Per-weekday work schedule (Arbeitszeitplanung)

nullable
day number erforderlich

ISO weekday (1=Mon, 7=Sun)

1 – 7
startTime string erforderlich

Work start time (e.g. "08:00")

Pattern
endTime string erforderlich

Work end time (e.g. "17:00")

Pattern
breakMinutes number optional

Break duration in minutes

0 – 480Default: 0
workingTimeModelId uuid optional

Reference to working_time_model entity

nullable
skills object[] optional

Structured skill entries with levels

Default: []
skillId uuid erforderlich

UUID of the skill definition

level string erforderlich

Proficiency level. INTERESTED is a level-0 interest marker (no proficiency, no XP, never satisfies a scheduling minimum). BEGINNER..EXPERT is the legacy 4-tier enum kept in sync with currentLevel. Prefer currentXp/currentLevel for new proficiency logic.

INTERESTEDBEGINNERINTERMEDIATEADVANCEDEXPERT
currentXp integer optional

Accumulated XP for this skill. Awarded on ticket/task completion or via manual grant. Drives currentLevel.

≥ 0Default: 0nullable
currentLevel integer optional

Numeric level (1–400) across 4 tiers of 100 levels each. Derived from currentXp on XP award, but stored for efficient queries.

0 – 400Default: 0nullable
verifiedAt datetime optional

When the skill was last verified

nullable
verifiedBy uuid optional

User UUID of the person who verified the skill

nullable
source string optional

How the skill was assigned. PERFORMANCE_REVIEW marks interests carried over from a completed Mitarbeitergespräch.

SELF_ASSESSEDMANAGER_ASSIGNEDCERTIFICATIONAUTO_DETECTEDPERFORMANCE_REVIEW
Default: "SELF_ASSESSED"
addedAt datetime optional

When the skill entry was first added

nullable
updatedAt datetime optional

When the skill entry was last updated (level change, re-verification)

read-onlynullable
languageSkills object[] optional

Spoken/written languages with CEFR proficiency level, used for language-aware ticket dispatch

Default: []
code string erforderlich

ISO 639-1 language code

aaabaeafakamanarasavayazbabebgbhbibmbnbo
level string erforderlich

CEFR proficiency level (A1–C2) or NATIVE

A1A2B1B2C1C2NATIVE
addedAt datetime optional
nullable
updatedAt datetime optional
read-onlynullable
karma integer optional

ADR 0224: running karma total (engagement/fairness score). Server-managed: awarded on verified task completion when tenant.features.karmaEnabled. Audit trail in karma_ledger.

≥ 0Default: 0read-only
skillUpdateLog object[] optional

Audit trail of automatic skill-level changes triggered by survey responses or other sources

max 100 ItemsDefault: []nullable
responseId uuid optional

survey_response UUID that triggered this update (idempotency key)

nullable
appliedAt datetime erforderlich
source string optional
satisfaction-surveymanualcertificationticket-closetask-donemanual-grantsurveynull
nullable
changes object[] erforderlich
skillId uuid erforderlich
previousLevel string optional
BEGINNERINTERMEDIATEADVANCEDEXPERTnull
nullable
newLevel string erforderlich
BEGINNERINTERMEDIATEADVANCEDEXPERT
xpDelta integer optional

XP amount awarded in this change (new XP system)

nullable
reason string optional

Optional human-readable reason for the change

max 500 Zeichennullable
phone string optional

Personal phone number

max 50 Zeichennullable
dateOfBirth date optional

Date of birth

nullable
emergencyContactName string optional

Emergency contact name

max 200 Zeichennullable
emergencyContactPhone string optional

Emergency contact phone number

max 50 Zeichennullable
timeZone string optional

IANA-Zeitzone (z.B. "Europe/Berlin"). Override gegenüber org_unit.timeZone / tenant default. Wird u.a. für Zuschlag-Zeitfenster und DST-Handling genutzt.

max 64 Zeichennullable
holidayRegion string optional

ISO 3166-2 Feiertagsregion (z.B. "DE-NW"). Override gegenüber org_unit.holidayRegion / tenant.settings.defaultHolidayRegion. Relevant für MA im Homeoffice in anderem Bundesland.

Patternnullable
mentorUserId uuid optional

Assigned mentor for trainees / juniors

nullable
isMentor boolean optional

Marked as available mentor in the picker

Default: false
isSuitableForInterns boolean optional

Marked as senior who can supervise intern-grade work

Default: false
defaultSubstituteUserId uuid optional

Fallback user for sick-leave auto-reassign

nullable
isApprentice boolean optional

Auszubildender: befindet sich in der Ausbildung und hat noch keinen Abschluss. Dient als Gate für den (separat gebauten) Berichtsheft-/Ausbildungsnachweis-Bereich, der nur für Auszubildende sichtbar ist.

Default: false
isAusbilder boolean optional

Markiert den Mitarbeiter als Ausbilder (kann Auszubildende ausbilden / ist im Ausbilder-Picker eines Auszubildenden wählbar).

Default: false
ausbilderEmployeeId uuid optional

employee_profiles-UUID des diesem Auszubildenden zugewiesenen Ausbilders. Referenziert einen Mitarbeiter (nicht user), damit auch Ausbilder ohne Login zuordenbar sind.

nullable
legalEntityId uuid optional

Rechtliche Einheit (party UUID — typically the operating company, e.g. ITF or Codemeta).

nullable
workLocationId uuid optional

Primary work location (asset/site UUID; references the company address/site).

nullable
qualification object optional

Berufs- oder Studienabschluss. `kind: "ausbildung"` referenziert einen Eintrag aus dem BIBB-Verzeichnis (apps/api/src/data/ausbildungsberufe-2026.jsonl); `kind: "hochschule"` erfasst Abschlussgrad + freies Studienfach.

nullable
kind string erforderlich
ausbildunghochschule
ausbildungName string optional

Berufsbezeichnung aus dem BIBB-Verzeichnis (z. B. "Tierwirt/Tierwirtin")

max 250 Zeichennullable
fachrichtung string optional

Fachrichtung der Ausbildung, falls anwendbar (z. B. "Imkerei")

max 200 Zeichennullable
berufsgattungCode string optional

BIBB-Berufsgattung (5-stellige Nummer)

Patternnullable
kategorie string optional

Kategorie aus dem BIBB-Verzeichnis (s. Reference-Data-Endpoint)

ausbildung-bbigausbildung-ausserhalb-bbigausbildung-gesundheit-bundesrechtausbildung-gesundheit-landesrechtausbildung-zustaendige-stelleumschulung-zustaendige-stelle
nullable
hochschulabschluss string optional

Akademischer Abschlussgrad

BACHELORMASTERDIPLOMMAGISTERSTAATSEXAMENPROMOTIONHABILITATIONBERUFSAKADEMIEOTHER
nullable
fach string optional

Studienfach (Freitext, z. B. "Wirtschaftsinformatik")

max 200 Zeichennullable
safetyRoles object[] optional

Arbeitsrechtliche Sicherheitsrollen (Ersthelfer, Brandschutzhelfer, Sicherheitsbeauftragter, Datenschutzbeauftragter, ...). Mehrfachzuweisung erlaubt; freie Werte sind zugelassen, damit nicht-katalogisierte Rollen gepflegt werden können.

Default: []nullable
key string erforderlich

Stabiler Bezeichner (für Standardrollen einer aus SAFETY_ROLE_CATALOG; für Sonstige der frei eingegebene Rollenname).

1–200 Zeichen
assignedAt date optional

Datum der Bestellung / Beauftragung

nullable
validUntil date optional

Gültig bis — triggert escalation_rule-Reminder vor Ablauf

nullable
notes string optional
max 500 Zeichennullable
educationCertificates object[] optional

Studienbescheinigungen / Ausbildungsnachweise. The actual file lives in the DMS; this is metadata + expiry.

Default: []nullable
_id uuid optional
read-only
title string erforderlich
1–200 Zeichen
issuer string optional
max 200 Zeichennullable
issuedAt date optional
nullable
validUntil date optional

Ablaufdatum — when set, an escalation_rule reminder fires before expiry.

nullable
documentId uuid optional

Reference to dms_document holding the certificate file

nullable
assignedAssetIds uuid[] optional

UUIDs of assets handed out to the employee (laptop, phone, keycard, …). Asset entity carries the canonical assignment record; this is a denormalised quick-access list.

Default: []nullable
idDocumentVerifications object[] optional

Append-only Liste der HR-Sichtprüfungen des Ausweisdokuments. Jede Verifikation speichert wer und wann geprüft hat — Dokumentennummer wird DSGVO-konform nicht erfasst.

max 200 ItemsDefault: []read-onlynullable
_id uuid optional
read-only
verifiedAt datetime erforderlich

Zeitpunkt der Sichtprüfung (server-issued)

verifiedBy uuid erforderlich

User-UUID der prüfenden HR-Person

verifiedByName string optional

Anzeigename zum Zeitpunkt der Prüfung (Snapshot)

max 200 Zeichennullable
documentType string optional

Dokumenttyp zum Zeitpunkt der Prüfung (PERSONALAUSWEIS, REISEPASS, AUFENTHALTSTITEL, …) — Snapshot, damit Typänderungen die Historie nicht verfälschen.

max 64 Zeichennullable
documentCountry string optional

ISO 3166-1 alpha-2 Ausstellerstaat zum Zeitpunkt der Prüfung — Snapshot.

max 2 ZeichenPatternnullable
notes string optional
max 500 Zeichennullable
encryptedFields object optional

Map of field-name → encrypted envelope (AES-256-GCM, employee DEK). See EMPLOYEE_PROFILE_ZK_FIELDS for the registered field set and visibility category.

nullable
starfaceAccountId string optional

Starface ACCOUNT_ID this employee maps to (matched by email).

max 32 Zeichenread-onlynullable
starfaceLoginId string optional

Starface LOGIN_ID (informational).

max 64 Zeichenread-onlynullable
starfaceInternalNumber string optional

Starface primary internal number (informational).

max 64 Zeichenread-onlynullable
starfaceExternalNumber string optional

Starface primary external number (informational).

max 64 Zeichenread-onlynullable
notes string optional

Free-text notes for HR admin

max 10000 Zeichennullable

Custom-Endpoints (/api/v1/hr/...)

Über CRUD hinaus gibt es dedizierte HR-Endpoints. Auszug:

OperationHinweis
POST /api/v1/hr/employees/<id>/onboardOnboarding-Workflow starten
POST /api/v1/hr/employees/<id>/offboardOffboarding-Workflow starten
GET /api/v1/hr/vacation-balance/<userId>Aktuelle Urlaubsstände
POST /api/v1/vacation_requests/<id>/approveUrlaubs-Antrag genehmigen

Abwesenheiten

Urlaub und Krankmeldung laufen über zwei getrennte Entities. Anträge haben typischerweise Status requested, approved, rejected, cancelled. Vorlauf-, Vertretungs- und Approver-Regeln liegen pro Mandant als typisierte Konfiguration am working_time_model.

POST /api/v1/vacation_requests
{
  "employeeProfileId": "0193…",
  "startDate": "2026-07-01",
  "endDate": "2026-07-14",
  "reason": "Familienurlaub"
}

Payroll-Export

Der LODAS-Export läuft über einen async Job:

POST /api/v1/payroll_exports
{ "periodId": "0193…", "format": "lodas" }

Ergebnis wird als File-Storage-Pointer im payroll_export-Datensatz hinterlegt. Aktuelle Konfiguration kommt aus payroll_lodas_settings.

Verwandt

Suche