API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · dms_document_types

DMS Document Type Schema

ID del esquema
dms_document_type
Colección
dms_document_types
Permisos
  • Leerdms_document_type_view
  • Creardms_document_type_create
  • Modificardms_document_type_edit
  • Eliminardms_document_type_delete

Campos

DMS Document Type Schema

dms_document_types4 permisos

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

namestringobligatorio

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

1–200 caracteres
keystringopcional

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

1–100 caracteresPatrónsolo lecturaadmite null
isSystembooleanopcional

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

Valor por defecto: falsesolo lectura
scopestringopcional

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

financesalesprocurementhrlegalcomplianceit_opsgeneral
solo lecturaadmite null
descriptionstringopcional
máx. 1000 caracteresadmite null
iconstringopcional

Icon name from the Icons registry

máx. 50 caracteresadmite null
colorstringopcional

Badge color (hex or CSS variable)

máx. 20 caracteresadmite null
fieldsobject[]opcional

Custom field definitions for this document type

Valor por defecto: []
keystringobligatorio

camelCase field identifier, used as key in customFields

1–100 caracteresPatrónsolo lectura
labelstringobligatorio

Display label for the field

1–200 caracteres
typestringobligatorio

Field value type

texttextareanumbercurrencydatedatetimeselectmultiselectcheckboxrelation
requiredbooleanopcional
Valor por defecto: false
optionsobject[]opcional

Options for select/multiselect fields

admite null
valuestringobligatorio
labelstringobligatorio
defaultValueanyopcional

Default value for new documents (any JSON value).

placeholderstringopcional
máx. 200 caracteresadmite null
groupstringopcional

Visual grouping label for form sections

máx. 100 caracteresadmite null
sortOrdernumberopcional

Display order within group

Valor por defecto: 0
widthnumberopcional

Grid column width (out of 12)

346812
Valor por defecto: 6
extractionHintstringopcional

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

máx. 500 caracteresadmite null
extractionPathstringopcional

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

máx. 200 caracteresadmite null
relationConfigobjectopcional
admite null
targetCollectionstringopcional

Target collection (e.g. parties, contracts)

displayFieldstringopcional

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

defaultStatusstringopcional

Default status for new documents of this type

DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVED
Valor por defecto: "DRAFT"
autoExtractbooleanopcional

Auto-trigger LLM/OCR extraction on upload

Valor por defecto: true
retentionDaysnumberopcional

Auto-archive after N days

≥ 1admite null
retentionPolicyIduuidopcional

Linked retention policy

admite null
retentionModestringopcional

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
Valor por defecto: "none"solo lectura
retentionMonthsnumberopcional

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

0 – 1200admite null
retentionMinMonthsnumberopcional

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.

solo lecturaadmite null
retentionStartTriggerstringopcional

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
Valor por defecto: "createdAt"solo lectura
retentionStartFieldKeystringopcional

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

máx. 100 caracteresPatrónadmite null
retentionAfterExpirystringopcional

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
admite null
legalBasisstringopcional

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.

máx. 200 caracteresadmite null
requireApprovalBeforeLockbooleanopcional

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

Valor por defecto: false
workflowobjectopcional

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

admite null
statusesobject[]opcional

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

idstringobligatorio

Status identifier (e.g. DRAFT, IN_REVIEW)

1–50 caracteresPatrón
labelstringobligatorio

Display label (i18n key or plain text)

1–100 caracteres
colorstringopcional

Badge color (hex or MUI color name)

máx. 20 caracteresadmite null
iconstringopcional

Icon name for this status

máx. 50 caracteresadmite null
isFinalbooleanopcional

If true, no further transitions are allowed from this status

Valor por defecto: false
transitionsobject[]opcional

Allowed transitions between statuses

fromstringobligatorio

Source status ID

tostringobligatorio

Target status ID

labelstringopcional

Button label for this transition

máx. 100 caracteresadmite null
requiredPermissionstringopcional

Permission required (e.g. dms_document_approve)

máx. 100 caracteresadmite null
requireCommentbooleanopcional

User must provide a comment/reason for this transition

Valor por defecto: false
autoAssignstringopcional

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

máx. 50 caracteresadmite null
webhookUrluriopcional

Trigger webhook on transition

admite null
colorstringopcional

Button color for this transition

primarysuccesserrorwarninginherit
admite null
initialStatusstringopcional

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

admite null
formLayoutIduuidopcional

Optional custom form layout (overrides auto-generated form)

admite null
defaultEncryptionstringopcional

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

nonezero-knowledge
Valor por defecto: "none"
defaultWrapPolicyobjectopcional

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.

admite null
includeEmployeebooleanopcional

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

Valor por defecto: true
includeManagerbooleanopcional

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

Valor por defecto: false
rolesstring[]opcional

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

Valor por defecto: []
explicitUserIdsuuid[]opcional

Explicit user UUIDs to always include in the wrap list.

Valor por defecto: []
isActivebooleanopcional
Valor por defecto: true
sortOrdernumberopcional
Valor por defecto: 0
inboxFilterEnabledbooleanopcional

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

Valor por defecto: false
extractionProfilestringopcional

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

máx. 100 caracteresadmite null
defaultFilingPolicyIduuidopcional

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

admite null
onClassificationSpawnEntityobjectopcional

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

admite null
modestringopcional

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
Valor por defecto: "spawn"
targetEntityTypestringobligatorio
1–100 caracteres
confidenceThresholdnumberobligatorio
0 – 1
fieldMappingsobject[]obligatorio
extractedFieldstringobligatorio
1–200 caracteres
targetFieldstringobligatorio
1–200 caracteres
transformstringopcional
parseDateparseCurrencytrimupperlowerasIs
admite null
requiredbooleanopcional
Valor por defecto: false
lookupFieldsobject[]opcional

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.

admite null
extractedFieldstringobligatorio
1–200 caracteres
targetEntityFieldstringobligatorio
1–200 caracteres
transformstringopcional
parseDateparseCurrencytrimupperlowerasIs
admite null
requiredbooleanopcional
Valor por defecto: true
linkRolestringopcional
máx. 100 caracteresadmite null
linkBackToDocumentbooleanopcional
Valor por defecto: true
requireHumanApprovalbooleanopcional
Valor por defecto: false
dedupeBystring[]opcional
admite null
postClassificationActionsobject[]opcional

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

Valor por defecto: []
iduuidobligatorio
typestringobligatorio
workflowentity_spawnfiling_policynotification
enabledbooleanobligatorio
Valor por defecto: true
namestringopcional
máx. 200 caracteresadmite null
confidenceThresholdnumberopcional
0 – 1admite null
continueOnErrorbooleanopcional
Valor por defecto: false
configobjectobligatorio
classificationRulesobject[]opcional

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

Valor por defecto: []
iduuidobligatorio

Stable rule identifier (UUIDv7).

labelstringopcional

Optional human-readable name.

máx. 200 caracteresadmite null
patternTypestringobligatorio
keywordregexbuiltin
patternstringobligatorio

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

1–500 caracteres
weightnumberobligatorio

Positive boosts the document type score; negative reduces it.

-10 – 10
requiredbooleanopcional

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

Valor por defecto: false
fieldstringopcional
ocrTextfileNamemimeTypesenderDomainfolderPathall
Valor por defecto: "ocrText"
positionstringopcional

Only meaningful when field='ocrText'.

firstPagelastPageany
Valor por defecto: "any"
caseSensitivebooleanopcional
Valor por defecto: false
classificationRuleThresholdnumberopcional

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

0 – 100Valor por defecto: 30
postProcessingobjectopcional

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

admite null
onClassifiedobjectopcional
admite null
workflowDefinitionIduuidobligatorio
minConfidencenumberopcional

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

0 – 1Valor por defecto: 0
onExtractedobjectopcional
admite null
workflowDefinitionIduuidobligatorio
requireFieldsstring[]opcional

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

admite null
onFiledobjectopcional
admite null
workflowDefinitionIduuidobligatorio

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/dms_document_types — Lista, paginada y filtrable
  • GET /api/v1/dms_document_types/<id> — Una entidad
  • POST /api/v1/dms_document_types — Crear
  • PATCH /api/v1/dms_document_types/<id> — Actualización parcial
  • DELETE /api/v1/dms_document_types/<id> — Eliminación lógica
  • GET /api/v1/dms_document_types/<id>/timeline — Auditoría y actividades

Búsqueda