Limai Docs
API ReferenceDocument Processing

Get Files Data (Bulk)

Retrieve extracted data for multiple files in a single request.

POST/api/v1/document/get-files-data

Retrieve extracted data for multiple files in a single request. Accepts up to 100 file IDs and returns data for all accessible files.

Parameters

NameTypeInRequiredDescription
fileIdsstring[]bodyYesArray of file IDs to retrieve data for. Minimum 1, maximum 100.
includestring[]bodyNoOptional enrichments to include: confidence, boundingBoxes, validations, metadata. Omit for the plain data payload.

Optional Enrichments

By default each file's payload contains only the extracted values. Pass include to enrich the response:

  • confidence — adds a confidence object to every cell with overall, llm, layout, and consensus scores (0–1, null when not computed).
  • boundingBoxes — adds a boundingBoxes array 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. null when boxes were never computed for the cell.
  • validations — adds a validations array to every cell and a per-file validations object carrying that document's status, its failCount, the custom validation results (checks) and the validation rule results (rules). The shapes are the ones documented under Get File Data, resolved per file.
  • metadata — adds a top-level _meta block to each file's result, describing the document itself. See Metadata.

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-files-data",
{
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    fileIds: ["file_abc123", "file_def456", "file_ghi789"],
    include: ["confidence", "validations"]
  })
}
)
const results = await response.json()

Response

Returns results, an object whose keys are file IDs and whose values carry each file's data and status, alongside a summary counting the statuses. Each file reports its extraction job for the model it belongs to; this endpoint does not accept a jobId. Use get-file-data with a jobId to validate a read against the job you queued.

For each file, COMPLETED guarantees the extracted data is present in the same response (an empty-but-successful extraction still reports COMPLETED with empty tables). A file whose latest job is still queued reports PROCESSING, and a stalled job reports FAILED — never a partial COMPLETED. A file ID that does not exist or is not accessible reports NOT_FOUND instead of failing the batch.

Response200
{
  "results": {
    "file_abc123": {
      "status": "COMPLETED",
      "fileId": "file_abc123",
      "data": {
        "tables": {}
      }
    },
    "file_def456": {
      "status": "PROCESSING",
      "fileId": "file_def456"
    },
    "file_ghi789": {
      "status": "NOT_FOUND",
      "fileId": "file_ghi789"
    }
  },
  "summary": {
    "completed": 1,
    "processing": 1,
    "failed": 0,
    "classifying": 0,
    "not_found": 1,
    "total": 3
  }
}

Validation Error

Response400
{
  "error": "Validation error",
  "details": {
    "fieldErrors": {
      "fileIds": [
        "Array must contain at least 1 element(s)"
      ]
    }
  }
}

Metadata

include: ["metadata"] adds a reserved _meta key to each file's result object, beside fileId, status and data. It describes the document itself, not its cells, so it is the one enrichment that leaves the extracted values untouched.

Response200
{
  "results": {
    "file_abc123": {
      "status": "COMPLETED",
      "fileId": "file_abc123",
      "data": {
        "tables": {}
      },
      "_meta": {
        "documentId": "cmm3k7r2v0007",
        "fileName": "broker-quote-2026-09.pdf",
        "submittedAt": "2026-09-01T10:12:33.000Z",
        "submittedBy": {
          "id": "usr_8a2f",
          "name": "Jane Doe",
          "email": "jane@acme.com"
        },
        "extractedAt": "2026-09-01T10:14:02.000Z"
      }
    },
    "file_def456": {
      "status": "PROCESSING",
      "fileId": "file_def456",
      "_meta": {
        "documentId": "cmm3k1q9x0001",
        "fileName": "invoice_001.pdf",
        "submittedAt": "2026-09-02T08:41:10.000Z",
        "submittedBy": null,
        "extractedAt": null
      }
    },
    "file_ghi789": {
      "status": "NOT_FOUND",
      "fileId": "file_ghi789"
    }
  },
  "summary": {
    "completed": 1,
    "processing": 1,
    "failed": 0,
    "classifying": 0,
    "not_found": 1,
    "total": 3
  }
}

Fields of _meta:

FieldDescription
documentIdThe file's ID.
fileNameThe uploaded file name.
submittedAtWhen the file was uploaded, shown as "Date Added" in the grid.
submittedByThe user who uploaded the document, as { id, name, email }. null when the uploader is unknown.
extractedAtWhen the latest extraction run completed. null when no run has completed.

_meta is present on every result whose file was found and accessible, whatever its status — PROCESSING, CLASSIFYING and FAILED results carry it too. NOT_FOUND results have none.

An unrecognized include value returns a 400 naming the allowed values, metadata among them.

Backwards compatibility

Without metadata in include, the response shape is exactly the one documented under Response.

On this page