Skip to main content
POST
Extract Custom Metadata

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

json_schema
OpenAISchema · object
required

The metadata schema to be extracted. It is the OpenAI supported subset of the JSON schema. The additional_properties and required fields are automatically generated so their value is ignored.

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.

integer_decimal_handling
enum<string>
default:error

How to coerce a decimal value the LLM returns for any integer-typed field in the schema: truncate drops the fractional part (3.7 → 3), round rounds to the nearest integer (3.5 → 4, 3.4 → 3), roundup always rounds up toward positive infinity (3.2 → 4), error raises an extraction error (default — current behavior). Applies uniformly to all integer fields in the JSON schema.

Available options:
truncate,
round,
roundup,
error

Response

Successful Response

The response is of type Response Extract Custom Metadata Assistant Api V1 Tenants Tenant Metadata Extractcustom Post · object.