Split Agent: REST API and MCP
The Split Agent can be started without the app: with a saved agent, or ad hoc with a workflow template. Both routes create the same parts as in the app.
Run a saved Split Agent
POST /latest/documents/split-agent-run
Runs a Split Agent that was set up in the app. The call needs the ID of the agent and exactly one source.
| Parameter | Meaning |
|---|---|
split_agent_id required | ID of the saved Split Agent. |
file | PDF file uploaded with the call. Source, one of three. |
pofid | ID of a document already stored in PaperOffice. Source, one of three. |
file_url | URL from which the PDF is fetched. Source, one of three. |
workspace_id | workspace_name optional | Target workspace for a new upload, given by ID or by name. |
client_wait optional | If set to true, the call waits until the documents have been imported. Default value: false |
wait_timeout_sec optional | Maximum waiting time in seconds, from 10 to 600. If the time runs out, processing continues in the background. Default value: 300 |
Split ad hoc without a saved agent
POST /latest/job/add/workflow
Starts a split as a workflow job. The settings are passed with the call.
| Parameter | Meaning |
|---|---|
template required | Workflow template for the split. Fixed value: pdf_ai_split |
naming_instruction optional | Instruction for building the filenames. |
locale optional | Language and format of the output, for example of the document type names. Set it explicitly for any output language other than the default value. |
document_types optional | List of the document types to recognize. |
date_format optional | Date format in the filenames. |
model optional | Processing level:
|
This route always runs asynchronously. The first response returns a job, not the parts. Query the job with the following route or receive the result by webhook:
GET /latest/job/get/{job_id}
Audit trail for Ultra runs
GET /latest/documents/split-audit-trail
Returns every page with its role, every boundary with confidence and reasons, the corrections made and the resulting parts.
| Parameter | Meaning |
|---|---|
job_id optional | ID of the job. |
pofid optional | ID of a document created by the split. |
MCP
The MCP server provides the agent run as a tool:
po_documents_split_agent_run
How to split a scanned PDF stack into separate documentsBack to the Split Agent