Split API
Divide multi-page documents into typed subdocuments, then route each section into the right extraction, review, or automation path.

Upload a packet
Send a mixed PDF that contains invoices, receipts, contracts, or custom section types.
Define subdocuments
Describe the page types you want the API to identify and separate.
Route every section
Use returned page groups to run extraction, review, or downstream workflow branches.
Send the document and describe the sections you expect.
`POST /v1/splits` returns page assignments for each subdocument. Add consensus when the split controls a production workflow.
documentRequired file or URLThe multi-page PDF or image document to split.
subdocumentsRequired arrayTyped sections to identify, each with a name and description.
modelOptional stringUse retab-micro, retab-small, or retab-large.
contextOptional stringBusiness context that helps classify ambiguous pages.
n_consensusOptional integerRun multiple voters and return confidence data.
Starter call
from retab import Retab
client = Retab()
result = client.splits.create(
document="batch.pdf",
model="retab-small",
subdocuments=[
{
"name": "invoice",
"description": "Invoice pages with billing details and line items",
},
{
"name": "receipt",
"description": "Receipt or proof-of-payment pages",
},
{
"name": "contract",
"description": "Agreement pages with legal terms",
},
],
context="Q4 vendor packet",
)
for split in result.output:
print(split.name, split.pages)Page groups
{
"output": [
{ "name": "invoice", "pages": [1, 2, 5, 6] },
{ "name": "receipt", "pages": [3, 4] }
],
"consensus": {
"likelihoods": [
{ "name": 0.95, "pages": [0.95, 0.95, 0.94, 0.94] },
{ "name": 1.0, "pages": [1.0, 1.0] }
]
}
}