API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · org_units

Org Unit Schema

ID del esquema
org_unit
Colección
org_units
Permisos
  • Leerorg_unit_view
  • Crearorg_unit_create
  • Modificarorg_unit_edit
  • Eliminarorg_unit_delete

Campos

Org Unit Schema

org_units4 permisos

Schema for organisational units (Abteilungen, Teams)

namestringobligatorio

Name of the organisational unit

1–200 caracteres
parentUnitIduuidopcional

Parent org unit ID for hierarchical structures

admite null
kindstringopcional

Structural classification (ADR 0107). TEAM = operational unit (people work here, customers get assigned here); DEPARTMENT = Abteilung (mid-layer); DIVISION = Fachbereich (top-layer, carries cost-center/budget identity). Informational by default — actual permission behavior is driven by data_scope.* and parties.allowed_assignment_ou_kinds setting_overrides.

TEAMDEPARTMENTDIVISION
Valor por defecto: "TEAM"
managerIdsuuid[]opcional

User IDs of the unit managers/leads. Supports co-leadership (Doppelspitze): all entries are equal leads — each is a SpiceDB `manager` and a valid approver source (ADR 0144). Replaces the former single `managerId` field (ADR 0148).

Valor por defecto: []
descriptionstringopcional

Description of the organisational unit

máx. 2000 caracteresadmite null
costCenterIduuidopcional

FK auf cost_center. Wird von Positionen dieser OU geerbt; Positionen können übersteuern. Siehe ADR 0116a.

admite null
isActivebooleanopcional

Whether this unit is currently active

Valor por defecto: true
excludeFromAutoSkillsbooleanopcional

ADR 0910 — members of this unit (and of its sub-units) receive NO automatic skill changes: no XP on ticket/task completion, no level change from a satisfaction survey. Manual assignment, grant-xp, certificates and LMS courses are unaffected. Fail-closed: membership in one flagged unit wins over any unflagged one. Written via the org-unit routes (allowlist in orgunit.routes.ts), like excludeFromDataScopes.

Valor por defecto: false
dispatchLeadModestringopcional

Whether the auto-dispatch may suggest the leads (managerIds) of this unit: ALWAYS = like any other member, CRITICAL_ONLY = only on tickets the ticket or the AI rates CRITICAL, NEVER = not at all. A person leading several units gets the strictest mode. Missing = ALWAYS (no backfill). Written via the org-unit routes (allowlist in orgunit.routes.ts).

ALWAYSCRITICAL_ONLYNEVER
Valor por defecto: "ALWAYS"
timeZonestringopcional

IANA-Zeitzone des Unit-Standorts (z.B. "Europe/Berlin"). Wird vom Working-Time-Resolver für Schicht-/Zuschlag-Zeitfenster benutzt. Override gegenüber Tenant-Default, überschrieben durch employee_profile.timeZone.

máx. 64 caracteresadmite null
holidayRegionstringopcional

ISO 3166-2 Feiertagsregion der Unit (z.B. "DE-NW"). Override gegenüber tenant.settings.defaultHolidayRegion, überschrieben durch employee_profile.holidayRegion.

Patrónadmite null
absenceApprovalConfigobjectopcional

ADR 0682 — Ob und durch wen Abwesenheitsanträge genehmigt werden. Jedes Feld ist optional; null/fehlend bedeutet „von der übergeordneten Ebene erben" (Mitarbeiter → Team → Abteilung → Bereich → Mandant → Standard).

admite null
modestringopcional

REQUIRED = Antrag muss genehmigt werden (Standard). NONE = Antrag wird beim Anlegen sofort genehmigt, es entsteht keine Genehmigungsanfrage.

REQUIREDNONEnull
admite null
approverModestringopcional

ORG_UNIT_LEAD = Leitung der Organisationseinheit (Standard, mit Kette über die übergeordnete Einheit). SPECIFIC_USERS = feste Personen. ROLE = alle Inhaber einer Rolle.

ORG_UNIT_LEADSPECIFIC_USERSROLEnull
admite null
approverUserIdsuuid[]opcional

Nur bei approverMode=SPECIFIC_USERS: die genehmigenden Personen.

admite null
approverRoleSlugstringopcional

Nur bei approverMode=ROLE: Slug der Rolle aus role_definitions (z. B. "hr").

máx. 100 caracteresadmite null
allowSelfApprovalAsLeadbooleanopcional

Standard true. Darf eine Person ihren eigenen Antrag genehmigen, wenn sie selbst Leitung ihrer Einheit ist und weder Doppelspitze noch übergeordnete Leitung gepflegt sind? Gilt NUR für Leitungen — ein Mitarbeitender ohne gepflegte Teamleitung genehmigt sich dadurch nicht selbst.

admite null
fallbackApproverUserIdsuuid[]opcional

Auffanglinie: greift, wenn die reguläre Kette keine erreichbaren Genehmiger liefert.

admite null
overtimeApprovalConfigobjectopcional

ADR 0709 — Ob eine Leitung die eigene Überstundenbuchung freigeben darf. Jedes Feld ist optional; null/fehlend bedeutet „von der übergeordneten Ebene erben" (Mitarbeiter → Team → Abteilung → Bereich → Mandant → Standard).

admite null
allowSelfApprovalAsLeadbooleanopcional

Standard FALSE (anders als bei der Urlaubsgenehmigung — ohne ausdrückliche Einstellung bleibt es beim 4-Augen-Prinzip). Darf eine Person ihre eigene Überstundenbuchung freigeben, wenn sie Leitung einer ihrer Einheiten ist? Gilt NUR für Leitungen; wer die Berechtigung overtime_approve ohne Leitungsfunktion hat, kann sich dadurch nicht selbst freigeben. Anders als beim Urlaub greift die Regel auch dann, wenn eine zweite oder übergeordnete Leitung verfügbar wäre.

admite null
dailyClosingConfigobjectopcional

Configuration for daily closing (Tagesabschluss) requirement

admite null
enabledbooleanopcional

Whether daily closing is required for this org unit

Valor por defecto: false
deadlineTimestringopcional

Deadline for daily closing (HH:MM, e.g. 18:00)

Patrón
reminderMinutesBeforeintegeropcional

Minutes before deadline to send reminder

≥ 0Valor por defecto: 30
excludeWeekendsbooleanopcional

Whether weekends are excluded from daily closing requirement

Valor por defecto: true
staffingRulesobject[]opcional

Minimum staffing rules for this org unit

Valor por defecto: []
iduuidobligatorio

Unique rule identifier (UUIDv7)

ruleTypestringobligatorio

Type of staffing rule

MIN_HEADCOUNTMIN_HEADCOUNT_WITH_SKILL
minCountnumberobligatorio

Minimum number of employees required

1 – 100
skillIduuidopcional

Required skill (for MIN_HEADCOUNT_WITH_SKILL)

admite null
minSkillLevelstringopcional

Minimum proficiency level for the required skill

BEGINNERINTERMEDIATEADVANCEDEXPERT
admite null
timeWindowobjectopcional

Time window for the rule (defaults to core hours)

admite null
startTimestringobligatorio
Patrón
endTimestringobligatorio
Patrón
daysOfWeeknumber[]opcional

ISO weekdays (1=Mon … 7=Sun), defaults to Mon-Fri

admite null
isActivebooleanobligatorio

Whether this rule is currently active

Valor por defecto: true
skillTargetsobject[]opcional

Strategic skill staffing targets for this org unit (e.g. "≥2 Mitarbeiter müssen M365 Administration auf Experten-Level beherrschen"). Targets are NOT inherited downward — they apply only to the OU they are defined on. However, members of sub-OUs DO contribute to the target count when evaluating coverage (transitive members count). Used by the Skill-Matrix to flag Lücken. Distinct from staffingRules, which model shift-time coverage (timeWindow/daysOfWeek). See ADR 0137.

Valor por defecto: []
iduuidobligatorio

Unique target identifier (UUIDv7)

skillIduuidobligatorio

FK to skill_definitions._id (leaf or parent skill)

minHoldersintegerobligatorio

Minimum number of employees that must meet the target

1 – 100
minLevelstringopcional

Minimum proficiency tier required. NULL means any level counts (and is implied for binary skills, which have no level).

BEGINNERINTERMEDIATEADVANCEDEXPERT
admite null
notesstringopcional

Free-text rationale / context for this target

máx. 500 caracteresadmite null

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/org_units — Lista, paginada y filtrable
  • GET /api/v1/org_units/<id> — Una entidad
  • POST /api/v1/org_units — Crear
  • PATCH /api/v1/org_units/<id> — Actualización parcial
  • DELETE /api/v1/org_units/<id> — Eliminación lógica
  • GET /api/v1/org_units/<id>/timeline — Auditoría y actividades

Búsqueda