Skip to main content

Autogenerate Extraction Config

Let Lido suggest an extraction configuration for a document. Lido looks at the first pages of the file and returns the columns, instructions and multi-row setting that it would use for extraction. This is the same logic as the Autogenerate button in the Data Extractor.

POST /autogenerate-extraction-config

Overview​

This endpoint returns a job ID. Use the Job Result endpoint to get the suggested configuration. You can pass it straight to Extract File Data, or adjust it first.

Cost

Each call uses 1 data extractor credit, whatever the length of the document. The credit is charged when the request is accepted.

Request​

The file is uploaded the same way as for Extract File Data, using either JSON with base64 encoding (up to 50MB) or multipart form data (up to 500MB). This endpoint takes no other parameters. Requests with extra fields (for example instructions or columns) are rejected.

Rate Limit: 5 requests per 30 seconds

JSON Base64 Upload​

ParameterTypeRequiredDescription
fileobject✅File information object
file.typestring✅Must be "base64"
file.datastring✅Base64 encoded file content
file.namestring❌Original filename (e.g., "invoice.pdf")

Multipart Form Data Upload​

FieldTypeRequiredDescription
filefile✅The document file to analyze

Examples​

import requests
import base64

url = "https://sheets.lido.app/api/v1/autogenerate-extraction-config"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}

with open("invoice.pdf", "rb") as file:
file_base64 = base64.b64encode(file.read()).decode("utf-8")

payload = {
"file": {
"type": "base64",
"data": file_base64,
"name": "invoice.pdf"
}
}

response = requests.post(url, headers=headers, json=payload)
print(f"Job ID: {response.json()['jobId']}")

Response​

{
"status": "running",
"jobId": "hj1:c37e0a3b-0bd7-44d0-be7a-3cd1e2a70837"
}

If you have no data extractor credits left, the endpoint responds with 402 Payment Required.

Result​

Once the job completes, the Job Result endpoint returns:

{
"status": "success",
"columns": [
"Vendor Name",
"Invoice Number",
"Invoice Date",
"Item Description",
"Item Quantity",
"Item Amount ($)"
],
"instructions": "Extract each line item as a separate row. Ensure amounts are formatted as numbers without currency symbols.",
"multiRow": true
}
FieldTypeDescription
statusstringJob status - will be "success"
columnsarraySuggested column names
instructionsstringSuggested extraction instructions
multiRowbooleanWhether the document should produce multiple rows