Documents in.
Evidence out.
Documentu turns a PDF into structured fields over plain HTTP. Every field comes back with the page and the box it was read from, every job reports its state step by step, and every delivery to your endpoint is signed. You build the part that decides; Documentu does the reading.
Request API access curl · Python · NodeKeys come with a pilot. No SDK to install.- REST + JSON
- OpenAPI
- X-API-Key
- Idempotency-Key
- HMAC-SHA256 webhooks
- PDF in, JSON out
Evidence API
Like a parser, but every value shows its source.
A parser hands you text. Documentu hands you the fields your schema asks for, each tied to the place it was printed: page, block and box. Show a person the line a number came from, highlight it in your own viewer, or refuse to post a value whose box is somewhere it should not be.
# submit: one file, one project, a key you choose for retries $ curl -X POST "$DOCUMENTU_URL/v1/jobs" -H "X-API-Key: $KEY" \ -H "Idempotency-Key: eg-inv-26-0877" -F "project=customs-clearance" -F "file=@commercial_invoice.pdf" 202 Accepted { "job_id": "<uuid>", "status": "queued" } # follow it $ curl "$DOCUMENTU_URL/v1/jobs/<uuid>" -H "X-API-Key: $KEY" { "status": "running", "progress": { "tasks_done": 2, "tasks_total": 4 } } { "status": "succeeded" } # read the fields, each with its page and box $ curl "$DOCUMENTU_URL/v1/jobs/<uuid>/result" -H "X-API-Key: $KEY" { "job_id": "<uuid>", "verification": "unverified", "fields": [ { "name": "invoice_total", "value": 26520.0, "raw": "26,520.00", "provenance": [ { "page": 0, "bbox": [501, 374, 546, 391] } ] }, … ] }
After reading
Check documents against each other.
When a case is complete, a project can compare its documents: quantities, gross weight within a tolerance, consignee, country of origin, the invoice total against its lines. A disagreement comes back with both values, the case can wait for a person to approve, and the result goes out as an Excel report, an email or a signed webhook. It is an API too: publish a setup, approve or reject a held run, replay a delivery.
Know where every value came from.
commercial_invoice.pdf
job <uuid> · 1 page · 5 fields shown
- invoice_noEG-INV-26-0877page 0 · bbox [50, 113, 128, 131]
- consigneeAl Khaleej Sanitary Ware Trading Co. LLCpage 0 · bbox [308, 157, 512, 174]
- originTurkeypage 0 · bbox [50, 241, 86, 259]
- total_quantity1,400page 0 · bbox [317, 354, 344, 370]
- invoice_total26,520.00page 0 · bbox [501, 374, 546, 391]

Illustrative viewer. Fields from the synthetic invoice; boxes measured from its PDF, in points.
Every field has a source.
The value, the characters as printed, and the page, block and box they were read from. Not a score to trust: a place you can look.
Every job has a trail.
Status and progress by step and task, with attempts and timings. A degraded job tells you a page is missing instead of passing as complete.
Every delivery is signed.
Webhooks carry a timestamped HMAC signature, retry with backoff, and are logged so a delivery can be replayed.
Quickstart
Three calls to a result.
Authenticate with the X-API-Key header. Everything is JSON except the PDF you send.
- 01
Submit a document
One multipart POST with the file and the project it is for. The answer is immediate: 202 and a queued job. Send an Idempotency-Key so a retry can never make a second job.
curl -X POST "$DOCUMENTU_URL/v1/jobs" \ -H "X-API-Key: $DOCUMENTU_API_KEY" \ -H "Idempotency-Key: eg-inv-26-0877" \ -F "project=customs-clearance" \ -F "file=@commercial_invoice.pdf" # 202 Accepted { "job_id": "<uuid>", "status": "queued", "project": "customs-clearance", "setup_revision": 3 } - 02
Follow the job
Poll its status until it is terminal: succeeded, degraded, failed or cancelled. Progress comes by step and task, so you can show more than a spinner.
curl "$DOCUMENTU_URL/v1/jobs/<job_id>" -H "X-API-Key: $DOCUMENTU_API_KEY" { "status": "running", "progress": { "tasks_done": 2, "tasks_total": 4, "steps": [ … ] } } - 03
Read the result
Each field arrives with its value, the characters as printed and its provenance: the page, the block and the box. GET /evidence returns every box for the whole job.
curl "$DOCUMENTU_URL/v1/jobs/<job_id>/result" -H "X-API-Key: $DOCUMENTU_API_KEY" { "verification": "unverified", "fields": [ { "name": "invoice_total", "value": 26520.0, "raw": "26,520.00", "provenance": [ { "page": 0, "block": "<block id>", "bbox": [501, 374, 546, 391] } ] } ] }
Idempotency
Retries without duplicates.
Networks drop requests. Send the same Idempotency-Key with a retried submit and you get back the job the first request created, not a second one. The same bytes under the same configuration already land on the same job; the key makes it explicit, and a key reused for a different document is refused with 409 rather than guessed at.
Everything a job can tell you.
Send the documents a finance or trade team receives. Get back fields, the evidence for each, a state you can act on and deliveries you can verify.
What you send
Invoices PDF
Packing lists PDF
Bills of lading PDF
Certificates of origin PDF
Scans and photos in a PDF
Your own schema fields you ask for
What comes back
Fields JSON
Evidence page · box
Job states 7 states
Signed webhooks HMAC
Excel reports .xlsx
Emails Gmail · SMTP
The surface
Twelve routes, seven states, honest errors.
Routes
| POST | /v1/jobs | Submit a PDF. 202 and a queued job. |
| GET | /v1/jobs/{id} | Status, progress by step, outputs. |
| GET | /v1/jobs/{id}/steps | Every step and task, with attempts and timings. |
| GET | /v1/jobs/{id}/result | The fields, each with its provenance. |
| GET | /v1/jobs/{id}/evidence | Every box and quote a person checks against. |
| GET | /v1/jobs/{id}/document | The source PDF, as it was submitted. |
| POST | /v1/parse | Submit and wait, up to five pages. |
| POST | /v1/projects/{slug}/tests | Run documents against a project's draft. |
| POST | /v1/projects/{slug}/setup/publish | Publish what to read and what follows: compare, report, email, webhook. |
| POST | /v1/automation-runs/{id}/approve | Let a held run go out. |
| POST | /v1/automation-runs/{id}/replay | Send a delivery again, from its log. |
| POST | /v1/keys/{id}/rotate | Rotate a key; revoke it with DELETE. |
Job states
queuedAccepted, waiting for a worker.runningBeing read, classified and extracted.heldWaiting for a person.succeededDone. The result is ready.degradedDone with a page missing.failedStopped. The error says why.cancelledStopped on request.
Errors
401No key, or a key we do not know. One message for every case.403A real key without the scope this route needs.404No such job, or a result that is not ready yet.409An Idempotency-Key already used for a different request.413Bigger than the project's size cap.415Not a PDF, by its own bytes.422An empty file, or a /v1/parse document over five pages.504/v1/parse ran out of time. The job is still running: poll it.
Webhooks signed the way Stripe signs them.
Documentu-Signature: t=<timestamp>,v1=<HMAC-SHA256>. The timestamp is inside the signed message, so a captured request cannot be replayed later than the tolerance you allow. The receiving code is the code you have written before.
import crypto from "node:crypto";
// Documentu-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "${t}.${rawBody}">
export function verify(secret, rawBody, header, toleranceSeconds = 300) {
const parts = Object.fromEntries(
header.split(",").map((part) => part.split("=", 2)),
);
const t = Number(parts.t);
if (!t || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${t}.${rawBody}`)
.digest("hex");
return expected.length === parts.v1.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}Honest about what is built.
We would rather say a thing does not exist than link a page that pretends it does.
A public API reference
It comes with access, from the OpenAPI schema the API serves.
An SDK
The Python package is a placeholder. Any HTTP client is the interface.
Hosted MCP
An MCP server exists for local use. There is no hosted endpoint.
Self-service keys
Keys are issued with a pilot; rotation and revocation are in the API.
Questions developers ask.
- A PDF. The API reads the file's own bytes to check it is one, whatever content type the request declares. Scans and phone photos work when they arrive as a PDF: every page is read by a vision model, so a scan and a born-digital file are read the same way.
Get a key
Start with your documents.
Keys are issued with a pilot. Tell us what you process and where the result has to end up; we reply by email with what we would extract, and a key to try it.