curl -X GET "https://prod.visionapi.unsiloed.ai/splitter/04a7a6d8-5ef7-465a-b22a-8a98e7104dd9" \
-H "accept: application/json" \
-H "api-key: your-api-key"
import requests
def get_split_status(job_id, api_key):
"""Get the status of a splitting job"""
url = f"https://prod.visionapi.unsiloed.ai/splitter/{job_id}"
headers = {"api-key": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 200:
job = response.json()
print(f"Job Status: {job['status']}")
if job['status'] == 'completed':
print("Split completed successfully!")
if job.get('result', {}).get('success'):
print(f"Message: {job['result']['message']}")
for file_info in job['result']['files']:
print(f" File: {file_info['name']}")
print(f" Download: {file_info['full_path']}")
return job
elif job['status'] == 'failed':
print(f"Job failed: {job.get('error', 'Unknown error')}")
return None
elif job['status'] == 'processing':
print(f"Job is processing: {job.get('progress', '')}")
return job
else:
print("Error:", response.status_code, response.text)
return None
# Usage
job_id = "04a7a6d8-5ef7-465a-b22a-8a98e7104dd9"
result = get_split_status(job_id, "your-api-key")
async function getSplitStatus(jobId, apiKey) {
const response = await fetch(`https://prod.visionapi.unsiloed.ai/splitter/${jobId}`, {
headers: {
'accept': 'application/json',
'api-key': apiKey
}
});
if (response.ok) {
const job = await response.json();
console.log('Job Status:', job.status);
switch (job.status) {
case 'completed':
console.log('Split completed successfully!');
if (job.result?.success) {
console.log('Message:', job.result.message);
job.result.files.forEach(file => {
console.log(` File: ${file.name}`);
console.log(` Download: ${file.full_path}`);
});
}
return job;
case 'failed':
console.log('Job failed:', job.error || 'Unknown error');
return null;
case 'processing':
console.log('Job is processing:', job.progress || '');
return job;
default:
console.log('Unknown status:', job.status);
return job;
}
} else {
console.error('Failed to get job status:', await response.text());
return null;
}
}
// Usage
const jobId = '04a7a6d8-5ef7-465a-b22a-8a98e7104dd9';
const result = await getSplitStatus(jobId, 'your-api-key');
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "completed",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {
"Invoice": "Financial invoices with itemized charges",
"Receipt": "Purchase receipts"
},
"enable_reordering": false,
"page_count": 10
},
"result": {
"success": true,
"message": "Successfully split PDF into 3 files",
"files": [
{
"name": "Invoice.pdf",
"path": "Invoice.pdf",
"type": "file",
"fileId": "580e091d-c354-4558-8318-89e600346691",
"full_path": "https://example-bucket.s3.amazonaws.com/files/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"confidence_score": 0.999147126422347
},
{
"name": "Contract.pdf",
"path": "Contract.pdf",
"type": "file",
"fileId": "680e091d-c354-4558-8318-89e600346692",
"full_path": "https://example-bucket.s3.amazonaws.com/files/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"confidence_score": 0.987654321098765
}
]
},
"error": null
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "processing",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {},
"enable_reordering": false,
"page_count": 10
},
"result": null,
"error": null
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "failed",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {},
"enable_reordering": false,
"page_count": 10
},
"result": null,
"error": "Failed to process document: Invalid PDF format"
}
Splitting
Get Split Result
Check the status and retrieve results of document splitting jobs
GET
/
splitter
/
{job_id}
curl -X GET "https://prod.visionapi.unsiloed.ai/splitter/04a7a6d8-5ef7-465a-b22a-8a98e7104dd9" \
-H "accept: application/json" \
-H "api-key: your-api-key"
import requests
def get_split_status(job_id, api_key):
"""Get the status of a splitting job"""
url = f"https://prod.visionapi.unsiloed.ai/splitter/{job_id}"
headers = {"api-key": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 200:
job = response.json()
print(f"Job Status: {job['status']}")
if job['status'] == 'completed':
print("Split completed successfully!")
if job.get('result', {}).get('success'):
print(f"Message: {job['result']['message']}")
for file_info in job['result']['files']:
print(f" File: {file_info['name']}")
print(f" Download: {file_info['full_path']}")
return job
elif job['status'] == 'failed':
print(f"Job failed: {job.get('error', 'Unknown error')}")
return None
elif job['status'] == 'processing':
print(f"Job is processing: {job.get('progress', '')}")
return job
else:
print("Error:", response.status_code, response.text)
return None
# Usage
job_id = "04a7a6d8-5ef7-465a-b22a-8a98e7104dd9"
result = get_split_status(job_id, "your-api-key")
async function getSplitStatus(jobId, apiKey) {
const response = await fetch(`https://prod.visionapi.unsiloed.ai/splitter/${jobId}`, {
headers: {
'accept': 'application/json',
'api-key': apiKey
}
});
if (response.ok) {
const job = await response.json();
console.log('Job Status:', job.status);
switch (job.status) {
case 'completed':
console.log('Split completed successfully!');
if (job.result?.success) {
console.log('Message:', job.result.message);
job.result.files.forEach(file => {
console.log(` File: ${file.name}`);
console.log(` Download: ${file.full_path}`);
});
}
return job;
case 'failed':
console.log('Job failed:', job.error || 'Unknown error');
return null;
case 'processing':
console.log('Job is processing:', job.progress || '');
return job;
default:
console.log('Unknown status:', job.status);
return job;
}
} else {
console.error('Failed to get job status:', await response.text());
return null;
}
}
// Usage
const jobId = '04a7a6d8-5ef7-465a-b22a-8a98e7104dd9';
const result = await getSplitStatus(jobId, 'your-api-key');
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "completed",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {
"Invoice": "Financial invoices with itemized charges",
"Receipt": "Purchase receipts"
},
"enable_reordering": false,
"page_count": 10
},
"result": {
"success": true,
"message": "Successfully split PDF into 3 files",
"files": [
{
"name": "Invoice.pdf",
"path": "Invoice.pdf",
"type": "file",
"fileId": "580e091d-c354-4558-8318-89e600346691",
"full_path": "https://example-bucket.s3.amazonaws.com/files/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"confidence_score": 0.999147126422347
},
{
"name": "Contract.pdf",
"path": "Contract.pdf",
"type": "file",
"fileId": "680e091d-c354-4558-8318-89e600346692",
"full_path": "https://example-bucket.s3.amazonaws.com/files/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"confidence_score": 0.987654321098765
}
]
},
"error": null
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "processing",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {},
"enable_reordering": false,
"page_count": 10
},
"result": null,
"error": null
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "failed",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {},
"enable_reordering": false,
"page_count": 10
},
"result": null,
"error": "Failed to process document: Invalid PDF format"
}
Overview
The Get Split Status endpoint retrieves the status and results of a document splitting job. Use this endpoint to check if splitting is complete and download the resulting split documents.Splitting jobs are processed asynchronously. Poll this endpoint to check completion status.
Path Parameters
string
required
The unique identifier of the splitting job
Response
string
Unique identifier for the splitting job
string
Current job status: “queued” while the job waits to be picked up, “processing” while it runs, then “completed” or “failed”
string
Progress message describing current processing stage
string
Presigned download URL for the original uploaded file. Expires roughly an hour after the response is generated; re-issue this request to get a fresh URL.
string
Name of the original file
object
Echo of the parameters used for this job
object
Split results. Always present as a key;
null until status is “completed”Show result_structure
Show result_structure
boolean
Whether the splitting operation succeeded
string
Success/failure message (e.g., “Successfully split PDF into 3 files”)
array
Array of split PDF files
Show file_structure
Show file_structure
string
Name of the split file (e.g., “Invoice.pdf”)
string
Relative path to the file
string
File type (always “file”)
string
Unique file identifier
string
Presigned download URL for the split file. Expires roughly an hour after the response is generated, so download the file straight away rather than storing the URL. Re-issue this request to get a fresh URL.
number
Classification confidence score (0.0-1.0)
string
Error message (if job failed, otherwise null)
curl -X GET "https://prod.visionapi.unsiloed.ai/splitter/04a7a6d8-5ef7-465a-b22a-8a98e7104dd9" \
-H "accept: application/json" \
-H "api-key: your-api-key"
import requests
def get_split_status(job_id, api_key):
"""Get the status of a splitting job"""
url = f"https://prod.visionapi.unsiloed.ai/splitter/{job_id}"
headers = {"api-key": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 200:
job = response.json()
print(f"Job Status: {job['status']}")
if job['status'] == 'completed':
print("Split completed successfully!")
if job.get('result', {}).get('success'):
print(f"Message: {job['result']['message']}")
for file_info in job['result']['files']:
print(f" File: {file_info['name']}")
print(f" Download: {file_info['full_path']}")
return job
elif job['status'] == 'failed':
print(f"Job failed: {job.get('error', 'Unknown error')}")
return None
elif job['status'] == 'processing':
print(f"Job is processing: {job.get('progress', '')}")
return job
else:
print("Error:", response.status_code, response.text)
return None
# Usage
job_id = "04a7a6d8-5ef7-465a-b22a-8a98e7104dd9"
result = get_split_status(job_id, "your-api-key")
async function getSplitStatus(jobId, apiKey) {
const response = await fetch(`https://prod.visionapi.unsiloed.ai/splitter/${jobId}`, {
headers: {
'accept': 'application/json',
'api-key': apiKey
}
});
if (response.ok) {
const job = await response.json();
console.log('Job Status:', job.status);
switch (job.status) {
case 'completed':
console.log('Split completed successfully!');
if (job.result?.success) {
console.log('Message:', job.result.message);
job.result.files.forEach(file => {
console.log(` File: ${file.name}`);
console.log(` Download: ${file.full_path}`);
});
}
return job;
case 'failed':
console.log('Job failed:', job.error || 'Unknown error');
return null;
case 'processing':
console.log('Job is processing:', job.progress || '');
return job;
default:
console.log('Unknown status:', job.status);
return job;
}
} else {
console.error('Failed to get job status:', await response.text());
return null;
}
}
// Usage
const jobId = '04a7a6d8-5ef7-465a-b22a-8a98e7104dd9';
const result = await getSplitStatus(jobId, 'your-api-key');
Polling for Job Completion
Here are complete examples that poll the splitting job until it completes:#!/bin/bash
JOB_ID="04a7a6d8-5ef7-465a-b22a-8a98e7104dd9"
API_KEY="your-api-key"
MAX_ATTEMPTS=60
SLEEP_INTERVAL=5
echo "Polling split job status..."
for ((i=1; i<=MAX_ATTEMPTS; i++)); do
echo "Attempt $i..."
RESPONSE=$(curl -s -X GET "https://prod.visionapi.unsiloed.ai/splitter/$JOB_ID" \
-H "accept: application/json" \
-H "api-key: $API_KEY")
STATUS=$(echo $RESPONSE | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
echo "Status: $STATUS"
if [ "$STATUS" = "completed" ]; then
echo "Split completed successfully!"
echo $RESPONSE | python -m json.tool
break
elif [ "$STATUS" = "failed" ]; then
echo "Split failed!"
echo $RESPONSE | python -m json.tool
break
else
echo "Still processing... waiting $SLEEP_INTERVAL seconds"
sleep $SLEEP_INTERVAL
fi
done
import requests
import time
def poll_split_job(job_id, api_key, max_attempts=60, sleep_interval=5):
"""
Poll a splitting job until completion or failure
Args:
job_id: The job ID returned from split request
api_key: Your API key
max_attempts: Maximum number of polling attempts
sleep_interval: Seconds to wait between polls
Returns:
Final job result or None if failed
"""
url = f"https://prod.visionapi.unsiloed.ai/splitter/{job_id}"
headers = {"api-key": api_key}
print(f"Polling split job {job_id}...")
for attempt in range(1, max_attempts + 1):
print(f"Attempt {attempt}...")
try:
response = requests.get(url, headers=headers)
if response.status_code == 200:
job = response.json()
status = job.get('status')
progress = job.get('progress', '')
print(f"Status: {status}")
if progress:
print(f"Progress: {progress}")
if status == 'completed':
print("\n✓ Split completed successfully!")
if job.get('result', {}).get('success'):
print(f"Message: {job['result']['message']}")
print(f"\nSplit files:")
for file_info in job['result']['files']:
print(f" • {file_info['name']}")
print(f" Download: {file_info['full_path']}")
print(f" Confidence: {file_info['confidence_score']:.2%}")
return job
elif status == 'failed':
print(f"\n✗ Split failed: {job.get('error', 'Unknown error')}")
return None
elif status == 'processing':
print(f"Still processing... waiting {sleep_interval} seconds\n")
time.sleep(sleep_interval)
elif response.status_code == 404:
print(f"Job not found. It may have expired.")
return None
else:
print(f"Error: {response.status_code} - {response.text}")
return None
except Exception as e:
print(f"Error polling job: {e}")
return None
print(f"Max attempts ({max_attempts}) reached. Job may still be processing.")
return None
# Usage
job_id = "04a7a6d8-5ef7-465a-b22a-8a98e7104dd9"
result = poll_split_job(job_id, "your-api-key")
if result:
print("Split job finished.")
async function pollSplitJob(jobId, apiKey, maxAttempts = 60, sleepInterval = 5000) {
/**
* Poll a splitting job until completion or failure
*
* @param {string} jobId - The job ID returned from split request
* @param {string} apiKey - Your API key
* @param {number} maxAttempts - Maximum number of polling attempts
* @param {number} sleepInterval - Milliseconds to wait between polls
* @returns {Promise<object|null>} Final job result or null if failed
*/
const url = `https://prod.visionapi.unsiloed.ai/splitter/${jobId}`;
console.log(`Polling split job ${jobId}...`);
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
console.log(`Attempt ${attempt}...`);
try {
const response = await fetch(url, {
headers: {
'accept': 'application/json',
'api-key': apiKey
}
});
if (response.ok) {
const job = await response.json();
const { status, progress } = job;
console.log(`Status: ${status}`);
if (progress) console.log(`Progress: ${progress}`);
if (status === 'completed') {
console.log('\n✓ Split completed successfully!');
if (job.result?.success) {
console.log(`Message: ${job.result.message}`);
console.log('\nSplit files:');
job.result.files.forEach(file => {
console.log(` • ${file.name}`);
console.log(` Download: ${file.full_path}`);
console.log(` Confidence: ${(file.confidence_score * 100).toFixed(2)}%`);
});
}
return job;
}
if (status === 'failed') {
console.log(`\n✗ Split failed: ${job.error || 'Unknown error'}`);
return null;
}
if (status === 'processing') {
console.log(`Still processing... waiting ${sleepInterval/1000} seconds\n`);
await new Promise(resolve => setTimeout(resolve, sleepInterval));
}
} else if (response.status === 404) {
console.log('Job not found. It may have expired.');
return null;
} else {
console.error('Error:', response.status, await response.text());
return null;
}
} catch (error) {
console.error('Error polling job:', error);
return null;
}
}
console.log(`Max attempts (${maxAttempts}) reached. Job may still be processing.`);
return null;
}
// Usage
const jobId = '04a7a6d8-5ef7-465a-b22a-8a98e7104dd9';
const result = await pollSplitJob(jobId, 'your-api-key');
if (result) {
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "completed",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {
"Invoice": "Financial invoices with itemized charges",
"Receipt": "Purchase receipts"
},
"enable_reordering": false,
"page_count": 10
},
"result": {
"success": true,
"message": "Successfully split PDF into 3 files",
"files": [
{
"name": "Invoice.pdf",
"path": "Invoice.pdf",
"type": "file",
"fileId": "580e091d-c354-4558-8318-89e600346691",
"full_path": "https://example-bucket.s3.amazonaws.com/files/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"confidence_score": 0.999147126422347
},
{
"name": "Contract.pdf",
"path": "Contract.pdf",
"type": "file",
"fileId": "680e091d-c354-4558-8318-89e600346692",
"full_path": "https://example-bucket.s3.amazonaws.com/files/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"confidence_score": 0.987654321098765
}
]
},
"error": null
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "processing",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {},
"enable_reordering": false,
"page_count": 10
},
"result": null,
"error": null
}
{
"job_id": "c8a86841-beb1-4d00-ac4f-2f9fb9de9d5a",
"status": "failed",
"progress": "Starting document splitting...",
"file_url": "https://example-bucket.s3.amazonaws.com/user_uploads/...?AWSAccessKeyId=...&Signature=...&Expires=...",
"file_name": "mixed_documents.pdf",
"parameters": {
"classes": ["Invoice", "Receipt", "Contract"],
"category_descriptions": {},
"enable_reordering": false,
"page_count": 10
},
"result": null,
"error": "Failed to process document: Invalid PDF format"
}
Authorizations
Path Parameters
The unique identifier of the splitting job
Response
200 - application/json
Split job status and results retrieved successfully
Unique identifier for the splitting job
Current job status (queued, processing, completed, failed)
Progress message
Presigned download URL for the original uploaded file. Expires roughly an hour after the response is generated; re-issue this request for a fresh URL.
Name of the original file
Job parameters
Show child attributes
Show child attributes
Split results (only present when status is completed)
Show child attributes
Show child attributes
Error message if job failed
⌘I

