DMS Document Type Schema
Felder
DMS Document Type Schema
Schema for defining DMS document types (Dokumententypen / Archive) with custom field definitions
name
Document type name (e.g. Eingangsrechnung, Vertrag)
key
Stable snake_case identifier (e.g. incoming_invoice). Required + immutable for system types; optional for tenant-custom types.
isSystem
Plattform-Seed. Nicht löschbar; key/scope/retentionMode immutable. Setzbar nur durch Seed-Service.
scope
Fachliche Gruppierung (Posteingang-Tabs, Berechtigungen, Reporting). System-Types tragen einen Scope; Custom-Types optional.
financesalesprocurementhrlegalcomplianceit_opsgeneraldescription
icon
Icon name from the Icons registry
color
Badge color (hex or CSS variable)
fields
Custom field definitions for this document type
key
camelCase field identifier, used as key in customFields
label
Display label for the field
type
Field value type
texttextareanumbercurrencydatedatetimeselectmultiselectcheckboxrelationrequired
defaultValue
Default value for new documents (any JSON value).
placeholder
group
Visual grouping label for form sections
sortOrder
Display order within group
width
Grid column width (out of 12)
346812extractionHint
Natural language hint for LLM extraction (e.g. "Rechnungsnummer")
extractionPath
JSON path for structured data (e.g. ZUGFeRD XML)
relationConfig
targetCollection
Target collection (e.g. parties, contracts)
displayField
Field to display from target (e.g. name)
defaultStatus
Default status for new documents of this type
DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVEDautoExtract
Auto-trigger LLM/OCR extraction on upload
retentionDays
Auto-archive after N days
retentionPolicyId
Linked retention policy
retentionMode
S3 Object-Lock-Modus: 'compliance' für Buchhaltungs-Belege (§ 147 AO), 'governance' für HR/Verträge (DSGVO-Balance), 'none' für ephemere Dokumente.
nonegovernancecomplianceretentionMonths
Aufbewahrungsdauer in Monaten ab retentionStartTrigger. Beispiele: 120 (10 Jahre § 147 AO), 72 (6 Jahre § 257 HGB), 12 (DSGVO-Min für Bewerbungen).
retentionStartTrigger
Wann die Aufbewahrungsuhr startet. 'fiscalYearEnd' für Buchhaltungs-Belege (§ 147 AO startet erst mit Ende des Kalenderjahrs), 'employeeLeft' für HR-Akten, 'contractEnd' für Verträge.
createdAtfiscalYearEndcontractEndemployeeLeftmanualFieldretentionStartFieldKey
Bei retentionStartTrigger='manualField': Pfad auf das Datum-Feld (z.B. 'customFields.contractEndDate').
legalBasis
Rechtliche Grundlage der Aufbewahrungspflicht (z.B. "§ 147 AO", "§ 257 HGB", "Art. 6(1)(c) DSGVO"). Wird im UI als Erklärung angezeigt, warum ein Dokument nicht löschbar ist.
requireApprovalBeforeLock
Wenn true, wird der COMPLIANCE-Lock erst nach Status-Übergang nach APPROVED gesetzt (sonst sofort nach Klassifikation). Verhindert Lock-Theater bei Falsch-Klassifikation.
workflow
Custom workflow definition for this document type. If null, default workflow is used.
statuses
Custom status definitions (replaces default DRAFT/NEEDS_REVIEW/...)
id
Status identifier (e.g. DRAFT, IN_REVIEW)
label
Display label (i18n key or plain text)
color
Badge color (hex or MUI color name)
icon
Icon name for this status
isFinal
If true, no further transitions are allowed from this status
transitions
Allowed transitions between statuses
from
Source status ID
to
Target status ID
label
Button label for this transition
requiredPermission
Permission required (e.g. dms_document_approve)
requireComment
User must provide a comment/reason for this transition
autoAssign
Auto-assign to role on transition (e.g. "accounting")
webhookUrl
Trigger webhook on transition
color
Button color for this transition
primarysuccesserrorwarninginheritinitialStatus
Starting status for new documents (defaults to first status in list)
formLayoutId
Optional custom form layout (overrides auto-generated form)
defaultEncryption
Default encryption mode for documents of this type. Server never sees plaintext when set to zero-knowledge.
nonezero-knowledgedefaultWrapPolicy
Default wrap-policy for the per-document DEK. Applied at upload time and used as starting ACL; uploaders may add or remove specific recipients per document.
includeEmployee
Wrap the DEK for the subject employee (party-linked PERSON or employee_profile). Default true.
includeManager
Wrap the DEK for the employee's direct manager (auto-tracked).
roles
Permission strings whose holders are auto-wrapped (e.g. "dms_hr_officer", "payroll_manage").
explicitUserIds
Explicit user UUIDs to always include in the wrap list.
isActive
sortOrder
inboxFilterEnabled
Wenn true, erscheint dieser Doktyp als eigener Filter-Tab im DMS-Posteingang (sortiert nach sortOrder).
extractionProfile
Name of the extraction profile (e.g. "invoice_v1") used to pull structured fields via OCR + LLM.
defaultFilingPolicyId
Fallback filing policy — used when no higher-priority policy matches the upload context.
onClassificationSpawnEntity
Auto-action when this document type is detected. Spawn a new entity, attach to an existing one, or both (attach-or-spawn).
mode
Auto-action mode: 'spawn' creates a new entity (legacy behaviour), 'attach' only links to an existing entity, 'attach_or_spawn' tries attach first and falls back to spawn.
spawnattachattach_or_spawntargetEntityType
confidenceThreshold
fieldMappings
extractedField
targetField
transform
parseDateparseCurrencytrimupperlowerasIsrequired
lookupFields
For 'attach' / 'attach_or_spawn': fields used to find the existing entity. Each row maps an extracted field to a target entity field; the lookup is an AND of all required entries.
extractedField
targetEntityField
transform
parseDateparseCurrencytrimupperlowerasIsrequired
linkRole
linkBackToDocument
requireHumanApproval
dedupeBy
postClassificationActions
Geordnete Aktionsliste, die nach Klassifizierung sequenziell ausgeführt wird (Workflow / Entity-Spawn / Filing-Policy / Notification).
type
workflowentity_spawnfiling_policynotificationenabled
name
confidenceThreshold
continueOnError
classificationRules
Deterministic classification rules evaluated before the LLM fallback. Each rule contributes its weight to the document type score when matched.
id
Stable rule identifier (UUIDv7).
label
Optional human-readable name.
patternType
keywordregexbuiltinpattern
Literal substring (keyword), regex source (regex) or built-in key (e.g. 'iban').
weight
Positive boosts the document type score; negative reduces it.
required
Veto rule: if true and the pattern does not match, the document type is excluded entirely.
field
ocrTextfileNamemimeTypesenderDomainfolderPathallposition
Only meaningful when field='ocrText'.
firstPagelastPageanycaseSensitive
classificationRuleThreshold
Minimum total score (0-100) required for the rule classifier to declare a winner. Below this, the LLM fallback is used.
postProcessing
Workflow-Lifecycle-Hooks pro Doktyp. Jeder Slot ist optional und referenziert eine workflowDefinitionId.
onClassified
minConfidence
Workflow läuft nur, wenn classificationConfidence >= minConfidence. Default 0 (immer feuern).
onExtracted
requireFields
Workflow läuft nur, wenn alle genannten extrahierten Felder Werte haben (verhindert leere Trigger bei OCR-Fehlern).
onFiled
Keine Felder passen zum Filter.
Standard-Endpoints
Diese Resource folgt dem generischen CRUD-Vertrag der Plattform. Lesen Sie die Konventionen für Pagination, Idempotenz, Optimistic Locking und Audit. Die wichtigsten Endpoints:
GET /api/v1/dms_document_types— Liste, paginiert + filterbarGET /api/v1/dms_document_types/<id>— Einzelne EntityPOST /api/v1/dms_document_types— AnlegenPATCH /api/v1/dms_document_types/<id>— Teil-UpdateDELETE /api/v1/dms_document_types/<id>— Soft-DeleteGET /api/v1/dms_document_types/<id>/timeline— Audit + Aktivitäten