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

DMS Document Schema

Schema-ID
dms_document
Collection
dms_documents
Permissions
  • Lesendms_document_view
  • Anlegendms_document_create
  • Änderndms_document_edit
  • Löschendms_document_delete

Felder

DMS Document Schema

dms_documents4 Permissions

Schema for validating DMS document entities (Dokumentenverwaltung)

titlestringerforderlich

Document title

1–500 Zeichen
descriptionstringoptional

Optional description or summary

nullable
documentTypeIduuidoptional

Reference to dms_document_types (custom document type)

nullable
documentTypestringoptional

Legacy document type string (deprecated, use documentTypeId)

nullable
customFieldsobjectoptional

Custom field values defined by the document type schema

nullable
statusstringerforderlich

Document lifecycle status

DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVED
Default: "DRAFT"
partyIduuidoptional

Linked CRM party

nullable
contactPartyIduuidoptional

Linked contact person

nullable
contractIduuidoptional

Linked contract

nullable
projectIduuidoptional

Linked project

nullable
employeeIduuidoptional

Linked employee profile

nullable
assignedToIduuidoptional

Assigned user for review

nullable
customerVisiblebooleanoptional

When true, document is published on the project customer portal (requires project.customerAccess feature releasedDocuments).

Default: false
customerUploadedbooleanoptional

True if the document was uploaded by a customer via the public portal.

Default: false
uploadedByPartyIduuidoptional

Customer party that uploaded this file (set when customerUploaded = true).

nullable
orgUnitIduuidoptional

Owning org unit

nullable
locationIduuidoptional

Standort der eigenen Firma (location entity under the isSelfCompany party, same set as the print-target sites of ADR 0370). Purely organisational: it says which own office the document belongs to (Miet-/Versicherungsvertrag, Brandschutz, Netzdoku je Niederlassung). Absent/null = not assigned — no backfill required.

nullable
tagsstring[]optional

Manual + auto tags

Default: []
folderIduuidoptional

Reference to dms_folders entity

nullable
folderPathstringoptional

Virtual folder path (e.g. /invoices/2026/)

max 1000 Zeichennullable
checkedOutByuuidoptional

User ID who has this document checked out

read-onlynullable
checkedOutAtdatetimeoptional

When the document was checked out

read-onlynullable
lockExpiresAtdatetimeoptional

Auto-release lock after this time (default 24h)

read-onlynullable
fileIduuidoptional

Reference to files collection

nullable
mimeTypestringoptional

MIME type of the document file

nullable
sizeBytesnumberoptional

File size in bytes

≥ 0nullable
s3Keystringoptional

S3 storage key

nullable
thumbnailS3Keystringoptional

S3 key for thumbnail image

nullable
pageCountnumberoptional

Number of pages (PDF)

≥ 0nullable
extractedTextstringoptional

Full text extracted from document for search

nullable
textExtractionStatusstringoptional

Text extraction pipeline status

PENDINGCOMPLETEFAILED
nullable
ocrStatusstringoptional

OCR processing status

NOT_NEEDEDPENDINGCOMPLETEFAILED
nullable
ocrMethodstringoptional

Which OCR method produced the text

tesseractai-vision
nullable
ocrConfidencenumberoptional

OCR confidence score (0-100)

0 – 100nullable
ocrErrorstringoptional

Reason why the last OCR attempt failed (exception message or diagnostic hint)

nullable
searchablePdfS3Keystringoptional

S3 key for the searchable PDF (original + invisible OCR text layer)

nullable
searchablePdfErrorstringoptional

Why the invisible text layer could not be built, even though OCR itself succeeded. Without a text layer the PDF stays unselectable in the viewer, so this is a user-visible outcome and not just a log line. Absent on documents processed before this field existed — treat as "unknown", never as "no error".

nullable
classificationConfidencenumberoptional

Classification confidence score 0-1

0 – 1nullable
classificationSourcestringoptional

How the document was classified. EINVOICE = ZUGFeRD/XRechnung Pre-Classifier matched the embedded SellerTradeParty/BuyerTradeParty against the tenant identity.

LLMRULEMANUALEINVOICE
nullable
classificationTraceobjectoptional

Diagnose-Spur der letzten Klassifikation: welche Regeln matchten, welche E-Invoice-Felder die Tenant-Identität trafen, oder bei MANUAL der vorherige Doktyp. Zeigt im UI „Warum wurde dieses Dokument so klassifiziert?".

nullable
sourcestringoptional
LLMRULEMANUALEINVOICE
atdatetimeoptional
confidencenumberoptional
0 – 1nullable
winnerScorenumberoptional
nullable
winnerNamestringoptional
nullable
candidatesobject[]optional
nullable
documentTypeIdstringoptional
documentTypeNamestringoptional
nullable
scorenumberoptional
vetoedbooleanoptional
isWinnerbooleanoptional
evaluationsobject[]optional
patternstringoptional
patternTypestringoptional
keywordregexbuiltin
weightnumberoptional
fieldstringoptional
nullable
positionstringoptional
nullable
requiredbooleanoptional
nullable
matchedbooleanoptional
matchedSnippetstringoptional
nullable
contributedScorenumberoptional
einvoiceFormatstringoptional
nullable
einvoiceMatchedOnstringoptional
vendor.ibanvendor.vatIdbuyer.vatId
nullable
einvoiceVendorNamestringoptional
nullable
einvoiceVendorIbanstringoptional
nullable
einvoiceVendorVatIdstringoptional
nullable
einvoiceBuyerNamestringoptional
nullable
einvoiceBuyerVatIdstringoptional
nullable
previousDocumentTypeIdstringoptional
nullable
previousDocumentTypeNamestringoptional
nullable
previousSourcestringoptional
nullable
manualByUserIdstringoptional
nullable
retentionPolicyIduuidoptional

Applied retention policy

nullable
retentionExpiresAtdatetimeoptional

When retention period expires

nullable
retentionStartAtdatetimeoptional

Zeitpunkt, an dem die Aufbewahrungsuhr gestartet ist (abgeleitet aus retentionStartTrigger des Doctypes).

read-onlynullable
retentionUntildatetimeoptional

Berechneter Ablauf der Aufbewahrungspflicht. Vor diesem Zeitpunkt blockiert der Soft-Delete-Endpoint und (bei retentionMode=compliance) auch S3 jede Löschung.

read-onlynullable
retentionModestringoptional

Effektiver Object-Lock-Modus dieses Dokuments (vom Doctype geerbt, beim Lock-Apply eingefroren).

nonegovernancecompliance
read-onlynullable
s3VersionIdstringoptional

S3-VersionId des PUT, an dem der Object-Lock haftet. Pflicht, weil Lock immer auf eine konkrete Version greift.

max 200 Zeichenread-onlynullable
s3ObjectLockAppliedbooleanoptional

Sanity-Flag: true sobald PutObjectRetention erfolgreich gegen S3 gefeuert wurde. Daily-Integrity-Job verifiziert via GetObjectRetention.

Default: falseread-only
contentSha256stringoptional

Hex-codierter SHA-256-Hash des Originalinhalts beim Upload. Daily-Integrity-Job vergleicht gegen neu berechneten Hash zur Manipulationsprüfung (GoBD Rz. 110 Unveränderbarkeit).

Patternread-onlynullable
legalHoldobjectoptional

Aufbewahrungs-Sperre (S3 PutObjectLegalHold). Wenn active=true, blockiert jede Löschung — auch nach Ablauf von retentionUntil. Verwendung: Steuerprüfung, Litigation Hold, Audit.

read-onlynullable
activebooleanerforderlich
reasonstringoptional
max 500 Zeichennullable
setByuuiderforderlich
setAtdatetimeerforderlich
releasedByuuidoptional
nullable
releasedAtdatetimeoptional
nullable
caseRefstringoptional

Aktenzeichen / Case-ID für Audit-Trail

max 200 Zeichennullable
documentVersionsobject[]optional

Previous versions of this document

Default: []
versionNumbernumbererforderlich
≥ 1
s3Keystringerforderlich
uploadedByuuiderforderlich
uploadedAtdatetimeerforderlich
changeNotestringoptional
nullable
sizeBytesnumberoptional
nullable
linkedEntitiesobject[]optional

Links to other entities

Default: []
entityTypestringerforderlich
entityIduuiderforderlich
rolestringoptional
nullable
incomingInvoiceobjectoptional

Incoming invoice specific data (Eingangsrechnung)

nullable
vendorPartyIduuidoptional

Matched CRM party for vendor

nullable
vendorNamestringoptional
nullable
vendorTaxIdstringoptional

Steuernummer or USt-IdNr

nullable
vendorIbanstringoptional
nullable
invoiceNumberstringoptional
nullable
invoiceDatedateoptional
nullable
dueDatedateoptional
nullable
netAmountstringoptional
Patternnullable
vatAmountstringoptional
Patternnullable
grossAmountstringoptional
Patternnullable
currencystringoptional
max 3 ZeichenDefault: "EUR"
lineItemsobject[]optional
Default: []
descriptionstringoptional
quantitystringoptional
Patternnullable
unitPricestringoptional
Patternnullable
vatRatenumberoptional
nullable
netAmountstringoptional
Patternnullable
articleNumberstringoptional
nullable
paymentTermsstringoptional
nullable
paymentReferencestringoptional

Verwendungszweck / payment reference

nullable
zugferdVersionstringoptional
nullable
xRechnungVersionstringoptional
nullable
extractionMethodstringoptional
ZUGFERDXRECHNUNGLLM_VISIONOCR_LLMPARSERMANUAL
nullable
extractionConfidencenumberoptional
0 – 1nullable
extractionParserIduuidoptional

Which dms_parser was used

nullable
correctionsobject[]optional

User corrections for feedback loop

Default: []
fieldstringerforderlich
originalValueanyoptional
correctedValueanyerforderlich
correctedByuuiderforderlich
correctedAtdatetimeerforderlich
bookingReferencestringoptional
nullable
datevExportedAtdatetimeoptional
nullable
aiSummarystringoptional

AI-generated document summary

nullable
aiTagsstring[]optional

AI-suggested tags

nullable
suggestedFolderPathstringoptional

AI-suggested filing location

max 1000 Zeichennullable
suggestedFolderIduuidoptional

AI-suggested folder ID

nullable
duplicateOfIduuidoptional

Reference to potential duplicate document

nullable
duplicateConfidencenumberoptional

Similarity score for duplicate detection (0-1)

0 – 1nullable
embeddingStatusstringoptional

Vector embedding generation status

PENDINGPROCESSINGDONEFAILED
nullable
lastEmbeddedAtdatetimeoptional

When embeddings were last generated

nullable
entitySuggestionsobject[]optional
Default: nullnullable
entityTypestringerforderlich
entityIdstringerforderlich
displayNamestringerforderlich
confidencenumbererforderlich
0 – 1
reasonstringoptional
nullable
entitySuggestionStatusstringoptional
PENDINGCOMPLETEFAILED
nullable
expiresAtdatetimeoptional

Document expiry date (e.g. TÜV, certificates, warranties)

nullable
expiryNotificationDaysintegeroptional

Days before expiry to send notification

1 – 365Default: nullnullable
sharePointItemIdstringoptional
nullable
sharePointDriveIdstringoptional
nullable
sharePointWebUrlstringoptional
nullable
sharePointChangeTagstringoptional
nullable
sharePointLastModifiedAtdatetimeoptional
nullable
syncSourcestringoptional
localsharepoint
nullable
lastSyncedAtdatetimeoptional
nullable
syncErrorstringoptional
nullable
sharePointCreatedByAadIdstringoptional
read-onlynullable
sharePointCreatedByUpnstringoptional
read-onlynullable
sharePointCreatedByEmailstringoptional
read-onlynullable
sharePointCreatedByDisplayNamestringoptional
read-onlynullable
sharePointCreatedByUserIduuidoptional

Resolved Codemeta user ID matching the SharePoint uploader (via AAD object ID, UPN, or email). Null when no match found.

read-onlynullable
backendIduuidoptional

Storage backend currently holding the bytes.

nullable
backendItemIdstringoptional

Backend-specific item id (e.g. Graph driveItem id, S3 key, FS path).

max 500 Zeichennullable
backendETagstringoptional

Backend ETag at last sync — used for 3-way conflict detection.

max 500 Zeichennullable
appliedFilingPolicyIduuidoptional

Filing policy most recently applied to this document.

nullable
resolvedPathstringoptional

Backend-absolute path at the time of last filing (audit + quick display).

max 2000 Zeichennullable
originalBackendPathstringoptional

Pfad, an dem das Dokument beim Inbound-Sync ursprünglich lag (z.B. "/Kunden/ACME/Rechnungen/file.pdf"). Quelle der Pfad-Hoheit, wenn keine Filing-Policy mit overrideBackendPath greift.

max 2000 Zeichennullable
originalBackendIduuidoptional

Backend, das das Dokument ursprünglich geliefert hat (Inbound-Origin). Bleibt stabil, auch wenn ein späterer Move das aktive Backend ändert.

nullable
pathSourcestringoptional

Ownership-Modell der Pfad-Hoheit (ADR 0391): "origin" = Backend-Original (Inbound-Sync), "user" = explizite Ordnerwahl beim Upload, "policy" = Filing-Policy-Template. Nur eine Policy mit overrideBackendPath=true darf "origin"/"user" überstimmen.

originuserpolicy
nullable
filingStatusstringoptional

Filing lifecycle state (ADR 0051).

unfiledinboxfiledmisfiledfiling_failedmissing_in_backend
Default: "unfiled"
syncStatestringoptional

Conflict-locking state-machine (ADR 0052 §7.4).

cleanpending_outboundpending_inboundconflictrenamingmigrating
Default: "clean"
requiresHumanReviewbooleanoptional

Ingestion-Inbox quarantine flag (ADR 0051 §7.2.5).

Default: false
inboxRoutedbooleanoptional

Dokument stammt aus einem konfigurierten SharePoint-Posteingangsordner (ADR 0392). Unterdrückt das automatische filingStatus="filed" am Origin-Pfad, damit es ohne greifende Filing-Policy im Posteingang zur Triage landet. Fehlt auf allen Alt-Dokumenten → falsy → unverändertes Verhalten.

nullable
classificationstringoptional

Sensitivity classification used by filing policies (§9.4).

publicinternalconfidentialstrictly_confidential
nullable
processingStartedAtdatetimeoptional

When the post-ingestion pipeline acquired this lock. Null = idle.

nullable
processingJobIdstringoptional

BullMQ jobId of the running pipeline (used for explicit cancellation).

max 200 Zeichennullable
processingStagestringoptional

Current pipeline stage — surfaced to the user as a progress hint.

ocrclassifyextractfile
nullable
processingExpiresAtdatetimeoptional

Lock TTL — past this point the lock is considered stale.

nullable
processingCancelledAtdatetimeoptional

Set by POST /dms/documents/:id/unlock. The worker checks this between stages and bails on the next stage boundary.

nullable
lastOutboundMoveAtdatetimeoptional

Timestamp of the most recent successful outbound move/push.

nullable
lastOutboundMoveJobIdstringoptional

BullMQ jobId of the last outbound-move attempt (used for diagnostics and idempotency).

max 200 Zeichennullable
outboundMoveAttemptsintegeroptional

Total outbound-move attempts (increments on every CAS-lock acquisition).

≥ 0Default: 0
encryptionOverridestringoptional

Per-document override of the document type's defaultEncryption. null = inherit from type.

nonezero-knowledge
nullable
encryptionobjectoptional

Encryption metadata for ZK-protected files. Set on upload, never mutated; rotation requires re-upload.

nullable
modestringerforderlich

Currently only zero-knowledge is supported.

zero-knowledge
algstringerforderlich
AES-256-GCM
Default: "AES-256-GCM"
ivstringerforderlich

Base64-encoded 12-byte IV used to encrypt the file body.

max 32 Zeichen
keyIdstringoptional

Optional identifier for the per-document DEK (e.g. UUIDv7 generated client-side).

max 64 Zeichennullable
wrappedKeysobject[]erforderlich

Per-recipient wraps of the per-document DEK. Each entry mirrors vault_customer_keys.memberKeys.

min 1 Items
typestringerforderlich
userteamrole
idstringerforderlich
max 200 Zeichen
wrappedKeystringerforderlich
max 1024 Zeichen
ephemeralPublicKeystringoptional
max 1024 Zeichennullable
addedAtdatetimeoptional
nullable
addedByuuidoptional
nullable
notesstringoptional

Free-text notes

nullable

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

Suche