Get File Data
Retrieve extracted data and processing status for a single file.
/api/v1/document/get-file-dataRetrieve processed document data and check processing status. This endpoint supports both synchronous and asynchronous workflows, returning either the extracted data or processing status based on the job state.
Use this endpoint to:
- Poll for results after submitting an async processing job
- Fetch extracted data using metadata from webhook events
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
fileId | string | query | Yes | The file ID from the upload response or webhook event payload. |
extractionSchemaId | string | query | No | Optional. The model or deployment's extraction schema ID; validates that the file belongs to it. |
include | string | query | No | Comma-separated list of optional enrichments to include: confidence, boundingBoxes, validations. Omit for the plain data payload. |
Optional Enrichments
By default the response contains only the extracted values. Pass include to enrich each cell (and, for validations, the file envelope):
confidence— adds aconfidenceobject to every cell withoverall,llm,layout, andconsensusscores (0–1,nullwhen not computed).boundingBoxes— adds aboundingBoxesarray to every cell. Each box is{"page": "2", "bbox": [yMin, xMin, yMax, xMax]}in normalized 0–1000 coordinates with the origin at the top-left.nullwhen boxes were never computed for the cell.validations— adds avalidationsarray to every cell (normalized entries withcheckKey,sourceofRULE/SCRIPT/AGENT,passed,message,expected,actual,amended) plus a file-levelvalidationsobject containing the aggregatefailCount, per-check results (checks), and declarative rule results (rules).
Every cell's metadata also carries the column slug, alongside the table-level and column-list slugs, so responses can be consumed by stable slug instead of display name.
Note: documents processed through the synchronous process-file endpoint skip the confidence and bounding-box stages, so those fields stay null for such files even when requested. Use the async processing endpoints when you need them.
Request
const response = await fetch(
`https://app.limai.io/api/v1/document/get-file-data?fileId=${fileId}`,
{
headers: { "Authorization": `Bearer ${API_TOKEN}` }
}
)
const data = await response.json()Response Types
The response format depends on the processing state of the file.
PROCESSING
The job is still running. Continue polling.
{
"status": "PROCESSING",
"fileId": "file_abc123def456",
"jobId": "job_789xyz012"
}CLASSIFYING
The file is being classified (when using async classification).
{
"status": "CLASSIFYING",
"fileId": "file_abc123def456",
"message": "Document is being classified"
}COMPLETED
Processing finished successfully. Contains the full extracted data.
{
"status": "COMPLETED",
"message": "File data retrieved successfully.",
"fileId": "file_abc123def456",
"extractionSchemaId": "schema_xyz789",
"deployment": {
"id": "dep_abc123",
"name": "Invoice Extraction v1"
},
"data": {
"tables": {
"table_id_1": {
"id": "table_id_1",
"name": "Invoices",
"slug": "invoices",
"columns": [
{
"id": "col_1",
"name": "Invoice Number",
"type": "TEXT",
"slug": "invoice_number"
}
],
"rows": [
{
"id": "row_1",
"index": "0",
"status": "PENDING",
"cells": {
"Invoice Number": {
"value": "INV-001",
"columnId": "col_1",
"metadata": {
"id": "col_1",
"type": "TEXT",
"description": null,
"slug": "invoice_number"
}
}
}
}
]
}
}
}
}COMPLETED with enrichments
With include=confidence,boundingBoxes,validations, each cell carries the requested extras and the envelope gains a file-level validations object.
{
"status": "COMPLETED",
"fileId": "file_abc123def456",
"data": {
"tables": {
"table_id_1": {
"rows": [
{
"id": "row_1",
"cells": {
"Invoice Number": {
"value": "INV-001",
"columnId": "col_1",
"metadata": {
"id": "col_1",
"type": "TEXT",
"description": null,
"slug": "invoice_number"
},
"confidence": {
"overall": 0.94,
"llm": 0.95,
"layout": 0.91,
"consensus": null
},
"boundingBoxes": [
{
"page": "1",
"bbox": [
120,
45,
160,
300
]
}
],
"validations": [
{
"checkKey": "invoice-number-format",
"source": "SCRIPT",
"passed": true,
"message": "Matches expected format",
"expected": null,
"actual": null,
"amended": false
}
]
}
}
}
]
}
}
},
"validations": {
"failCount": 0,
"checks": [
{
"key": "invoice-number-format",
"name": "Invoice number format",
"source": "STATIC",
"status": "PASSED",
"behavior": "SURFACE",
"findings": [],
"errorMessage": null,
"startedAt": "2026-07-21T10:00:00.000Z",
"completedAt": "2026-07-21T10:00:05.000Z"
}
],
"rules": {
"crossField": [],
"row": [],
"document": []
}
}
}FAILED
Processing failed. Check the error message for details.
{
"status": "FAILED",
"fileId": "file_abc123def456",
"jobId": "job_789xyz012",
"errorMessage": "Document format not supported or file is corrupted"
}