docs
UAEN
API Reference

Generate Extraction Schemas

Auto-generate an extraction schema from a sample document.

POST/api/v1/extract/schema/generate

Authorizations

X-API-Keystringheaderrequired
Your API key for authentication

Body Parameters

filefilebody
Input PDF, Word, PowerPoint, or image file. Images must be png, jpg, or webp.
file_urlstringbody
Optional file URL (http/https). If provided, the server will download and process it.
modestringbody
Output mode: 'fast', 'balanced', or 'accurate'.
max_pagesintegerbody
Maximum number of pages to process.
page_rangestringbody
Page range to process, comma separated like 0,5-10,20.
skip_cachebooleanbody
Skip the cache and re-run. Defaults to false.

Cookies

wos-sessionstringcookie
Session cookie
access_tokenstringcookie
Access token cookie
datalab_active_teamstringcookie
Active team cookie

Response

Successful Response
Generate Extraction Schemas
import requests

url = "https://www.datalab.to/api/v1/extract/schema/generate"
files = {
    "file.0": ("example-file", open("example-file", "rb"))
}
payload = {
    "mode": "fast"
}
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)
200Success
{
  "request_id": "<string>",
  "request_check_url": "<string>",
  "success": true,
  "error": "<string>",
  "versions": {}
}