TL;DR
Send an array of descriptions for what you want (e.g., “invoices”, “contracts”, “account number xyz”). Cardinal returns which pages match each description. Note: Each page is matched to at most one partition type for accuracy purposes.Endpoint
POSThttps://api.trycardinal.ai/splitContent-Type:
multipart/form-dataAuth:
X-API-KEY: <API_KEY>
You may provide eitherfileorfileUrl.
Required parameters
queries(string) — JSON-encoded array of query objects (see format below)file(file upload) ORfileUrl(string)
Optional parameters
customContext(string) — Additional context to improve classification accuracy and help the model understand domain-specific terminology. Use this to provide background information about the document type, industry, or specific terminology that will help with more accurate page classification.
Query object format
Each query is:name(string) — label you’ll see in the response (e.g.,"invoices")description(string, optional) — natural-language hint used to find relevant pages
queries value
Example requests
Example Response
Response Format
The response includes:success- Boolean indicating if partitioning completed successfullypages- Array of page objects with content and metadatapartitions- Array of partition results, each containing:name- The partition name from your querydescription- The partition description from your querypages- Array of page numbers that match this partition (sorted)
Supported File Types
This endpoint supports:- PDF files (.pdf)
- Images (.jpg, .jpeg, .png)
Writing Effective Queries
Good query descriptions:- Be specific about content type: “Financial tables with revenue data”
- Include context clues: “Pages with signatures or sign-off sections”
- Mention visual indicators: “Charts, graphs, or data visualizations”
- Too vague: “Important pages”
- Overly restrictive: “Page 5 specifically about Q3 sales in the northeast region”
Under the Hood
We run the document through our full Markdown pipeline first, converting it into a precise text representation. Only then do we split, ensuring the results are consistent and accurate.Extraction Endpoint
POSThttps://api.trycardinal.ai/split/extractContent-Type:
multipart/form-dataAuth:
X-API-KEY: <API_KEY>
After classifying pages with /split, use /split/extract to download specific pages as a separate PDF.
Required parameters
pages(string) — JSON-encoded array of page numbers (e.g.,"[1, 3, 5, 7]")file(file upload) ORfileUrl(string)
Example requests
Response Format
The/split/extract endpoint returns a PDF file directly.
- Content-Type:
application/pdf - Content-Disposition:
attachment; filename="<your-filename>.pdf"
.pdf file.