POST
/
extract
Extract Structured Data by Schema
curl --request POST \
  --url https://api.trycardinal.ai/extract \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'fileUrl=<string>' \
  --form 'schema=<string>' \
  --form fast=false \
  --form 'customContext=<string>' \
  --form file=@example-file
{
  "response": "<string>",
  "method": "fast",
  "pages_processed": 123
}

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
file
file
required

PDF or image to upload (required if no fileUrl). Allowed: .pdf, .jpg, .jpeg, .png

schema
string
required

Required schema definition describing the fields to extract.

fileUrl
string<uri>

Publicly accessible URL of the file to process (required if no file).

fast
boolean
default:false

Fast path that extracts directly from pages without full pipeline post-processing.

customContext
string

Optional additional context or instructions to guide the extraction process. Useful for providing domain-specific guidance or clarifications about the document.

Response

Successful schema extraction

response
string
required

Model's structured output matching the provided schema. Will return as a stringified object.

method
enum<string>
Available options:
fast,
slow
pages_processed
integer

Present in slow mode.