Splitter
Upload a single PDF containing multiple documents and get back one fully-extracted document per logical document detected.
Step 1 — Upload with the Splitter
Add "useSplitter": true to the info field. Keep sending type as usual (unless you’re also using the Classifier).
The upload response does not include documentIds — Invofox doesn’t know how many documents the file contains until it finishes processing. Save the importId instead:
Any clientData you include in the info field is propagated to every document produced by the split — all sub-documents share the exact same clientData.
Step 2 — Get the results
Retrieve the documentIds once processing is done. Webhooks are the recommended approach; you can also poll the import.
Receive a document.processed event for each split document as it finishes. No polling, no infrastructure overhead.
Check the import status until processed, then read the list of documentIds and fetch each one.
Option A · Webhooks (recommended for production)
A document.processed event fires for each document as it finishes. Each event carries the full extracted document in its data field — same payload format as described in Step 3 of Integrating Invofox, including the import.info.splitter block.
Because you don’t know upfront how many documents a file will split into, you can’t rely on counting document.processed events to know when the split is complete. Instead, listen for import.processed — this event fires once, after all documents from the split have been fully processed. When it arrives, you’re done.
Option B · Poll the import
Poll GET /v1/ingest/imports/{importId} until status is "processed". While processing, status is "processing" and the documents counter increases as each document is extracted — don’t rely on it until status is "processed".
files[] has one entry per uploaded file, each carrying its original filename and the list of documentIds produced from it. Collect every documentId across all files[].
Fetch each document
For each documentId, call GET /documents/{documentId} — same endpoint and response format as the standard flow, with an additional splitter block under import.info:
Each split is renamed split_n.pdf — a 1-based index in page order. The original filename is not present on the split document itself; you can find it in the import response (files[].filename) from the polling step above.
Combining with the Classifier
If the batch PDF contains mixed document types, add "useClassifier": true and omit type — Invofox will detect the type of each split document automatically.
Everything else works the same as described in Step 2 — polling and webhooks behave identically. The only difference is that each document in the results will have its type field already populated with the detected document type, so you don’t need to pass it at upload time.