API · v1 · stabil
CODEMETA OSDeveloper Center
Konsole öffnen
Entity · dms_document_types

DMS Document Type Schema

Schema-ID
dms_document_type
Collection
dms_document_types
Permissions
  • Lesendms_document_type_view
  • Anlegendms_document_type_create
  • Änderndms_document_type_edit
  • Löschendms_document_type_delete

Felder

DMS Document Type Schema

dms_document_types4 Permissions

Schema for defining DMS document types (Dokumententypen / Archive) with custom field definitions

namestringerforderlich

Document type name (e.g. Eingangsrechnung, Vertrag)

1–200 Zeichen
keystringoptional

Stable snake_case identifier (e.g. incoming_invoice). Required + immutable for system types; optional for tenant-custom types.

1–100 ZeichenPatternread-onlynullable
isSystembooleanoptional

Plattform-Seed. Nicht löschbar; key/scope/retentionMode immutable. Setzbar nur durch Seed-Service.

Default: falseread-only
scopestringoptional

Fachliche Gruppierung (Posteingang-Tabs, Berechtigungen, Reporting). System-Types tragen einen Scope; Custom-Types optional.

financesalesprocurementhrlegalcomplianceit_opsgeneral
read-onlynullable
descriptionstringoptional
max 1000 Zeichennullable
iconstringoptional

Icon name from the Icons registry

max 50 Zeichennullable
colorstringoptional

Badge color (hex or CSS variable)

max 20 Zeichennullable
fieldsobject[]optional

Custom field definitions for this document type

Default: []
keystringerforderlich

camelCase field identifier, used as key in customFields

1–100 ZeichenPatternread-only
labelstringerforderlich

Display label for the field

1–200 Zeichen
typestringerforderlich

Field value type

texttextareanumbercurrencydatedatetimeselectmultiselectcheckboxrelation
requiredbooleanoptional
Default: false
optionsobject[]optional

Options for select/multiselect fields

nullable
valuestringerforderlich
labelstringerforderlich
defaultValueanyoptional

Default value for new documents (any JSON value).

placeholderstringoptional
max 200 Zeichennullable
groupstringoptional

Visual grouping label for form sections

max 100 Zeichennullable
sortOrdernumberoptional

Display order within group

Default: 0
widthnumberoptional

Grid column width (out of 12)

346812
Default: 6
extractionHintstringoptional

Natural language hint for LLM extraction (e.g. "Rechnungsnummer")

max 500 Zeichennullable
extractionPathstringoptional

JSON path for structured data (e.g. ZUGFeRD XML)

max 200 Zeichennullable
relationConfigobjectoptional
nullable
targetCollectionstringoptional

Target collection (e.g. parties, contracts)

displayFieldstringoptional

Field to display from target (e.g. name)

defaultStatusstringoptional

Default status for new documents of this type

DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVED
Default: "DRAFT"
autoExtractbooleanoptional

Auto-trigger LLM/OCR extraction on upload

Default: true
retentionDaysnumberoptional

Auto-archive after N days

≥ 1nullable
retentionPolicyIduuidoptional

Linked retention policy

nullable
retentionModestringoptional

S3 Object-Lock-Modus: 'compliance' für Buchhaltungs-Belege (§ 147 AO), 'governance' für HR/Verträge (DSGVO-Balance), 'none' für ephemere Dokumente.

nonegovernancecompliance
Default: "none"read-only
retentionMonthsnumberoptional

Aufbewahrungsdauer in Monaten ab retentionStartTrigger. Beispiele: 120 (10 Jahre § 147 AO), 72 (6 Jahre § 257 HGB), 12 (DSGVO-Min für Bewerbungen).

0 – 1200nullable
retentionStartTriggerstringoptional

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.

createdAtfiscalYearEndcontractEndemployeeLeftmanualField
Default: "createdAt"read-only
retentionStartFieldKeystringoptional

Bei retentionStartTrigger='manualField': Pfad auf das Datum-Feld (z.B. 'customFields.contractEndDate').

max 100 ZeichenPatternnullable
legalBasisstringoptional

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.

max 200 Zeichennullable
requireApprovalBeforeLockbooleanoptional

Wenn true, wird der COMPLIANCE-Lock erst nach Status-Übergang nach APPROVED gesetzt (sonst sofort nach Klassifikation). Verhindert Lock-Theater bei Falsch-Klassifikation.

Default: false
workflowobjectoptional

Custom workflow definition for this document type. If null, default workflow is used.

nullable
statusesobject[]optional

Custom status definitions (replaces default DRAFT/NEEDS_REVIEW/...)

idstringerforderlich

Status identifier (e.g. DRAFT, IN_REVIEW)

1–50 ZeichenPattern
labelstringerforderlich

Display label (i18n key or plain text)

1–100 Zeichen
colorstringoptional

Badge color (hex or MUI color name)

max 20 Zeichennullable
iconstringoptional

Icon name for this status

max 50 Zeichennullable
isFinalbooleanoptional

If true, no further transitions are allowed from this status

Default: false
transitionsobject[]optional

Allowed transitions between statuses

fromstringerforderlich

Source status ID

tostringerforderlich

Target status ID

labelstringoptional

Button label for this transition

max 100 Zeichennullable
requiredPermissionstringoptional

Permission required (e.g. dms_document_approve)

max 100 Zeichennullable
requireCommentbooleanoptional

User must provide a comment/reason for this transition

Default: false
autoAssignstringoptional

Auto-assign to role on transition (e.g. "accounting")

max 50 Zeichennullable
webhookUrlurioptional

Trigger webhook on transition

nullable
colorstringoptional

Button color for this transition

primarysuccesserrorwarninginherit
nullable
initialStatusstringoptional

Starting status for new documents (defaults to first status in list)

nullable
formLayoutIduuidoptional

Optional custom form layout (overrides auto-generated form)

nullable
defaultEncryptionstringoptional

Default encryption mode for documents of this type. Server never sees plaintext when set to zero-knowledge.

nonezero-knowledge
Default: "none"
defaultWrapPolicyobjectoptional

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.

nullable
includeEmployeebooleanoptional

Wrap the DEK for the subject employee (party-linked PERSON or employee_profile). Default true.

Default: true
includeManagerbooleanoptional

Wrap the DEK for the employee's direct manager (auto-tracked).

Default: false
rolesstring[]optional

Permission strings whose holders are auto-wrapped (e.g. "dms_hr_officer", "payroll_manage").

Default: []
explicitUserIdsuuid[]optional

Explicit user UUIDs to always include in the wrap list.

Default: []
isActivebooleanoptional
Default: true
sortOrdernumberoptional
Default: 0
inboxFilterEnabledbooleanoptional

Wenn true, erscheint dieser Doktyp als eigener Filter-Tab im DMS-Posteingang (sortiert nach sortOrder).

Default: false
extractionProfilestringoptional

Name of the extraction profile (e.g. "invoice_v1") used to pull structured fields via OCR + LLM.

max 100 Zeichennullable
defaultFilingPolicyIduuidoptional

Fallback filing policy — used when no higher-priority policy matches the upload context.

nullable
onClassificationSpawnEntityobjectoptional

Auto-action when this document type is detected. Spawn a new entity, attach to an existing one, or both (attach-or-spawn).

nullable
modestringoptional

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_spawn
Default: "spawn"
targetEntityTypestringerforderlich
1–100 Zeichen
confidenceThresholdnumbererforderlich
0 – 1
fieldMappingsobject[]erforderlich
extractedFieldstringerforderlich
1–200 Zeichen
targetFieldstringerforderlich
1–200 Zeichen
transformstringoptional
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanoptional
Default: false
lookupFieldsobject[]optional

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.

nullable
extractedFieldstringerforderlich
1–200 Zeichen
targetEntityFieldstringerforderlich
1–200 Zeichen
transformstringoptional
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanoptional
Default: true
linkRolestringoptional
max 100 Zeichennullable
linkBackToDocumentbooleanoptional
Default: true
requireHumanApprovalbooleanoptional
Default: false
dedupeBystring[]optional
nullable
postClassificationActionsobject[]optional

Geordnete Aktionsliste, die nach Klassifizierung sequenziell ausgeführt wird (Workflow / Entity-Spawn / Filing-Policy / Notification).

Default: []
iduuiderforderlich
typestringerforderlich
workflowentity_spawnfiling_policynotification
enabledbooleanerforderlich
Default: true
namestringoptional
max 200 Zeichennullable
confidenceThresholdnumberoptional
0 – 1nullable
continueOnErrorbooleanoptional
Default: false
configobjecterforderlich
classificationRulesobject[]optional

Deterministic classification rules evaluated before the LLM fallback. Each rule contributes its weight to the document type score when matched.

Default: []
iduuiderforderlich

Stable rule identifier (UUIDv7).

labelstringoptional

Optional human-readable name.

max 200 Zeichennullable
patternTypestringerforderlich
keywordregexbuiltin
patternstringerforderlich

Literal substring (keyword), regex source (regex) or built-in key (e.g. 'iban').

1–500 Zeichen
weightnumbererforderlich

Positive boosts the document type score; negative reduces it.

-10 – 10
requiredbooleanoptional

Veto rule: if true and the pattern does not match, the document type is excluded entirely.

Default: false
fieldstringoptional
ocrTextfileNamemimeTypesenderDomainfolderPathall
Default: "ocrText"
positionstringoptional

Only meaningful when field='ocrText'.

firstPagelastPageany
Default: "any"
caseSensitivebooleanoptional
Default: false
classificationRuleThresholdnumberoptional

Minimum total score (0-100) required for the rule classifier to declare a winner. Below this, the LLM fallback is used.

0 – 100Default: 30
postProcessingobjectoptional

Workflow-Lifecycle-Hooks pro Doktyp. Jeder Slot ist optional und referenziert eine workflowDefinitionId.

nullable
onClassifiedobjectoptional
nullable
workflowDefinitionIduuiderforderlich
minConfidencenumberoptional

Workflow läuft nur, wenn classificationConfidence >= minConfidence. Default 0 (immer feuern).

0 – 1Default: 0
onExtractedobjectoptional
nullable
workflowDefinitionIduuiderforderlich
requireFieldsstring[]optional

Workflow läuft nur, wenn alle genannten extrahierten Felder Werte haben (verhindert leere Trigger bei OCR-Fehlern).

nullable
onFiledobjectoptional
nullable
workflowDefinitionIduuiderforderlich

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 + filterbar
  • GET /api/v1/dms_document_types/<id> — Einzelne Entity
  • POST /api/v1/dms_document_types — Anlegen
  • PATCH /api/v1/dms_document_types/<id> — Teil-Update
  • DELETE /api/v1/dms_document_types/<id> — Soft-Delete
  • GET /api/v1/dms_document_types/<id>/timeline — Audit + Aktivitäten

Suche