Skip to main content
POST
Train Extraction

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

tenant
string | null
required

The domain of the customer

Example:

"example.com"

Body

application/json
document_id
string
required

The document ID of the files

llm_provider
enum<string> | null

The LLM provider to use. If not provided, the default provider will be used.

Available options:
OpenAI,
Google,
Altirnao,
MistralAI,
Anthropic
llm_model_prefix
string | null

The prefix of the LLM model name to use. If not provided, the default model will be used.

Example:

"gemini-2.5-pro"

attachment_filters
AttachmentFilter · object[] | null
deprecated

The attachments to extract metadata from. If provided then only the attachments matching one of the rules are used. If not provided then all attachments will be extracted. Deprecated: use sources with an attachments entry instead.

sources
(DescriptionExtractionSource · object | AttachmentsExtractionSource · object)[] | null

The ordered document content sources to extract metadata from. If omitted, attachment-only extraction is used for backward compatibility. Description sources are opt-in.

Minimum array length: 1
instruction
string | null

The prompt extension for the metadata extraction

provide_location
boolean
default:false

Whether to calculate and return page locations (bounding boxes) for the quote supporting each extracted field. Quotes are matched against textual and scanned PDF attachments plus PNG, JPEG, and WebP images without changing extracted values. Unsupported attachment types and quotes that do not occur verbatim after normalization do not produce boxes.

fields

Specification which metadata to extract and how. If not provided, all fields will be extracted.

example_documents
string[] | null

A list of example documents to use for metadata extraction. If provided, the LLM will use these documents to better understand the context and provide more accurate extractions.

registries
Registry · object[] | null

A list of metadata registries to use for metadata extraction. If provided, the LLM will use these registries to better understand the context and provide more accurate extractions.

Response

Successful Response

fields
FieldSuggestion · object[]
required

The suggested instructions for extracting the fields

extraction_instruction
string
required

The suggested instruction for the whole document

comment
string | null
required

Reason for the instruction change