API ReferenceDocument Processing
Process File (Sync)
Extract structured data from an uploaded document synchronously.
POST
/api/v1/document/{extractionSchemaId}/process-file/{fileId}SYNCExtract structured data from an uploaded file using AI-powered document processing. This endpoint processes the document synchronously and returns the extracted data immediately upon completion.
For large files or batch processing, consider using the async endpoint instead.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
extractionSchemaId | string | path | Yes | The extraction schema ID to use for processing. |
fileId | string | path | Yes | The file ID returned from the get-url endpoint after uploading. |
The request body should be an empty JSON object {}.
Request
const response = await fetch(
`https://app.limai.io/api/v1/document/${SCHEMA_ID}/process-file/${fileId}`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
}
)
const result = await response.json()Response
Response200
{
"message": "File processed successfully.",
"fileId": "file_abc123def456",
"jobId": "job_789xyz012",
"data": {
"tables": {
"table_id_1": {
"id": "table_id_1",
"name": "Invoices",
"columns": [
{
"id": "col_1",
"name": "Invoice Number",
"type": "TEXT",
"description": "Unique invoice identifier"
},
{
"id": "col_2",
"name": "Amount",
"type": "NUMBER",
"description": "Invoice total amount"
}
],
"rows": [
{
"id": "row_1",
"index": "0",
"status": "PENDING",
"cells": {
"Invoice Number": {
"value": "INV-001",
"columnId": "col_1"
},
"Amount": {
"value": "1000.00",
"columnId": "col_2"
}
}
}
]
}
}
}
}Data Structure
Table
| Field | Type | Description |
|---|---|---|
id | string | Unique table identifier |
name | string | Human-readable table name |
columns | array | Array of column definitions (id, name, type, description) |
rows | array | Array of extracted data rows |
Row
| Field | Type | Description |
|---|---|---|
id | string | Unique row identifier |
index | string | Row position |
status | string | Row status: PENDING, ACCEPTED, or REJECTED |
cells | object | Cell data keyed by column name |
childTables | object | Nested child tables (if schema has relationships) |
Cell
| Field | Type | Description |
|---|---|---|
value | string | Extracted cell value |
columnId | string | Reference to the column definition |
When to Use Sync vs Async
| Synchronous | Asynchronous | |
|---|---|---|
| Best for | Small files (< 10MB), real-time UIs | Large files, batch processing |
| Behavior | Blocks until complete | Returns job ID immediately |
| Timeout risk | May timeout on large files | No timeout limitations |