DMS Document Schema
Campos
DMS Document Schema
Schema for validating DMS document entities (Dokumentenverwaltung)
title
Document title
description
Optional description or summary
documentTypeId
Reference to dms_document_types (custom document type)
documentType
Legacy document type string (deprecated, use documentTypeId)
customFields
Custom field values defined by the document type schema
status
Document lifecycle status
DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVEDrejectionReason
Reason given for the latest transition to REJECTED (BT-33). Written only by the status transition; null for rejections without a reason.
partyId
Linked CRM party
contactPartyId
Linked contact person
contractId
Linked contract
projectId
Linked project
employeeId
Linked employee profile
assignedToId
Assigned user for review
customerVisible
When true, document is published on the project customer portal (requires project.customerAccess feature releasedDocuments).
customerUploaded
True if the document was uploaded by a customer via the public portal.
uploadedByPartyId
Customer party that uploaded this file (set when customerUploaded = true).
orgUnitId
Owning org unit
locationId
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.
tags
Manual + auto tags
folderId
Reference to dms_folders entity
folderPath
Virtual folder path (e.g. /invoices/2026/)
checkedOutBy
User ID who has this document checked out
checkedOutAt
When the document was checked out
lockExpiresAt
Auto-release lock after this time (default 24h)
fileId
Reference to files collection
mimeType
MIME type of the document file
sizeBytes
File size in bytes
s3Key
S3 storage key
thumbnailS3Key
S3 key for thumbnail image
pageCount
Number of pages (PDF)
senderDomain
Mail domain of the sender when the document arrived as a mail attachment — feeds senderDomain classification rules and the vendor suggestion
sourceEmailMessageId
email_messages._id the attachment came from (document intake mailbox)
extractedText
Full text extracted from document for search
textExtractionStatus
Text extraction pipeline status
PENDINGCOMPLETEFAILEDocrStatus
OCR processing status
NOT_NEEDEDPENDINGCOMPLETEFAILEDocrMethod
Which OCR method produced the text
tesseractai-visionocrConfidence
OCR confidence score (0-100)
ocrError
Reason why the last OCR attempt failed (exception message or diagnostic hint)
searchablePdfS3Key
S3 key for the searchable PDF (original + invisible OCR text layer)
searchablePdfError
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".
classificationConfidence
Classification confidence score 0-1
classificationSource
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.
LLMRULEMANUALEINVOICEKINDclassificationTrace
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?".
source
LLMRULEMANUALEINVOICEKINDconfidence
outcome
classifieddirection_unknownambiguous_kindtype_missingnullkind
candidateKinds
direction
incomingoutgoingnulltypeKey
identityKnown
identityComplete
kindEvidence
directionEvidence
winnerScore
winnerName
candidates
documentTypeName
evaluations
patternType
keywordregexbuiltinfield
position
required
matchedSnippet
einvoiceFormat
einvoiceMatchedOn
vendor.ibanvendor.vatIdbuyer.vatIdeinvoiceVendorName
einvoiceVendorIban
einvoiceVendorVatId
einvoiceBuyerName
einvoiceBuyerVatId
previousDocumentTypeId
previousDocumentTypeName
previousSource
manualByUserId
retentionPolicyId
Applied retention policy
retentionExpiresAt
When retention period expires
retentionStartAt
Zeitpunkt, an dem die Aufbewahrungsuhr gestartet ist (abgeleitet aus retentionStartTrigger des Doctypes).
retentionUntil
Berechneter Ablauf der Aufbewahrungspflicht. Vor diesem Zeitpunkt blockiert der Soft-Delete-Endpoint und (bei retentionMode=compliance) auch S3 jede Löschung.
retentionMode
Effektiver Object-Lock-Modus dieses Dokuments (vom Doctype geerbt, beim Lock-Apply eingefroren).
nonegovernancecompliances3VersionId
S3-VersionId des PUT, an dem der Object-Lock haftet. Pflicht, weil Lock immer auf eine konkrete Version greift.
s3ObjectLockApplied
Sanity-Flag: true sobald PutObjectRetention erfolgreich gegen S3 gefeuert wurde. Daily-Integrity-Job verifiziert via GetObjectRetention.
contentSha256
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).
gobdSealedAt
Zeitpunkt der Festschreibung des aktuellen Inhalts: Hash berechnet und in die Kette des Tenants eingetragen. null = noch nicht festgeschrieben.
gobdChainSeq
Position des aktuellen Inhalts in der Kette (gobd_hash_chain.seq).
gobdLockPending
true, solange der Worker für dieses Dokument noch eine Speicher-Sperre setzen oder hochstufen muss. Trägt den Teilindex der Sperr-Runde.
gobdLockState
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-expiredfailednulls3LockMode
Tatsächlich am Objekt gesetzter Modus. Kann unter retentionMode liegen: COMPLIANCE ist endgültig und wird erst nach menschlicher Freigabe gesetzt (ADR 1163 §4).
GOVERNANCECOMPLIANCEnullretentionDueAt
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).
retentionExpiredAt
Server-only: computed end of the retention period belonging to retentionDueAt (later of the type period and an applied lock).
legalHold
Aufbewahrungs-Sperre (S3 PutObjectLegalHold). Wenn active=true, blockiert jede Löschung — auch nach Ablauf von retentionUntil. Verwendung: Steuerprüfung, Litigation Hold, Audit.
reason
releasedBy
releasedAt
caseRef
Aktenzeichen / Case-ID für Audit-Trail
documentVersions
Abgelöste Inhalte dieses Dokuments (der aktuelle steht in s3Key). Nur über POST /dms/documents/:id/versions/complete und den SharePoint-Inbound beschreibbar.
s3Key
changeNote
sizeBytes
mimeType
contentSha256
s3VersionId
gobdChainSeq
contentUploadedBy
Wer den aktuellen Inhalt (s3Key) hochgeladen hat. Fehlt, solange der Inhalt nie über „Neue Version" ersetzt wurde — dann gilt createdBy.
contentUploadedAt
Wann der aktuelle Inhalt hochgeladen wurde. Fehlt → createdAt.
contentChangeNote
Änderungsnotiz zum aktuellen Inhalt (aus „Neue Version hochladen").
incomingInvoice
Incoming invoice specific data (Eingangsrechnung)
vendorPartyId
Matched CRM party for vendor
vendorName
vendorTaxId
Steuernummer or USt-IdNr
vendorIban
invoiceNumber
invoiceDate
dueDate
netAmount
vatAmount
grossAmount
currency
accountAssignments
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
accountCode
GL account (Sachkonto) in the tenant chart of accounts
grossAmount
vatRate
taxKey
DATEV BU-Schlüssel
costCenterId
costTypeId
text
vendorBic
serviceDate
Leistungs-/Lieferdatum (§ 14 UStG)
servicePeriodFrom
servicePeriodTo
orderNumber
Our purchase order number at the vendor
customerNumber
Our customer number at the vendor
deliveryNoteNumber
buyerReference
Buyer reference / Leitweg-ID of an e-invoice (BT-10)
cashDiscountPercent
Skonto in percent
cashDiscountDays
cashDiscountDate
Last day the cash discount applies
paymentTerms
paymentReference
Verwendungszweck / payment reference
zugferdVersion
xRechnungVersion
extractionMethod
ZUGFERDXRECHNUNGLLM_VISIONOCR_LLMOCR_RULESPARSERMANUALextractionConfidence
extractionParserId
Which dms_parser was used
duplicateOfDocumentId
DMS-Rechnungseingang: an earlier invoice with the same number from the same vendor (VAT ID or amount) — shown as a duplicate warning
extractionEvidence
DMS-Rechnungseingang: text line each value was read from (field → line), shown in the review panel
vendorMatch
DMS-Rechnungseingang: how the vendor was found — linked (VAT ID) or only suggested (sender domain)
method
vat_idsender_domainmanualnullsuggestedPartyId
partyName
reason
ambiguous_vat_idambiguous_domaingeneric_domainown_domainnulldecidedAt
corrections
User corrections for feedback loop
bookingReference
datevExportedAt
aiSummary
AI-generated document summary
aiTags
AI-suggested tags
suggestedFolderPath
AI-suggested filing location
suggestedFolderId
AI-suggested folder ID
accountSuggestionCache
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
duplicateOfId
Reference to potential duplicate document
duplicateConfidence
Similarity score for duplicate detection (0-1)
embeddingStatus
Vector embedding generation status
PENDINGPROCESSINGDONEFAILEDlastEmbeddedAt
When embeddings were last generated
entitySuggestions
entitySuggestionStatus
PENDINGCOMPLETEFAILEDexpiresAt
Document expiry date (e.g. TÜV, certificates, warranties)
expiryNotificationDays
Days before expiry to send notification
syncSource
localsharepointlastSyncedAt
syncError
backendId
Storage backend currently holding the bytes.
backendItemId
Backend-specific item id (e.g. Graph driveItem id, S3 key, FS path).
backendETag
Backend ETag at last sync — used for 3-way conflict detection.
appliedFilingPolicyId
Filing policy most recently applied to this document.
resolvedPath
Backend-absolute path at the time of last filing (audit + quick display).
originalBackendPath
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.
originalBackendId
Backend, das das Dokument ursprünglich geliefert hat (Inbound-Origin). Bleibt stabil, auch wenn ein späterer Move das aktive Backend ändert.
pathSource
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.
originuserpolicyfilingStatus
Filing lifecycle state (ADR 0051).
unfiledinboxfiledmisfiledfiling_failedmissing_in_backendsyncState
Conflict-locking state-machine (ADR 0052 §7.4).
cleanpending_outboundpending_inboundconflictrenamingmigratingrequiresHumanReview
Ingestion-Inbox quarantine flag (ADR 0051 §7.2.5).
inboxRouted
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.
classification
Sensitivity classification used by filing policies (§9.4).
publicinternalconfidentialstrictly_confidentialprocessingStartedAt
When the post-ingestion pipeline acquired this lock. Null = idle.
processingJobId
BullMQ jobId of the running pipeline (used for explicit cancellation).
processingStage
Current pipeline stage — surfaced to the user as a progress hint.
ocrclassifyextractfileprocessingExpiresAt
Lock TTL — past this point the lock is considered stale.
processingCancelledAt
Set by POST /dms/documents/:id/unlock. The worker checks this between stages and bails on the next stage boundary.
lastOutboundMoveAt
Timestamp of the most recent successful outbound move/push.
lastOutboundMoveJobId
BullMQ jobId of the last outbound-move attempt (used for diagnostics and idempotency).
outboundMoveAttempts
Total outbound-move attempts (increments on every CAS-lock acquisition).
encryptionOverride
Per-document override of the document type's defaultEncryption. null = inherit from type.
nonezero-knowledgeencryption
Encryption metadata for ZK-protected files. Set on upload, never mutated; rotation requires re-upload.
mode
Currently only zero-knowledge is supported.
zero-knowledgealg
AES-256-GCMiv
Base64-encoded 12-byte IV used to encrypt the file body.
keyId
Optional identifier for the per-document DEK (e.g. UUIDv7 generated client-side).
wrappedKeys
Per-recipient wraps of the per-document DEK. Each entry mirrors vault_customer_keys.memberKeys.
type
userteamroleid
wrappedKey
ephemeralPublicKey
addedAt
addedBy
signed
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".
signEnvelopeId
The sign_envelope this signed document came from; unique per tenant, which makes filing idempotent. Server-only — a protected field.
notes
Free-text notes
Ningún campo coincide con el filtro.
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_documents— Lista, paginada y filtrableGET /api/v1/dms_documents/<id>— Una entidadPOST /api/v1/dms_documents— CrearPATCH /api/v1/dms_documents/<id>— Actualización parcialDELETE /api/v1/dms_documents/<id>— Eliminación lógicaGET /api/v1/dms_documents/<id>/timeline— Auditoría y actividades