Limai Docs
API ReferenceDocument Processing

Submit Corrections

Accept or modify the extracted data from document processing.

POST/api/v1/document/{extractionSchemaId}/process-file/{fileId}/submit-corrections

Accept or modify extracted data from document processing. Supports accepting all results at once or making granular corrections including deleting, updating, and adding rows.

Parameters

NameTypeInRequiredDescription
extractionSchemaIdstringpathYesThe model's ID, the ID of a deployment that points at it, or the model's extraction schema ID. The extraction schema ID is returned when listing a project's deployments, and is also shown at the bottom of the data page in the dashboard.
fileIdstringpathYesThe file ID of the processed document.
acceptAllbooleanbodyNoSet to true to accept all extracted rows without modifications.
tablesobjectbodyNoObject 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"
    ]
  },
  "modelId": "dep_abc123",
  "viaDeploymentId": "dpl_prod01"
}

modelId is the model the request resolved to, and viaDeploymentId the deployment it arrived through — null when the request named the model directly.

Cell Value Formats

When submitting cell values, use the appropriate format for each column type:

Column TypeFormatExample
TEXT, EMAILString"John Doe"
NUMBERNumber or numeric string1250.75 or "42"
DATEISO, US, EU, or written format"2024-01-15", "01/15/2024"
CHECKBOXBoolean or truthy stringtrue, "yes", "1"
LABELArray or single string (auto-uppercased)["ELECTRICITY", "UTILITIES"]
URLObject with url/label or plain string{"url": "https://example.com", "label": "Site"}

On this page