Limai Docs
API ReferenceDeployments

Documents Data (Flat, Bulk)

Retrieve extracted data for multiple documents in a flat, slug-keyed structure

POST/api/v1/deployments/{deploymentId}/documents/data

Bulk version of Document Data (Flat): pass every file ID you want data for and get one response back — a single document is just a one-element fileIds array. Each entry follows exactly the single-document shape and rules (tables keyed by table slug, rows keyed by column slug, $-prefixed system keys, child tables nested inline).

Parameters

NameTypeInRequiredDescription
deploymentIdstringpathYesThe model or deployment the documents belong to.
fileIdsstring[]bodyYesFile IDs to fetch (1–100). Duplicates are ignored.
includestring[]bodyNoOptional enrichments: confidence, boundingBoxes, validations.

Behavior

  • documents preserves the order of fileIds (after de-duplication). Each entry carries its own statusCOMPLETED entries have data, PROCESSING/FAILED entries have a jobId (and errorMessage on failure) — so a batch with in-flight documents still returns everything else.
  • File IDs that don't exist or don't belong to the deployment are listed in missing instead of failing the batch.
  • Slug problems (a table or column without a slug, or a duplicate slug) are schema-level and affect every document identically, so they fail the whole request with 422 — same as the single-document endpoint.

Request

const response = await fetch(
`https://app.limai.io/api/v1/deployments/${deploymentId}/documents/data`,
{
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    fileIds: ["file_9k2mx4", "file_3p7va1"],
    include: ["validations"]
  })
}
)
const { documents, missing } = await response.json()

Response

Response200
{
  "documents": [
    {
      "fileId": "file_9k2mx4",
      "status": "COMPLETED",
      "jobId": "job_5tr8n1",
      "data": {
        "invoices": [
          {
            "$id": "row_h1",
            "$index": "0",
            "invoice_number": {
              "value": "INV-2041"
            },
            "total_amount": {
              "value": "1250.00"
            },
            "line_items": [
              {
                "$id": "row_li1",
                "$index": "0",
                "description": {
                  "value": "Solar panel mounting kit"
                },
                "amount": {
                  "value": "740.00"
                }
              }
            ]
          }
        ]
      }
    },
    {
      "fileId": "file_3p7va1",
      "status": "PROCESSING",
      "jobId": "job_8xw2k9"
    }
  ],
  "missing": [
    "file_gone01"
  ]
}
Response422
{
  "error": "Column \"Invoice Number\" (col_8s3k1) has no slug. Run the slug backfill for this schema."
}

On this page