Page Split API
Cut a PDF that bundles several documents into those documents, each with its first and last page and its type, among the types you give. Each split runs in the background as a job: start it, then read it until it is done. It takes longer the more pages it reads: a few minutes for a few hundred pages, about ten minutes for 1,000.
For a walkthrough, see the Page Split quick start.
Start a split
POST /split · WRITE key
Starts a job and returns 202 right away. Send one of your documents by its ID, or a PDF: the PDF is stored as a document of yours, as an upload with algorithm=none is, and only the split is charged.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
configuration | string (form) | No | {} | A JSON object. |
doc_id | string (form) | Yes, or file | A completed document of yours. | |
file | file (form) | Yes, or doc_id | A PDF, kept as a document of yours. | |
collection_id | string (form) | No | With file: the collection the document goes in. | |
folder_id | string (form) | No | With file: the folder the document goes in. |
configuration holds:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
types | array | No | [] | Up to 100 types, each {"name": ..., "description": ..., "identifier_key": ...}. Names are unique, 1 to 100 characters; a description and an identifier key are optional. Without types, the PDF is still split. |
rules | string | No | How you want the PDF split, in your words. |
A type's identifier_key says what tells two documents of that type apart, such as "the partner the K-1 is for": two with different identifiers are split, and each carries its identifier. The types and the rules hold at most 50,000 characters, all told.
curl https://api.pageindex.ai/split \
-H "Authorization: Bearer $PAGEINDEX_API_KEY" \
-F "file=@returns.pdf" \
-F 'configuration={"types": [{"name": "Form 1040", "description": "An individual income tax return"}, {"name": "Schedule K-1", "identifier_key": "the partner the K-1 is for"}], "rules": "Keep each state return with its schedules."}'
{
"id": "spl_4b8e1d0a6c2f9e3b7a5d1c8e",
"status": "pending",
"doc_id": "pi-cm3k9x2qv0001l50856dh4a2f",
"configuration": {
"types": [
{ "name": "Form 1040", "description": "An individual income tax return" },
{ "name": "Schedule K-1", "identifier_key": "the partner the K-1 is for" }
],
"rules": "Keep each state return with its schedules."
},
"created_at": "2026-11-30T09:40:05",
"updated_at": "2026-11-30T09:40:05"
}
The price is $0.005 a page ($5 per 1,000 pages), for every page of the document. The amount is held when the job starts and charged when it completes. A job that fails isn't charged; a PDF sent with it is then left as a failed document.
| Status | When |
|---|---|
| 400 | A file that is not a PDF. |
| 402 | insufficient_credits: your balance does not cover the job. |
| 403 | The document is not yours, or a key below WRITE. |
| 404 | The document, collection or folder does not exist. |
| 409 | The document's pages are not ready yet. For a file stored already whose document is still processing, detail.doc_id names it. |
| 422 | Both doc_id and file, or neither. collection_id or folder_id with a doc_id. A configuration that is not valid: more than 100 types, two of one name, more than 50,000 characters, or a field it does not take, such as identifier for identifier_key. |
| 503 | The job could not be queued. Try again. |
SDK: PageSplitClient.split(), in Python.
Get a split
GET /split/{job_id} · READ key
Returns a job, with its result once it is completed.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
job_id | string (path) | Yes | The job's ID. |
curl https://api.pageindex.ai/split/spl_4b8e1d0a6c2f9e3b7a5d1c8e \
-H "Authorization: Bearer $PAGEINDEX_API_KEY"
{
"id": "spl_4b8e1d0a6c2f9e3b7a5d1c8e",
"status": "completed",
"doc_id": "pi-cm3k9x2qv0001l50856dh4a2f",
"configuration": {
"types": [
{ "name": "Form 1040", "description": "An individual income tax return" },
{ "name": "Schedule K-1", "identifier_key": "the partner the K-1 is for" }
],
"rules": "Keep each state return with its schedules."
},
"created_at": "2026-11-30T09:40:05",
"updated_at": "2026-11-30T09:40:21",
"documents": [
{ "start_page": 1, "end_page": 3, "type": "Form 1040" },
{ "start_page": 4, "end_page": 5, "type": "Schedule K-1", "identifier": "ABC Partners LP" },
{ "start_page": 6, "end_page": 7, "type": "Schedule K-1", "identifier": "Main Street Fund" },
{ "start_page": 8, "end_page": 8, "type": null }
],
"usage": { "pages": 8, "credits": 4 },
"finished_at": "2026-11-30T09:40:21"
}
documentscovers every page, in page order: each runs from itsstart_pageto itsend_page, and the next starts on the page after.typeis one of your types' names, ornullfor a document that is none of them, and for every document when you give no types.identifier, for a type with anidentifier_key: what tells this document apart, such as the partner a K-1 is for. It is left out when none is read.
status | What it means |
|---|---|
pending | Waiting to start. |
running | Reading the pages and splitting them. |
completed | Done; the result is in the job. |
failed | Not done; error_message says why. Not charged. |
| Status | When |
|---|---|
| 404 | No job of yours has this ID. |