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.

NameTypeRequiredDefaultDescription
configurationstring (form)No{}A JSON object.
doc_idstring (form)Yes, or fileA completed document of yours.
filefile (form)Yes, or doc_idA PDF, kept as a document of yours.
collection_idstring (form)NoWith file: the collection the document goes in.
folder_idstring (form)NoWith file: the folder the document goes in.

configuration holds:

NameTypeRequiredDefaultDescription
typesarrayNo[]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.
rulesstringNoHow 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.

StatusWhen
400A file that is not a PDF.
402insufficient_credits: your balance does not cover the job.
403The document is not yours, or a key below WRITE.
404The document, collection or folder does not exist.
409The document's pages are not ready yet. For a file stored already whose document is still processing, detail.doc_id names it.
422Both 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.
503The 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.

NameTypeRequiredDefaultDescription
job_idstring (path)YesThe 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"
}
  • documents covers every page, in page order: each runs from its start_page to its end_page, and the next starts on the page after.
  • type is one of your types' names, or null for a document that is none of them, and for every document when you give no types.
  • identifier, for a type with an identifier_key: what tells this document apart, such as the partner a K-1 is for. It is left out when none is read.
statusWhat it means
pendingWaiting to start.
runningReading the pages and splitting them.
completedDone; the result is in the job.
failedNot done; error_message says why. Not charged.
StatusWhen
404No job of yours has this ID.