API · v1 · stabil
CODEMETA OSDeveloper Center
DE
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"
rejectionReasonstringoptional

Reason given for the latest transition to REJECTED (BT-33). Written only by the status transition; null for rejections without a reason.

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

read-onlynullable
thumbnailS3Keystringoptional

S3 key for thumbnail image

read-onlynullable
pageCountnumberoptional

Number of pages (PDF)

≥ 0nullable
senderDomainstringoptional

Mail domain of the sender when the document arrived as a mail attachment — feeds senderDomain classification rules and the vendor suggestion

max 253 Zeichennullable
sourceEmailMessageIdstringoptional

email_messages._id the attachment came from (document intake mailbox)

nullable
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)

read-onlynullable
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. KIND = Belegart-Erkennung (document-kind.ts): Überschrift und Nummernfelder bestimmen die Belegart, die Aussteller-Merkmale die Richtung.

LLMRULEMANUALEINVOICEKIND
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
LLMRULEMANUALEINVOICEKIND
atdatetimeoptional
confidencenumberoptional
0 – 1nullable
outcomestringoptional
classifieddirection_unknownambiguous_kindtype_missingnull
nullable
kindstringoptional
nullable
candidateKindsstring[]optional
nullable
directionstringoptional
incomingoutgoingnull
nullable
typeKeystringoptional
nullable
identityKnownbooleanoptional
nullable
identityCompletebooleanoptional
nullable
kindEvidenceobject[]optional
nullable
directionEvidenceobject[]optional
nullable
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
gobdSealedAtdatetimeoptional

Zeitpunkt der Festschreibung des aktuellen Inhalts: Hash berechnet und in die Kette des Tenants eingetragen. null = noch nicht festgeschrieben.

read-onlynullable
gobdChainSeqnumberoptional

Position des aktuellen Inhalts in der Kette (gobd_hash_chain.seq).

read-onlynullable
gobdLockPendingbooleanoptional

true, solange der Worker für dieses Dokument noch eine Speicher-Sperre setzen oder hochstufen muss. Trägt den Teilindex der Sperr-Runde.

read-onlynullable
gobdLockStatestringoptional

Stand der Speicher-Sperre: applied = endgültiger Modus gesetzt; awaiting-upgrade = GOVERNANCE gesetzt, COMPLIANCE folgt nach Freigabe; trigger-not-reached = die Frist startet erst mit einem späteren Ereignis; retention-expired = die Frist war beim Sperren schon abgelaufen, eine Sperre ist nicht mehr nötig.

pendingappliedawaiting-approvalawaiting-upgradetrigger-not-reachedretention-expiredfailednull
read-onlynullable
s3LockModestringoptional

Tatsächlich am Objekt gesetzter Modus. Kann unter retentionMode liegen: COMPLIANCE ist endgültig und wird erst nach menschlicher Freigabe gesetzt (ADR 1163 §4).

GOVERNANCECOMPLIANCEnull
read-onlynullable
retentionDueAtdatetimeoptional

Server-only: when the nightly retention round found this document past its retention period with "suggest deletion". null = not due. Deletion still needs a manual confirmation (POST /dms/retention/confirm-deletion).

read-onlynullable
retentionExpiredAtdatetimeoptional

Server-only: computed end of the retention period belonging to retentionDueAt (later of the type period and an applied lock).

read-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

Abgelöste Inhalte dieses Dokuments (der aktuelle steht in s3Key). Nur über POST /dms/documents/:id/versions/complete und den SharePoint-Inbound beschreibbar.

Default: []read-only
versionNumbernumbererforderlich
≥ 1
s3Keystringerforderlich
read-only
uploadedByuuiderforderlich
uploadedAtdatetimeerforderlich
changeNotestringoptional
nullable
sizeBytesnumberoptional
nullable
mimeTypestringoptional
nullable
contentSha256stringoptional
Patternread-onlynullable
s3VersionIdstringoptional
read-onlynullable
gobdChainSeqnumberoptional
read-onlynullable
contentUploadedBystringoptional

Wer den aktuellen Inhalt (s3Key) hochgeladen hat. Fehlt, solange der Inhalt nie über „Neue Version" ersetzt wurde — dann gilt createdBy.

read-onlynullable
contentUploadedAtdatetimeoptional

Wann der aktuelle Inhalt hochgeladen wurde. Fehlt → createdAt.

read-onlynullable
contentChangeNotestringoptional

Änderungsnotiz zum aktuellen Inhalt (aus „Neue Version hochladen").

max 500 Zeichenread-onlynullable
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
unitstringoptional

Unit as printed or the UN/ECE code of an e-invoice (C62, HUR)

max 20 Zeichennullable
vatBreakdownobject[]optional

VAT per rate (net base + tax) — from the e-invoice or read off the totals block; basis for account assignment and export

max 20 Itemsnullable
vatRatenumbererforderlich
0 – 100
netAmountstringoptional
Patternnullable
vatAmountstringoptional
Patternnullable
accountAssignmentsobject[]optional

Kontierung (ADR 1297): split of the invoice into booking lines — GL account, tax key, cost center, cost type, GROSS amount. Optional; when present and the invoice is approved, the lines add up to grossAmount

max 100 Itemsnullable
accountCodestringoptional

GL account (Sachkonto) in the tenant chart of accounts

Patternnullable
grossAmountstringerforderlich
Pattern
vatRatenumberoptional
0 – 100nullable
taxKeystringoptional

DATEV BU-Schlüssel

Patternnullable
costCenterIduuidoptional
nullable
costTypeIduuidoptional
nullable
textstringoptional
max 60 Zeichennullable
vendorBicstringoptional
max 11 Zeichennullable
serviceDatedateoptional

Leistungs-/Lieferdatum (§ 14 UStG)

nullable
servicePeriodFromdateoptional
nullable
servicePeriodTodateoptional
nullable
orderNumberstringoptional

Our purchase order number at the vendor

max 100 Zeichennullable
customerNumberstringoptional

Our customer number at the vendor

max 100 Zeichennullable
deliveryNoteNumberstringoptional
max 100 Zeichennullable
buyerReferencestringoptional

Buyer reference / Leitweg-ID of an e-invoice (BT-10)

max 200 Zeichennullable
cashDiscountPercentnumberoptional

Skonto in percent

0 – 100nullable
cashDiscountDaysintegeroptional
0 – 365nullable
cashDiscountDatedateoptional

Last day the cash discount applies

nullable
paymentTermsstringoptional
nullable
paymentReferencestringoptional

Verwendungszweck / payment reference

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

Which dms_parser was used

nullable
duplicateOfDocumentIdstringoptional

DMS-Rechnungseingang: an earlier invoice with the same number from the same vendor (VAT ID or amount) — shown as a duplicate warning

nullable
extractionEvidenceobjectoptional

DMS-Rechnungseingang: text line each value was read from (field → line), shown in the review panel

nullable
vendorMatchobjectoptional

DMS-Rechnungseingang: how the vendor was found — linked (VAT ID) or only suggested (sender domain)

nullable
methodstringoptional
vat_idsender_domainmanualnull
nullable
suggestedPartyIduuidoptional
nullable
partyNamestringoptional
nullable
reasonstringoptional
ambiguous_vat_idambiguous_domaingeneric_domainown_domainnull
nullable
decidedAtdatetimeoptional
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
accountSuggestionCacheobjectoptional

Cache of the AI GL account suggestions for the account assignment (ADR 1297, stage 2): input hash + validated suggestions, so the same invoice does not pay for the same call twice. Server-only — a protected technical field; never the assignment itself

read-onlynullable
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
read-onlynullable
encryptionobjectoptional

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

read-onlynullable
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
signedbooleanoptional

The file is the PAdES-signed PDF of a completed sign_envelope. Server-only — a protected field; its content cannot be replaced. Absent on every other document, which means "not signed".

read-only
signEnvelopeIduuidoptional

The sign_envelope this signed document came from; unique per tenant, which makes filing idempotent. Server-only — a protected field.

read-only
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