API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console
Entité · dms_document_types

DMS Document Type Schema

ID du schéma
dms_document_type
Collection
dms_document_types
Autorisations
  • Liredms_document_type_view
  • Créerdms_document_type_create
  • Modifierdms_document_type_edit
  • Supprimerdms_document_type_delete

Champs

DMS Document Type Schema

dms_document_types4 autorisations

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

namestringobligatoire

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

1–200 caractères
keystringfacultatif

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

1–100 caractèresMotiflecture seulenullable
isSystembooleanfacultatif

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

Par défaut : falselecture seule
scopestringfacultatif

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

financesalesprocurementhrlegalcomplianceit_opsgeneral
lecture seulenullable
descriptionstringfacultatif
max. 1000 caractèresnullable
iconstringfacultatif

Icon name from the Icons registry

max. 50 caractèresnullable
colorstringfacultatif

Badge color (hex or CSS variable)

max. 20 caractèresnullable
fieldsobject[]facultatif

Custom field definitions for this document type

Par défaut : []
keystringobligatoire

camelCase field identifier, used as key in customFields

1–100 caractèresMotiflecture seule
labelstringobligatoire

Display label for the field

1–200 caractères
typestringobligatoire

Field value type

texttextareanumbercurrencydatedatetimeselectmultiselectcheckboxrelation
requiredbooleanfacultatif
Par défaut : false
optionsobject[]facultatif

Options for select/multiselect fields

nullable
valuestringobligatoire
labelstringobligatoire
defaultValueanyfacultatif

Default value for new documents (any JSON value).

placeholderstringfacultatif
max. 200 caractèresnullable
groupstringfacultatif

Visual grouping label for form sections

max. 100 caractèresnullable
sortOrdernumberfacultatif

Display order within group

Par défaut : 0
widthnumberfacultatif

Grid column width (out of 12)

346812
Par défaut : 6
extractionHintstringfacultatif

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

max. 500 caractèresnullable
extractionPathstringfacultatif

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

max. 200 caractèresnullable
relationConfigobjectfacultatif
nullable
targetCollectionstringfacultatif

Target collection (e.g. parties, contracts)

displayFieldstringfacultatif

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

defaultStatusstringfacultatif

Default status for new documents of this type

DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVED
Par défaut : "DRAFT"
autoExtractbooleanfacultatif

Auto-trigger LLM/OCR extraction on upload

Par défaut : true
retentionDaysnumberfacultatif

Auto-archive after N days

≥ 1nullable
retentionPolicyIduuidfacultatif

Linked retention policy

nullable
retentionModestringfacultatif

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
Par défaut : "none"lecture seule
retentionMonthsnumberfacultatif

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

0 – 1200nullable
retentionMinMonthsnumberfacultatif

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.

lecture seulenullable
retentionStartTriggerstringfacultatif

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
Par défaut : "createdAt"lecture seule
retentionStartFieldKeystringfacultatif

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

max. 100 caractèresMotifnullable
retentionAfterExpirystringfacultatif

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
legalBasisstringfacultatif

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 caractèresnullable
requireApprovalBeforeLockbooleanfacultatif

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

Par défaut : false
workflowobjectfacultatif

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

nullable
statusesobject[]facultatif

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

idstringobligatoire

Status identifier (e.g. DRAFT, IN_REVIEW)

1–50 caractèresMotif
labelstringobligatoire

Display label (i18n key or plain text)

1–100 caractères
colorstringfacultatif

Badge color (hex or MUI color name)

max. 20 caractèresnullable
iconstringfacultatif

Icon name for this status

max. 50 caractèresnullable
isFinalbooleanfacultatif

If true, no further transitions are allowed from this status

Par défaut : false
transitionsobject[]facultatif

Allowed transitions between statuses

fromstringobligatoire

Source status ID

tostringobligatoire

Target status ID

labelstringfacultatif

Button label for this transition

max. 100 caractèresnullable
requiredPermissionstringfacultatif

Permission required (e.g. dms_document_approve)

max. 100 caractèresnullable
requireCommentbooleanfacultatif

User must provide a comment/reason for this transition

Par défaut : false
autoAssignstringfacultatif

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

max. 50 caractèresnullable
webhookUrlurifacultatif

Trigger webhook on transition

nullable
colorstringfacultatif

Button color for this transition

primarysuccesserrorwarninginherit
nullable
initialStatusstringfacultatif

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

nullable
formLayoutIduuidfacultatif

Optional custom form layout (overrides auto-generated form)

nullable
defaultEncryptionstringfacultatif

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

nonezero-knowledge
Par défaut : "none"
defaultWrapPolicyobjectfacultatif

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
includeEmployeebooleanfacultatif

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

Par défaut : true
includeManagerbooleanfacultatif

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

Par défaut : false
rolesstring[]facultatif

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

Par défaut : []
explicitUserIdsuuid[]facultatif

Explicit user UUIDs to always include in the wrap list.

Par défaut : []
isActivebooleanfacultatif
Par défaut : true
sortOrdernumberfacultatif
Par défaut : 0
inboxFilterEnabledbooleanfacultatif

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

Par défaut : false
extractionProfilestringfacultatif

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

max. 100 caractèresnullable
defaultFilingPolicyIduuidfacultatif

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

nullable
onClassificationSpawnEntityobjectfacultatif

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

nullable
modestringfacultatif

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
Par défaut : "spawn"
targetEntityTypestringobligatoire
1–100 caractères
confidenceThresholdnumberobligatoire
0 – 1
fieldMappingsobject[]obligatoire
extractedFieldstringobligatoire
1–200 caractères
targetFieldstringobligatoire
1–200 caractères
transformstringfacultatif
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanfacultatif
Par défaut : false
lookupFieldsobject[]facultatif

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
extractedFieldstringobligatoire
1–200 caractères
targetEntityFieldstringobligatoire
1–200 caractères
transformstringfacultatif
parseDateparseCurrencytrimupperlowerasIs
nullable
requiredbooleanfacultatif
Par défaut : true
linkRolestringfacultatif
max. 100 caractèresnullable
linkBackToDocumentbooleanfacultatif
Par défaut : true
requireHumanApprovalbooleanfacultatif
Par défaut : false
dedupeBystring[]facultatif
nullable
postClassificationActionsobject[]facultatif

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

Par défaut : []
iduuidobligatoire
typestringobligatoire
workflowentity_spawnfiling_policynotification
enabledbooleanobligatoire
Par défaut : true
namestringfacultatif
max. 200 caractèresnullable
confidenceThresholdnumberfacultatif
0 – 1nullable
continueOnErrorbooleanfacultatif
Par défaut : false
configobjectobligatoire
classificationRulesobject[]facultatif

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

Par défaut : []
iduuidobligatoire

Stable rule identifier (UUIDv7).

labelstringfacultatif

Optional human-readable name.

max. 200 caractèresnullable
patternTypestringobligatoire
keywordregexbuiltin
patternstringobligatoire

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

1–500 caractères
weightnumberobligatoire

Positive boosts the document type score; negative reduces it.

-10 – 10
requiredbooleanfacultatif

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

Par défaut : false
fieldstringfacultatif
ocrTextfileNamemimeTypesenderDomainfolderPathall
Par défaut : "ocrText"
positionstringfacultatif

Only meaningful when field='ocrText'.

firstPagelastPageany
Par défaut : "any"
caseSensitivebooleanfacultatif
Par défaut : false
classificationRuleThresholdnumberfacultatif

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

0 – 100Par défaut : 30
postProcessingobjectfacultatif

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

nullable
onClassifiedobjectfacultatif
nullable
workflowDefinitionIduuidobligatoire
minConfidencenumberfacultatif

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

0 – 1Par défaut : 0
onExtractedobjectfacultatif
nullable
workflowDefinitionIduuidobligatoire
requireFieldsstring[]facultatif

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

nullable
onFiledobjectfacultatif
nullable
workflowDefinitionIduuidobligatoire

Endpoints standard

Cette ressource suit le contrat CRUD générique de la plateforme. Lisez les conventions pour la pagination, l'idempotence, le verrouillage optimiste et l'audit. Les endpoints principaux :

  • GET /api/v1/dms_document_types — Liste, paginée et filtrable
  • GET /api/v1/dms_document_types/<id> — Une entité
  • POST /api/v1/dms_document_types — Créer
  • PATCH /api/v1/dms_document_types/<id> — Mise à jour partielle
  • DELETE /api/v1/dms_document_types/<id> — Suppression logique
  • GET /api/v1/dms_document_types/<id>/timeline — Audit et activités

Recherche