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.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
file | object | ✅ | File information object |
file.type | string | ✅ | Must be "base64" |
file.data | string | ✅ | Base64 encoded file content |
file.name | string | ❌ | Original filename (e.g., "invoice.pdf") |
Multipart Form Data Upload
| Field | Type | Required | Description |
|---|---|---|---|
file | file | ✅ | The document file to analyze |
Examples
- Python
- cURL
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']}")
curl --request POST \
--url 'https://sheets.lido.app/api/v1/autogenerate-extraction-config' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--form 'file=@invoice.pdf'
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
}
| Field | Type | Description |
|---|---|---|
status | string | Job status - will be "success" |
columns | array | Suggested column names |
instructions | string | Suggested extraction instructions |
multiRow | boolean | Whether the document should produce multiple rows |