Extracted text of a document version (tenant:dms:read)
GET /api/dms/v1/documents/{id}/text
Module: DMS · operationId: getDocumentText · Tag: Text · Auth: access token (Authorization: Bearer <accessToken>)
Returns the text of a finished extraction (DONE or PARTIAL) as Markdown (default) or
plain text, joined in text and per page in pages. structured holds structured data
when the extractor produced any (e.g. a parsed e-invoice). Audited as VIEW.
Without text the answer is 409 while the extraction is still queued or running (code: extraction_pending; retry later) and 422 otherwise (code not_extracted, encrypted
or the extraction's error code such as no_text or pdf_password); both carry the
extraction status.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string (uuid) | yes | |
version |
query | integer | Version number; default the current version | |
format |
query | string | (one of markdown, plain; default "markdown") |
|
pages |
query | string | One page N or a range N-M (1-based) |
|
include |
query | string | text returns only the joined text (pages is empty) (one of pages, text; default "pages") |
Responses
- 200 Text (
application/json) - 400 Error (
application/json) - 404 Error (
application/json) - 409 No text available (409 extraction still running, 422 no text) (
application/json) - 422 No text available (409 extraction still running, 422 no text) (
application/json)
Fields of the 200 answer:
degraded(boolean, required): At least one page was extracted in degraded qualitydocumentId(string (uuid), required): Document idpages(array of TextPage, required): Empty withinclude=textpageNo(integer, required): Page number, from 1source(string, required): How the page text was obtained (one oftext_layer,ocr,tika,einvoice)text(string, required): Text of the page
pagesProcessed(integer, required): Pages extractedpagesTotal(integer, required): Pages of the filestatus(string, required): Extraction status (PARTIAL: page limit or partial failure) (one ofDONE,PARTIAL)structured(object, nullable, required): Structured extraction result (e.g. a parsed e-invoice) or nulltext(string, required): The selected pages joined by blank linesversion(integer, required): Version the text belongs tomodel(string): Model used for OCR, if any
Example 200 answer:
{
"degraded": false,
"documentId": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7a9c1f42",
"pages": [
{
"pageNo": 1,
"source": "einvoice",
"text": "# Rechnung RE-482117\n\nNordlicht IT-Distribution GmbH, Hafenstraße 40, 20457 Hamburg"
},
{
"pageNo": 2,
"source": "einvoice",
"text": "| Pos. | Artikel | Menge | Einzelpreis |\n|---|---|---|---|\n| 1 | Notebook ProBook 14 G10 | 6 | 829,00 € |\n| 2 | USB-C Dockingstation 100 W | 6 | 139,00 € |\n\nGesamt netto 5.808,00 €, USt. 19 % 1.103,52 €, Gesamt brutto 6.911,52 €"
}
],
"pagesProcessed": 2,
"pagesTotal": 2,
"status": "DONE",
"structured": {
"currency": "EUR",
"grossTotal": 6911.52,
"invoiceNumber": "RE-482117",
"issueDate": "2026-09-30",
"netTotal": 5808,
"taxTotal": 1103.52
},
"text": "# Rechnung RE-482117\n\nNordlicht IT-Distribution GmbH, Hafenstraße 40, 20457 Hamburg\n\n| Pos. | Artikel | Menge | Einzelpreis |\n|---|---|---|---|\n| 1 | Notebook ProBook 14 G10 | 6 | 829,00 € |\n| 2 | USB-C Dockingstation 100 W | 6 | 139,00 € |\n\nGesamt netto 5.808,00 €, USt. 19 % 1.103,52 €, Gesamt brutto 6.911,52 €",
"version": 1
}
Example request
curl -X GET 'https://api.mbcom.cloud/api/dms/v1/documents/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12/text' \
-H "Authorization: Bearer $ACCESS_TOKEN"