Overview
The Split Document endpoint analyzes PDF pages, classifies them into predefined categories, and creates separate PDF files for each category. This is ideal for processing mixed document batches like scanned files containing invoices, contracts, and reports.
The endpoint returns a ZIP file containing the split documents, with classification and confidence score data provided in response headers.
Response
The endpoint returns a JSON response containing information about the split PDF documents that have been uploaded to cloud storage.
Whether the splitting operation succeeded
Descriptive message about the splitting operation
Array of split PDF files with their metadata Original filename of the split PDF (e.g., “invoice.pdf”)
Unique identifier for the file in storage
File type (always “file”)
Relative path to the file in storage
Complete URL to download the split PDF file
Confidence score for the classification of pages in this file
Request Examples
curl -X 'POST' \
'https://prod.visionapi.unsiloed.ai/splitter/split-pdf-v1?classes=invoice%2Creport' \
-H 'accept: application/json' \
-H 'api-key: your-api-key' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@mixed_documents.pdf;type=application/pdf' \
-F 'categories={"invoice":"Business invoices with itemized charges","contract":"Legal agreements and binding documents"}'
Response Examples
Success Response
Error Response - Invalid File
Error Response - Missing Classes
Error Response - Processing Failed
{
"success" : true ,
"message" : "Successfully split PDF into 2 files" ,
"files" : [
{
"name" : "invoice.pdf" ,
"fileId" : "d079d09f-201c-4420-a50a-b25678a71ae9" ,
"type" : "file" ,
"path" : "invoice.pdf" ,
"full_path" : "https://lyltzyvtloozzovxrupp.supabase.co/storage/v1/object/public/files/ef3ec356-b407-4f9f-ac8f-0dfdef9034c0_invoice.pdf?" ,
"confidence_score" : 0.8
},
{
"name" : "contract.pdf" ,
"fileId" : "320616cc-8dfd-4b8a-8474-8e7a42d9e287" ,
"type" : "file" ,
"path" : "contract.pdf" ,
"full_path" : "https://lyltzyvtloozzovxrupp.supabase.co/storage/v1/object/public/files/dfaa5d30-6955-4a69-9c69-7e3c4efd8450_contract.pdf?" ,
"confidence_score" : 0.8
}
]
}
Comma-separated categories (e.g., invoice,contract)
JSON string with category descriptions
The response is of type object
.