API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Entity · dms_document_types

DMS Document Type Schema

Schema ID
dms_document_type
Collection
dms_document_types
Permissions
  • Readdms_document_type_view
  • Createdms_document_type_create
  • Editdms_document_type_edit
  • Deletedms_document_type_delete

Fields

DMS Document Type Schema

dms_document_types4 permissions

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

namestringrequired

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

1–200 characters
keystringoptional

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

1–100 charactersPatternread-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 charactersnullable
iconstringoptional

Icon name from the Icons registry

max 50 charactersnullable
colorstringoptional

Badge color (hex or CSS variable)

max 20 charactersnullable
fieldsobject[]optional

Custom field definitions for this document type

Default: []
keystringrequired

camelCase field identifier, used as key in customFields

1–100 charactersPatternread-only
labelstringrequired

Display label for the field

1–200 characters
typestringrequired

Field value type

texttextareanumbercurrencydatedatetimeselectmultiselectcheckboxrelation
requiredbooleanoptional
Default: false
optionsobject[]optional

Options for select/multiselect fields

nullable
valuestringrequired
labelstringrequired
defaultValueanyoptional

Default value for new documents (any JSON value).

placeholderstringoptional
max 200 charactersnullable
groupstringoptional

Visual grouping label for form sections

max 100 charactersnullable
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 charactersnullable
extractionPathstringoptional

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

max 200 charactersnullable
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
retentionMinMonthsnumberoptional

Nur lesend: Untergrenze von retentionMonths bei einem System-Typ (seine Vorgabe). Wird beim Lesen berechnet und nie gespeichert — steht im Schema und in protectedFields, damit ein Client das gelesene Dokument unverändert zurückschicken kann.

read-onlynullable
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 charactersPatternnullable
retentionAfterExpirystringoptional

Was nach Ablauf von retentionMonths geschieht: 'suggest_deletion' = die nächtliche Runde nimmt das Dokument in die Liste „Löschung vorschlagen“ auf (gelöscht wird nur nach Bestätigung, soft); 'keep' = weiter aufbewahren. Fehlt = 'suggest_deletion'.

suggest_deletionkeepnull
nullable
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 charactersnullable
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/...)

idstringrequired

Status identifier (e.g. DRAFT, IN_REVIEW)

1–50 charactersPattern
labelstringrequired

Display label (i18n key or plain text)

1–100 characters
colorstringoptional

Badge color (hex or MUI color name)

max 20 charactersnullable
iconstringoptional

Icon name for this status

max 50 charactersnullable
isFinalbooleanoptional

If true, no further transitions are allowed from this status

Default: false
transitionsobject[]optional

Allowed transitions between statuses

fromstringrequired

Source status ID

tostringrequired

Target status ID

labelstringoptional

Button label for this transition

max 100 charactersnullable
requiredPermissionstringoptional

Permission required (e.g. dms_document_approve)

max 100 charactersnullable
requireCommentbooleanoptional

User must provide a comment/reason for this transition

Default: false
autoAssignstringoptional

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

max 50 charactersnullable
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 charactersnullable
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"
targetEntityTypestringrequired
1–100 characters
confidenceThresholdnumberrequired
0 – 1
fieldMappingsobject[]required
extractedFieldstringrequired
1–200 characters
targetFieldstringrequired
1–200 characters
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
extractedFieldstringrequired
1–200 characters
targetEntityFieldstringrequired
1–200 characters
transformstringoptional
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanoptional
Default: true
linkRolestringoptional
max 100 charactersnullable
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: []
iduuidrequired
typestringrequired
workflowentity_spawnfiling_policynotification
enabledbooleanrequired
Default: true
namestringoptional
max 200 charactersnullable
confidenceThresholdnumberoptional
0 – 1nullable
continueOnErrorbooleanoptional
Default: false
configobjectrequired
classificationRulesobject[]optional

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

Default: []
iduuidrequired

Stable rule identifier (UUIDv7).

labelstringoptional

Optional human-readable name.

max 200 charactersnullable
patternTypestringrequired
keywordregexbuiltin
patternstringrequired

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

1–500 characters
weightnumberrequired

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
minConfidencenumberoptional

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

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

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

nullable
onFiledobjectoptional
nullable

Standard endpoints

This resource follows the platform's generic CRUD contract. Read the conventions for pagination, idempotency, optimistic locking and audit. The most important endpoints:

  • GET /api/v1/dms_document_types — List, paginated + filterable
  • GET /api/v1/dms_document_types/<id> — Single entity
  • POST /api/v1/dms_document_types — Create
  • PATCH /api/v1/dms_document_types/<id> — Partial update
  • DELETE /api/v1/dms_document_types/<id> — Soft delete
  • GET /api/v1/dms_document_types/<id>/timeline — Audit + activities

Search