API ReferenceDocument Processing
Submit Corrections
Accept or modify the extracted data from document processing.
POST
/api/v1/document/{extractionSchemaId}/process-file/{fileId}/submit-correctionsAccept or modify extracted data from document processing. Supports accepting all results at once or making granular corrections including deleting, updating, and adding rows.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
extractionSchemaId | string | path | Yes | The extraction schema ID used for processing. |
fileId | string | path | Yes | The file ID of the processed document. |
acceptAll | boolean | body | No | Set to true to accept all extracted rows without modifications. |
tables | object | body | No | Object containing granular corrections. Keys are table IDs. |
Either acceptAll or tables must be provided.
Accept All Rows
const response = await fetch(
`https://app.limai.io/api/v1/document/${SCHEMA_ID}/process-file/${fileId}/submit-corrections`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ acceptAll: true })
}
)Granular Corrections
Make specific changes to extracted data including deletions, updates, and new rows.
const response = await fetch(
`https://app.limai.io/api/v1/document/${SCHEMA_ID}/process-file/${fileId}/submit-corrections`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
tables: {
"table_id_1": {
deletedRowIds: ["row_2", "row_3"],
updatedRows: [
{
id: "row_1",
cells: {
"Invoice Number": "INV-001-CORRECTED",
"Amount": "1200.00"
}
}
],
newRows: [
{
cells: {
"Invoice Number": "INV-004",
"Amount": "750.00"
}
}
]
}
}
})
}
)Response
Response200
{
"message": "All rows accepted successfully",
"fileId": "file_abc123def456",
"data": {
"tables": {
"table_id_1": {
"id": "table_id_1",
"name": "Invoices",
"rows": [
{
"id": "row_1",
"status": "ACCEPTED",
"cells": {
"Invoice Number": {
"value": "INV-001",
"columnId": "col_1"
}
}
}
]
}
}
},
"summary": {
"rowsAccepted": 2,
"rowsDeleted": 0,
"rowsUpdated": 0,
"rowsAdded": 0,
"tablesAffected": [
"table_id_1"
]
}
}Cell Value Formats
When submitting cell values, use the appropriate format for each column type:
| Column Type | Format | Example |
|---|---|---|
| TEXT, EMAIL | String | "John Doe" |
| NUMBER | Number or numeric string | 1250.75 or "42" |
| DATE | ISO, US, EU, or written format | "2024-01-15", "01/15/2024" |
| CHECKBOX | Boolean or truthy string | true, "yes", "1" |
| LABEL | Array or single string (auto-uppercased) | ["ELECTRICITY", "UTILITIES"] |
| URL | Object with url/label or plain string | {"url": "https://example.com", "label": "Site"} |