API reference
Base URL https://api.extract.pageindex.ai/v1. Send your API key as a bearer token: Authorization: Bearer $PAGEINDEX_EXTRACT_API_KEY.
| Endpoint | What it does |
|---|---|
POST /extract | Start an extraction. |
GET /extract/{id} | A job, with its result once completed. |
GET /extract | Your jobs, newest first. |
POST /extract/{id}/cancel | Stop a job. |
DELETE /extract/{id} | Delete a job and its result. |
A document is extracted from by its id. Upload PDFs with POST https://api.search.pageindex.ai/v1/documents (up to 100 MB; the same key), as in the quick start; the Python SDK uploads for you, to your Page Extract collection (pass collection to choose another).
Start an extraction
POST /extract starts a job and answers it at once, PENDING.
curl https://api.extract.pageindex.ai/v1/extract \
-H "Authorization: Bearer $PAGEINDEX_EXTRACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document": "doc_60a07bcef3094b68806070f2",
"configuration": {"data_schema": {...}, "tier": "standard", "cite_sources": true}}'| Field | What it is |
|---|---|
document | Required. The id of one of your documents, ready to read. |
configuration.data_schema | Required. The JSON Schema of the result, an object at the top, up to 1 MB. See Writing a schema. |
configuration.tier | standard ($0.03 a page, the default) or pro ($0.05 a page). |
configuration.target_pages | Only these pages, such as 5 or 3-12; only they are charged. The full range must be within the document. All pages when left out. |
configuration.cite_sources | true to also give the page each list item is on, in extract_metadata. Default false. |
configuration.system_prompt | Instructions about the whole document, such as "Amounts are in thousands". Up to 4,000 characters. |
Starting a job needs credit for its pages at its tier; it is charged only when the job completes.
Get a job
GET /extract/{id} answers the job; once it is COMPLETED, with its result.
{
"id": "ext_7b56d419dd0a4d7eafa68e4c",
"status": "COMPLETED",
"document": "doc_60a07bcef3094b68806070f2",
"configuration": {"data_schema": {…}, "tier": "standard", "cite_sources": true},
"extract_result": {"company": "…", "segments": [{"name": "…", "revenue_usd_millions": …}, …]},
"extract_metadata": {"field_metadata": {"/segments/0": {"page": 34}, "/segments/1": {"page": 34}, …}},
"usage": {"pages": 93, "credits": 2.79},
"created_at": "2026-11-08T12:07:53Z",
"updated_at": "2026-11-08T12:08:12Z"
}| Field | What it is |
|---|---|
id | The job's id, ext_…. |
status | PENDING, RUNNING, COMPLETED, FAILED or CANCELLED. See Jobs. |
document | The document's id. |
configuration | The configuration it was started with. |
extract_result | Once completed: the data, fitting the schema. A value the document does not give is null. |
extract_metadata.field_metadata | With cite_sources: the page of each list item, by its path in the result (a JSON Pointer). |
usage | Once completed: the pages charged and their cost, in dollars of credit. |
error_message | Why a job failed. |
created_at, updated_at | When it was started, and last changed. |
List jobs
GET /extract lists your jobs, newest first, without their results. limit is 1 to 100 (default 20); pass the answer's next as after for the jobs after them.
{"jobs": [{"id": "ext_…", "status": "COMPLETED", …}, …], "next": "ext_…"}Cancel a job
POST /extract/{id}/cancel stops a job that is PENDING or RUNNING and answers it, CANCELLED. Nothing is charged.
Delete a job
DELETE /extract/{id} deletes a job and its result, stopping it first if it is running. Answers {"id": "ext_…", "deleted": true}.
Errors
An error answers its status and a code:
{"error": {"code": "insufficient_credit", "message": "Extracting 93 pages at the standard tier takes $2.79 of credit; add credit in the console."}}| Status | Code | When |
|---|---|---|
| 400 | invalid_schema | The schema is not valid JSON Schema, or its top is not an object. |
| 400 | schema_too_large | The schema is larger than 1 MB. |
| 400 | invalid_target_pages | The pages are not within the document. |
| 401 | unauthorized | No API key, or one that is not valid. |
| 402 | insufficient_credit | Not enough credit for the job's pages; add some in the console. |
| 404 | document_not_found, job_not_found | No such document or job of yours. |
| 409 | document_not_ready | The document is still being processed; try again once it is ready. |
| 409 | job_finished | The job is already done, so it cannot be cancelled. |
| 422 | invalid_request | A required field is missing, invalid, or too long. |