API · v1 · stabiel
CODEMETA OSDeveloper Center
NL
Console openen
Entity · dms_document_types

DMS Document Type Schema

Schema-ID
dms_document_type
Collection
dms_document_types
Permissions
  • Lezendms_document_type_view
  • Aanmakendms_document_type_create
  • Wijzigendms_document_type_edit
  • Verwijderendms_document_type_delete

Velden

DMS Document Type Schema

dms_document_types4 permissions

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

namestringvereist

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

1–200 tekens
keystringoptioneel

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

1–100 tekensPatternread-onlynullable
isSystembooleanoptioneel

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

Default: falseread-only
scopestringoptioneel

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

financesalesprocurementhrlegalcomplianceit_opsgeneral
read-onlynullable
descriptionstringoptioneel
max. 1000 tekensnullable
iconstringoptioneel

Icon name from the Icons registry

max. 50 tekensnullable
colorstringoptioneel

Badge color (hex or CSS variable)

max. 20 tekensnullable
fieldsobject[]optioneel

Custom field definitions for this document type

Default: []
keystringvereist

camelCase field identifier, used as key in customFields

1–100 tekensPatternread-only
labelstringvereist

Display label for the field

1–200 tekens
typestringvereist

Field value type

texttextareanumbercurrencydatedatetimeselectmultiselectcheckboxrelation
requiredbooleanoptioneel
Default: false
optionsobject[]optioneel

Options for select/multiselect fields

nullable
valuestringvereist
labelstringvereist
defaultValueanyoptioneel

Default value for new documents (any JSON value).

placeholderstringoptioneel
max. 200 tekensnullable
groupstringoptioneel

Visual grouping label for form sections

max. 100 tekensnullable
sortOrdernumberoptioneel

Display order within group

Default: 0
widthnumberoptioneel

Grid column width (out of 12)

346812
Default: 6
extractionHintstringoptioneel

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

max. 500 tekensnullable
extractionPathstringoptioneel

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

max. 200 tekensnullable
relationConfigobjectoptioneel
nullable
targetCollectionstringoptioneel

Target collection (e.g. parties, contracts)

displayFieldstringoptioneel

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

defaultStatusstringoptioneel

Default status for new documents of this type

DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVED
Default: "DRAFT"
autoExtractbooleanoptioneel

Auto-trigger LLM/OCR extraction on upload

Default: true
retentionDaysnumberoptioneel

Auto-archive after N days

≥ 1nullable
retentionPolicyIduuidoptioneel

Linked retention policy

nullable
retentionModestringoptioneel

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
retentionMonthsnumberoptioneel

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

0 – 1200nullable
retentionMinMonthsnumberoptioneel

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
retentionStartTriggerstringoptioneel

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
retentionStartFieldKeystringoptioneel

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

max. 100 tekensPatternnullable
retentionAfterExpirystringoptioneel

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
legalBasisstringoptioneel

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 tekensnullable
requireApprovalBeforeLockbooleanoptioneel

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
workflowobjectoptioneel

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

nullable
statusesobject[]optioneel

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

idstringvereist

Status identifier (e.g. DRAFT, IN_REVIEW)

1–50 tekensPattern
labelstringvereist

Display label (i18n key or plain text)

1–100 tekens
colorstringoptioneel

Badge color (hex or MUI color name)

max. 20 tekensnullable
iconstringoptioneel

Icon name for this status

max. 50 tekensnullable
isFinalbooleanoptioneel

If true, no further transitions are allowed from this status

Default: false
transitionsobject[]optioneel

Allowed transitions between statuses

fromstringvereist

Source status ID

tostringvereist

Target status ID

labelstringoptioneel

Button label for this transition

max. 100 tekensnullable
requiredPermissionstringoptioneel

Permission required (e.g. dms_document_approve)

max. 100 tekensnullable
requireCommentbooleanoptioneel

User must provide a comment/reason for this transition

Default: false
autoAssignstringoptioneel

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

max. 50 tekensnullable
webhookUrlurioptioneel

Trigger webhook on transition

nullable
colorstringoptioneel

Button color for this transition

primarysuccesserrorwarninginherit
nullable
initialStatusstringoptioneel

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

nullable
formLayoutIduuidoptioneel

Optional custom form layout (overrides auto-generated form)

nullable
defaultEncryptionstringoptioneel

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

nonezero-knowledge
Default: "none"
defaultWrapPolicyobjectoptioneel

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
includeEmployeebooleanoptioneel

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

Default: true
includeManagerbooleanoptioneel

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

Default: false
rolesstring[]optioneel

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

Default: []
explicitUserIdsuuid[]optioneel

Explicit user UUIDs to always include in the wrap list.

Default: []
isActivebooleanoptioneel
Default: true
sortOrdernumberoptioneel
Default: 0
inboxFilterEnabledbooleanoptioneel

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

Default: false
extractionProfilestringoptioneel

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

max. 100 tekensnullable
defaultFilingPolicyIduuidoptioneel

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

nullable
onClassificationSpawnEntityobjectoptioneel

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

nullable
modestringoptioneel

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"
targetEntityTypestringvereist
1–100 tekens
confidenceThresholdnumbervereist
0 – 1
fieldMappingsobject[]vereist
extractedFieldstringvereist
1–200 tekens
targetFieldstringvereist
1–200 tekens
transformstringoptioneel
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanoptioneel
Default: false
lookupFieldsobject[]optioneel

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
extractedFieldstringvereist
1–200 tekens
targetEntityFieldstringvereist
1–200 tekens
transformstringoptioneel
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanoptioneel
Default: true
linkRolestringoptioneel
max. 100 tekensnullable
linkBackToDocumentbooleanoptioneel
Default: true
requireHumanApprovalbooleanoptioneel
Default: false
dedupeBystring[]optioneel
nullable
postClassificationActionsobject[]optioneel

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

Default: []
iduuidvereist
typestringvereist
workflowentity_spawnfiling_policynotification
enabledbooleanvereist
Default: true
namestringoptioneel
max. 200 tekensnullable
confidenceThresholdnumberoptioneel
0 – 1nullable
continueOnErrorbooleanoptioneel
Default: false
configobjectvereist
classificationRulesobject[]optioneel

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

Default: []
iduuidvereist

Stable rule identifier (UUIDv7).

labelstringoptioneel

Optional human-readable name.

max. 200 tekensnullable
patternTypestringvereist
keywordregexbuiltin
patternstringvereist

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

1–500 tekens
weightnumbervereist

Positive boosts the document type score; negative reduces it.

-10 – 10
requiredbooleanoptioneel

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

Default: false
fieldstringoptioneel
ocrTextfileNamemimeTypesenderDomainfolderPathall
Default: "ocrText"
positionstringoptioneel

Only meaningful when field='ocrText'.

firstPagelastPageany
Default: "any"
caseSensitivebooleanoptioneel
Default: false
classificationRuleThresholdnumberoptioneel

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

0 – 100Default: 30
postProcessingobjectoptioneel

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

nullable
onClassifiedobjectoptioneel
nullable
minConfidencenumberoptioneel

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

0 – 1Default: 0
onExtractedobjectoptioneel
nullable
requireFieldsstring[]optioneel

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

nullable
onFiledobjectoptioneel
nullable

Standaard-endpoints

Deze resource volgt het generieke CRUD-contract van het platform. Lees de conventies voor paginering, idempotentie, optimistic locking en audit. De belangrijkste endpoints:

  • GET /api/v1/dms_document_types — Lijst, gepagineerd + filterbaar
  • GET /api/v1/dms_document_types/<id> — Enkele entity
  • POST /api/v1/dms_document_types — Aanmaken
  • PATCH /api/v1/dms_document_types/<id> — Gedeeltelijke update
  • DELETE /api/v1/dms_document_types/<id> — Soft-delete
  • GET /api/v1/dms_document_types/<id>/timeline — Audit + activiteiten

Zoeken