Skip to main content
POST
/
api
/
v1
/
fill
Form Filling
curl --request POST \
  --url https://www.datalab.to/api/v1/fill \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form 'field_data=<string>' \
  --form 'file_url=<string>' \
  --form 'context=<string>' \
  --form confidence_threshold=0.5 \
  --form 'page_range=<string>' \
  --form skip_cache=false \
  --form 'file=<string>' \
  --form file.0='@example-file'
{
  "request_id": "<string>",
  "request_check_url": "<string>",
  "success": true,
  "error": "<string>",
  "versions": {}
}

Authorizations

X-API-Key
string
header
required

Cookies

access_token
string

Body

multipart/form-data
field_data
string
required

JSON string mapping field keys to values and descriptions. Format: {"field_key": {"value": "...", "description": "..."}}

file_url
string | null

Optional file URL (http/https). If provided, the server will download and process it.

context
string | null

Optional context to guide form filling (e.g., 'Initial hire for new employee').

confidence_threshold
number
default:0.5

Minimum confidence for field matching (0.0-1.0). Fields below this threshold won't be filled.

page_range
string | null

Pages to process, comma separated like 0,5-10,20. Example: '0,2-4' will process pages 0, 2, 3, and 4.

skip_cache
boolean
default:false

Skip the cache and re-run the inference. Defaults to False.

file
file | null

Input PDF, word document, powerpoint, or image file, uploaded as multipart form data. Images must be png, jpg, or webp format.

Response

Successful Response

request_id
string
required

The ID of the request. This ID can be used to check the status of the request.

request_check_url
string
required

The URL to check the status of the request and get results.

success
boolean
default:true

Whether the request was successful.

error
string | null

If the request was not successful, this will contain an error message.

versions

A dictionary of the versions of the libraries used in the request.