curl --request POST \
--url https://platformbackend.unsiloed.ai/api/v1/pdf-editor/edit/reparse \
--header 'Content-Type: multipart/form-data' \
--header 'api-key: <api-key>' \
--form file='@example-file' \
--form 'edit_request=<string>' \
--form 'image_files=<string>' \
--form image_files.items='@example-file'{
"success": true,
"message": "<string>",
"pdf_url": "<string>",
"original_size": 123,
"edited_size": 123,
"items_processed": 123,
"reparsed": true,
"new_job_id": "<string>"
}Edit PDF documents by replacing text and images at specific bounding boxes with automatic re-parsing
curl --request POST \
--url https://platformbackend.unsiloed.ai/api/v1/pdf-editor/edit/reparse \
--header 'Content-Type: multipart/form-data' \
--header 'api-key: <api-key>' \
--form file='@example-file' \
--form 'edit_request=<string>' \
--form 'image_files=<string>' \
--form image_files.items='@example-file'{
"success": true,
"message": "<string>",
"pdf_url": "<string>",
"original_size": 123,
"edited_size": 123,
"items_processed": 123,
"reparsed": true,
"new_job_id": "<string>"
}curl -X POST "https://platformbackend.unsiloed.ai/api/v1/pdf-editor/edit/reparse" \
-H "api-key: your-api-key" \
-F "file=@test.pdf" \
-F 'edit_request={
"items": [
{
"type": "text",
"page_number": 1,
"bbox": {"left": 100, "top": 150, "width": 200, "height": 30},
"replacement_text": "Updated Text"
}
]
}'
import requests
import json
url = "https://platformbackend.unsiloed.ai/api/v1/pdf-editor/edit/reparse"
headers = {"api-key": "your-api-key"}
# Prepare edit request with image file reference
edit_request = {
"items": [
{
"type": "image",
"page_number": 1,
"bbox": {
"left": 200,
"top": 300,
"width": 150,
"height": 100
},
"image_file": "logo.png" # Reference to uploaded file
}
]
}
# Prepare files
files = {
"file": ("document.pdf", open("document.pdf", "rb"), "application/pdf"),
"image_files": ("logo.png", open("logo.png", "rb"), "image/png")
}
data = {
"edit_request": json.dumps(edit_request),
"upload_to_storage": "true"
}
response = requests.post(url, headers=headers, files=files, data=data)
GET https://prod.visionapi.unsiloed.ai/parse/{task_id}
import requests
import time
def check_task_status(task_id, api_key):
"""Check the status of a parsing task"""
url = f"https://prod.visionapi.unsiloed.ai/parse/{task_id}"
headers = {"api-key": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 200:
return response.json()
else:
raise Exception(f"Error checking status: {response.status_code}")
# Example usage
api_key = "your-api-key"
task_id = "e77a5c42-4dc1-44d0-a30e-ed191e8a8908" # From edit response
status_data = check_task_status(task_id, api_key)
print(f"Status: {status_data['status']}")
async function checkTaskStatus(taskId, apiKey) {
const url = `https://prod.visionapi.unsiloed.ai/parse/${taskId}`;
const response = await fetch(url, {
method: 'GET',
headers: {
'api-key': apiKey
}
});
if (response.ok) {
return await response.json();
} else {
throw new Error(`Error checking status: ${response.status}`);
}
}
// Example usage
const apiKey = 'your-api-key';
const taskId = 'e77a5c42-4dc1-44d0-a30e-ed191e8a8908'; // From edit response
const statusData = await checkTaskStatus(taskId, apiKey);
console.log(`Status: ${statusData.status}`);
curl -X 'GET' \
'https://prod.visionapi.unsiloed.ai/parse/e77a5c42-4dc1-44d0-a30e-ed191e8a8908' \
-H 'accept: application/json' \
-H 'api-key: your-api-key'
Pending: Task is queued and waiting to be processedProcessing: Task is currently being parsedSucceeded: Parsing completed successfully, results are availableFailed: Parsing failed, check error message in responsePDF edited successfully
Whether the PDF edit operation was successful
Status message about the edit operation
URL of the edited PDF file (if upload_to_storage is true)
Size of the original PDF file in bytes
Size of the edited PDF file in bytes
Number of edit items that were processed
Whether the edited PDF was submitted for re-parsing
New job ID for monitoring the re-parsing progress (if job_id was provided)