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

DMS Document Schema

ID del esquema
dms_document
Colección
dms_documents
Permisos
  • Leerdms_document_view
  • Creardms_document_create
  • Modificardms_document_edit
  • Eliminardms_document_delete

Campos

DMS Document Schema

dms_documents4 permisos

Schema for validating DMS document entities (Dokumentenverwaltung)

titlestringobligatorio

Document title

1–500 caracteres
descriptionstringopcional

Optional description or summary

admite null
documentTypeIduuidopcional

Reference to dms_document_types (custom document type)

admite null
documentTypestringopcional

Legacy document type string (deprecated, use documentTypeId)

admite null
customFieldsobjectopcional

Custom field values defined by the document type schema

admite null
statusstringobligatorio

Document lifecycle status

DRAFTNEEDS_REVIEWAPPROVEDREJECTEDBOOKEDARCHIVED
Valor por defecto: "DRAFT"
rejectionReasonstringopcional

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

solo lecturaadmite null
partyIduuidopcional

Linked CRM party

admite null
contactPartyIduuidopcional

Linked contact person

admite null
contractIduuidopcional

Linked contract

admite null
projectIduuidopcional

Linked project

admite null
employeeIduuidopcional

Linked employee profile

admite null
assignedToIduuidopcional

Assigned user for review

admite null
customerVisiblebooleanopcional

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

Valor por defecto: false
customerUploadedbooleanopcional

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

Valor por defecto: false
uploadedByPartyIduuidopcional

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

admite null
orgUnitIduuidopcional

Owning org unit

admite null
locationIduuidopcional

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.

admite null
tagsstring[]opcional

Manual + auto tags

Valor por defecto: []
folderIduuidopcional

Reference to dms_folders entity

admite null
folderPathstringopcional

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

máx. 1000 caracteresadmite null
checkedOutByuuidopcional

User ID who has this document checked out

solo lecturaadmite null
checkedOutAtdatetimeopcional

When the document was checked out

solo lecturaadmite null
lockExpiresAtdatetimeopcional

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

solo lecturaadmite null
fileIduuidopcional

Reference to files collection

admite null
mimeTypestringopcional

MIME type of the document file

admite null
sizeBytesnumberopcional

File size in bytes

≥ 0admite null
s3Keystringopcional

S3 storage key

solo lecturaadmite null
thumbnailS3Keystringopcional

S3 key for thumbnail image

solo lecturaadmite null
pageCountnumberopcional

Number of pages (PDF)

≥ 0admite null
senderDomainstringopcional

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

máx. 253 caracteresadmite null
sourceEmailMessageIdstringopcional

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

admite null
extractedTextstringopcional

Full text extracted from document for search

admite null
textExtractionStatusstringopcional

Text extraction pipeline status

PENDINGCOMPLETEFAILED
admite null
ocrStatusstringopcional

OCR processing status

NOT_NEEDEDPENDINGCOMPLETEFAILED
admite null
ocrMethodstringopcional

Which OCR method produced the text

tesseractai-vision
admite null
ocrConfidencenumberopcional

OCR confidence score (0-100)

0 – 100admite null
ocrErrorstringopcional

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

admite null
searchablePdfS3Keystringopcional

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

solo lecturaadmite null
searchablePdfErrorstringopcional

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".

admite null
classificationConfidencenumberopcional

Classification confidence score 0-1

0 – 1admite null
classificationSourcestringopcional

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

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?".

admite null
sourcestringopcional
LLMRULEMANUALEINVOICEKIND
atdatetimeopcional
confidencenumberopcional
0 – 1admite null
outcomestringopcional
classifieddirection_unknownambiguous_kindtype_missingnull
admite null
kindstringopcional
admite null
candidateKindsstring[]opcional
admite null
directionstringopcional
incomingoutgoingnull
admite null
typeKeystringopcional
admite null
identityKnownbooleanopcional
admite null
identityCompletebooleanopcional
admite null
kindEvidenceobject[]opcional
admite null
directionEvidenceobject[]opcional
admite null
winnerScorenumberopcional
admite null
winnerNamestringopcional
admite null
candidatesobject[]opcional
admite null
documentTypeIdstringopcional
documentTypeNamestringopcional
admite null
scorenumberopcional
vetoedbooleanopcional
isWinnerbooleanopcional
evaluationsobject[]opcional
patternstringopcional
patternTypestringopcional
keywordregexbuiltin
weightnumberopcional
fieldstringopcional
admite null
positionstringopcional
admite null
requiredbooleanopcional
admite null
matchedbooleanopcional
matchedSnippetstringopcional
admite null
contributedScorenumberopcional
einvoiceFormatstringopcional
admite null
einvoiceMatchedOnstringopcional
vendor.ibanvendor.vatIdbuyer.vatId
admite null
einvoiceVendorNamestringopcional
admite null
einvoiceVendorIbanstringopcional
admite null
einvoiceVendorVatIdstringopcional
admite null
einvoiceBuyerNamestringopcional
admite null
einvoiceBuyerVatIdstringopcional
admite null
previousDocumentTypeIdstringopcional
admite null
previousDocumentTypeNamestringopcional
admite null
previousSourcestringopcional
admite null
manualByUserIdstringopcional
admite null
retentionPolicyIduuidopcional

Applied retention policy

admite null
retentionExpiresAtdatetimeopcional

When retention period expires

admite null
retentionStartAtdatetimeopcional

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

solo lecturaadmite null
retentionUntildatetimeopcional

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

solo lecturaadmite null
retentionModestringopcional

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

nonegovernancecompliance
solo lecturaadmite null
s3VersionIdstringopcional

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

máx. 200 caracteressolo lecturaadmite null
s3ObjectLockAppliedbooleanopcional

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

Valor por defecto: falsesolo lectura
contentSha256stringopcional

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

Patrónsolo lecturaadmite null
gobdSealedAtdatetimeopcional

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

solo lecturaadmite null
gobdChainSeqnumberopcional

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

solo lecturaadmite null
gobdLockPendingbooleanopcional

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

solo lecturaadmite null
gobdLockStatestringopcional

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
solo lecturaadmite null
s3LockModestringopcional

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
solo lecturaadmite null
retentionDueAtdatetimeopcional

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

solo lecturaadmite null
retentionExpiredAtdatetimeopcional

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

solo lecturaadmite null
legalHoldobjectopcional

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

solo lecturaadmite null
activebooleanobligatorio
reasonstringopcional
máx. 500 caracteresadmite null
setByuuidobligatorio
setAtdatetimeobligatorio
releasedByuuidopcional
admite null
releasedAtdatetimeopcional
admite null
caseRefstringopcional

Aktenzeichen / Case-ID für Audit-Trail

máx. 200 caracteresadmite null
documentVersionsobject[]opcional

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

Valor por defecto: []solo lectura
versionNumbernumberobligatorio
≥ 1
s3Keystringobligatorio
solo lectura
uploadedByuuidobligatorio
uploadedAtdatetimeobligatorio
changeNotestringopcional
admite null
sizeBytesnumberopcional
admite null
mimeTypestringopcional
admite null
contentSha256stringopcional
Patrónsolo lecturaadmite null
s3VersionIdstringopcional
solo lecturaadmite null
gobdChainSeqnumberopcional
solo lecturaadmite null
contentUploadedBystringopcional

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

solo lecturaadmite null
contentUploadedAtdatetimeopcional

Wann der aktuelle Inhalt hochgeladen wurde. Fehlt → createdAt.

solo lecturaadmite null
contentChangeNotestringopcional

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

máx. 500 caracteressolo lecturaadmite null
linkedEntitiesobject[]opcional

Links to other entities

Valor por defecto: []
entityTypestringobligatorio
entityIduuidobligatorio
rolestringopcional
admite null
incomingInvoiceobjectopcional

Incoming invoice specific data (Eingangsrechnung)

admite null
vendorPartyIduuidopcional

Matched CRM party for vendor

admite null
vendorNamestringopcional
admite null
vendorTaxIdstringopcional

Steuernummer or USt-IdNr

admite null
vendorIbanstringopcional
admite null
invoiceNumberstringopcional
admite null
invoiceDatedateopcional
admite null
dueDatedateopcional
admite null
netAmountstringopcional
Patrónadmite null
vatAmountstringopcional
Patrónadmite null
grossAmountstringopcional
Patrónadmite null
currencystringopcional
máx. 3 caracteresValor por defecto: "EUR"
lineItemsobject[]opcional
Valor por defecto: []
descriptionstringopcional
quantitystringopcional
Patrónadmite null
unitPricestringopcional
Patrónadmite null
vatRatenumberopcional
admite null
netAmountstringopcional
Patrónadmite null
articleNumberstringopcional
admite null
unitstringopcional

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

máx. 20 caracteresadmite null
vatBreakdownobject[]opcional

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

máx. 20 elementosadmite null
vatRatenumberobligatorio
0 – 100
netAmountstringopcional
Patrónadmite null
vatAmountstringopcional
Patrónadmite null
accountAssignmentsobject[]opcional

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

máx. 100 elementosadmite null
accountCodestringopcional

GL account (Sachkonto) in the tenant chart of accounts

Patrónadmite null
grossAmountstringobligatorio
Patrón
vatRatenumberopcional
0 – 100admite null
taxKeystringopcional

DATEV BU-Schlüssel

Patrónadmite null
costCenterIduuidopcional
admite null
costTypeIduuidopcional
admite null
textstringopcional
máx. 60 caracteresadmite null
vendorBicstringopcional
máx. 11 caracteresadmite null
serviceDatedateopcional

Leistungs-/Lieferdatum (§ 14 UStG)

admite null
servicePeriodFromdateopcional
admite null
servicePeriodTodateopcional
admite null
orderNumberstringopcional

Our purchase order number at the vendor

máx. 100 caracteresadmite null
customerNumberstringopcional

Our customer number at the vendor

máx. 100 caracteresadmite null
deliveryNoteNumberstringopcional
máx. 100 caracteresadmite null
buyerReferencestringopcional

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

máx. 200 caracteresadmite null
cashDiscountPercentnumberopcional

Skonto in percent

0 – 100admite null
cashDiscountDaysintegeropcional
0 – 365admite null
cashDiscountDatedateopcional

Last day the cash discount applies

admite null
paymentTermsstringopcional
admite null
paymentReferencestringopcional

Verwendungszweck / payment reference

admite null
zugferdVersionstringopcional
admite null
xRechnungVersionstringopcional
admite null
extractionMethodstringopcional
ZUGFERDXRECHNUNGLLM_VISIONOCR_LLMOCR_RULESPARSERMANUAL
admite null
extractionConfidencenumberopcional
0 – 1admite null
extractionParserIduuidopcional

Which dms_parser was used

admite null
duplicateOfDocumentIdstringopcional

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

admite null
extractionEvidenceobjectopcional

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

admite null
vendorMatchobjectopcional

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

admite null
methodstringopcional
vat_idsender_domainmanualnull
admite null
suggestedPartyIduuidopcional
admite null
partyNamestringopcional
admite null
reasonstringopcional
ambiguous_vat_idambiguous_domaingeneric_domainown_domainnull
admite null
decidedAtdatetimeopcional
admite null
correctionsobject[]opcional

User corrections for feedback loop

Valor por defecto: []
fieldstringobligatorio
originalValueanyopcional
correctedValueanyobligatorio
correctedByuuidobligatorio
correctedAtdatetimeobligatorio
bookingReferencestringopcional
admite null
datevExportedAtdatetimeopcional
admite null
aiSummarystringopcional

AI-generated document summary

admite null
aiTagsstring[]opcional

AI-suggested tags

admite null
suggestedFolderPathstringopcional

AI-suggested filing location

máx. 1000 caracteresadmite null
suggestedFolderIduuidopcional

AI-suggested folder ID

admite null
accountSuggestionCacheobjectopcional

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

solo lecturaadmite null
duplicateOfIduuidopcional

Reference to potential duplicate document

admite null
duplicateConfidencenumberopcional

Similarity score for duplicate detection (0-1)

0 – 1admite null
embeddingStatusstringopcional

Vector embedding generation status

PENDINGPROCESSINGDONEFAILED
admite null
lastEmbeddedAtdatetimeopcional

When embeddings were last generated

admite null
entitySuggestionsobject[]opcional
Valor por defecto: nulladmite null
entityTypestringobligatorio
entityIdstringobligatorio
displayNamestringobligatorio
confidencenumberobligatorio
0 – 1
reasonstringopcional
admite null
entitySuggestionStatusstringopcional
PENDINGCOMPLETEFAILED
admite null
expiresAtdatetimeopcional

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

admite null
expiryNotificationDaysintegeropcional

Days before expiry to send notification

1 – 365Valor por defecto: nulladmite null
sharePointItemIdstringopcional
admite null
sharePointDriveIdstringopcional
admite null
sharePointWebUrlstringopcional
admite null
sharePointChangeTagstringopcional
admite null
sharePointLastModifiedAtdatetimeopcional
admite null
syncSourcestringopcional
localsharepoint
admite null
lastSyncedAtdatetimeopcional
admite null
syncErrorstringopcional
admite null
sharePointCreatedByAadIdstringopcional
solo lecturaadmite null
sharePointCreatedByUpnstringopcional
solo lecturaadmite null
sharePointCreatedByEmailstringopcional
solo lecturaadmite null
sharePointCreatedByDisplayNamestringopcional
solo lecturaadmite null
sharePointCreatedByUserIduuidopcional

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

solo lecturaadmite null
backendIduuidopcional

Storage backend currently holding the bytes.

admite null
backendItemIdstringopcional

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

máx. 500 caracteresadmite null
backendETagstringopcional

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

máx. 500 caracteresadmite null
appliedFilingPolicyIduuidopcional

Filing policy most recently applied to this document.

admite null
resolvedPathstringopcional

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

máx. 2000 caracteresadmite null
originalBackendPathstringopcional

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.

máx. 2000 caracteresadmite null
originalBackendIduuidopcional

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

admite null
pathSourcestringopcional

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

Filing lifecycle state (ADR 0051).

unfiledinboxfiledmisfiledfiling_failedmissing_in_backend
Valor por defecto: "unfiled"
syncStatestringopcional

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

cleanpending_outboundpending_inboundconflictrenamingmigrating
Valor por defecto: "clean"
requiresHumanReviewbooleanopcional

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

Valor por defecto: false
inboxRoutedbooleanopcional

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.

admite null
classificationstringopcional

Sensitivity classification used by filing policies (§9.4).

publicinternalconfidentialstrictly_confidential
admite null
processingStartedAtdatetimeopcional

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

admite null
processingJobIdstringopcional

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

máx. 200 caracteresadmite null
processingStagestringopcional

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

ocrclassifyextractfile
admite null
processingExpiresAtdatetimeopcional

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

admite null
processingCancelledAtdatetimeopcional

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

admite null
lastOutboundMoveAtdatetimeopcional

Timestamp of the most recent successful outbound move/push.

admite null
lastOutboundMoveJobIdstringopcional

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

máx. 200 caracteresadmite null
outboundMoveAttemptsintegeropcional

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

≥ 0Valor por defecto: 0
encryptionOverridestringopcional

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

nonezero-knowledge
solo lecturaadmite null
encryptionobjectopcional

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

solo lecturaadmite null
modestringobligatorio

Currently only zero-knowledge is supported.

zero-knowledge
algstringobligatorio
AES-256-GCM
Valor por defecto: "AES-256-GCM"
ivstringobligatorio

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

máx. 32 caracteres
keyIdstringopcional

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

máx. 64 caracteresadmite null
wrappedKeysobject[]obligatorio

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

mín. 1 elementos
typestringobligatorio
userteamrole
idstringobligatorio
máx. 200 caracteres
wrappedKeystringobligatorio
máx. 1024 caracteres
ephemeralPublicKeystringopcional
máx. 1024 caracteresadmite null
addedAtdatetimeopcional
admite null
addedByuuidopcional
admite null
signedbooleanopcional

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".

solo lectura
signEnvelopeIduuidopcional

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

solo lectura
notesstringopcional

Free-text notes

admite null

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 filtrable
  • GET /api/v1/dms_documents/<id> — Una entidad
  • POST /api/v1/dms_documents — Crear
  • PATCH /api/v1/dms_documents/<id> — Actualización parcial
  • DELETE /api/v1/dms_documents/<id> — Eliminación lógica
  • GET /api/v1/dms_documents/<id>/timeline — Auditoría y actividades

Búsqueda