Skip to content

Get a document

GET
/api/v1/documents/{documentId}
curl --request GET \
--url 'https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion' \
--header 'X-Api-Key: <X-Api-Key>'

Fetch a document’s status and, once processed, its structured data + located fields.

documentId
required
string
Example
doc_mrb1x9y8z7
expand
string

Comma-separated relations to inline. model replaces the model id string with { id, name }; documents.model expands split sub-documents. Shallow (one hop).

Example
model
fields[model]
string

Fields for an expanded model (allowed: id, name, version, geometry). Default: id,name.

Example
id,name,version

The document.

Media typeapplication/json
object
data
required
object
id
string
model
One of:
string
nullable
status
string
Allowed values: queued processing processed needs_review failed
debugId
string
pageCount
integer
routerConfidence
number
nullable
data

The extracted structured data (present once processed).

object
key
additional properties
any
fields

Per-field values + confidence + bounding boxes (when resultShape=full).

Array<object>
nullable
object
name
string
value

Any JSON value (string/number/boolean/array/object).

confidence
string
Allowed values: high medium low flagged
boxes
Array<object>

Normalised page coordinates (0..1).

object
left
number
top
number
width
number
height
number
page
integer
Example
{
"data": {
"id": "doc_mrb1x9y8z7",
"model": "mdl_inv01",
"status": "processed",
"pageCount": 2,
"data": {
"invoice_number": "INV-23815",
"invoice_date": "2024-04-12",
"total": 1284.5
},
"fields": [
{
"name": "invoice_number",
"value": "INV-23815",
"confidence": "high",
"boxes": [
{
"left": 0.62,
"top": 0.08,
"width": 0.15,
"height": 0.03,
"page": 1
}
]
},
{
"name": "total",
"value": 1284.5,
"confidence": "high",
"boxes": []
}
]
}
}

Missing or invalid API key.

Media typeapplication/json

Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.

object
statusCode
integer
statusMessage
string
Example
{
"statusCode": 404,
"statusMessage": "Document not found"
}

Document not found.

Media typeapplication/json

Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.

object
statusCode
integer
statusMessage
string
Example
{
"statusCode": 404,
"statusMessage": "Document not found"
}