Limai Docs
API ReferenceDocument Processing

Get All Data

Retrieve all processed data for a model in a simplified, flattened format.

GET/api/v1/extraction-schema/get-all-data

Retrieve all processed data for a model in a simplified, flattened JSON format. Data is organized by filename with normalized column names, making it ideal for bulk export, analytics, and integration with external systems.

Parameters

NameTypeInRequiredDescription
extractionSchemaIdstringqueryYesThe extraction schema (model) ID to retrieve data for.

Request

const response = await fetch(
`https://app.limai.io/api/v1/extraction-schema/get-all-data?extractionSchemaId=${schemaId}`,
{
  headers: { "Authorization": `Bearer ${API_TOKEN}` }
}
)
const allData = await response.json()

for (const [filename, fileData] of Object.entries(allData)) {
const records = Array.isArray(fileData) ? fileData : [fileData]
for (const record of records) {
  console.log(filename, record)
}
}

Response

Data is organized by filename. Single-row documents return an object; multi-row documents return an array. Nested tables appear as direct properties.

Multi-Row Example

Response200
{
  "invoice_001.pdf": [
    {
      "invoice_number": "INV-001",
      "total_amount": "1000.00",
      "line_items": [
        {
          "item_description": "Software License",
          "quantity": "1",
          "unit_price": "800.00"
        }
      ]
    },
    {
      "invoice_number": "INV-002",
      "total_amount": "500.00"
    }
  ],
  "invoice_002.pdf": {
    "invoice_number": "INV-003",
    "total_amount": "750.00"
  }
}

Empty Response

Returns an empty object {} when no data exists for the model.

Column Name Normalization

All column and table names are automatically normalized in the response:

  1. Convert to lowercase
  2. Replace spaces and slashes with underscores
  3. Remove special characters (keep letters, numbers, underscores)
  4. Collapse multiple underscores into one
  5. Remove leading/trailing underscores
Original NameNormalized
Invoice Numberinvoice_number
Total Amount ($)total_amount
Client's Emailclients_email
Date/Timedate_time

If multiple columns normalize to the same name, the API returns a 400 error with details about the conflicting columns. Rename one column in the platform to resolve the conflict.