PerfectParser API Reference
Complete REST API reference for PerfectParser. Authenticate with API keys, create parsers, submit documents, retrieve structured JSON results, and configure webhooks.
API Reference
The PerfectParser REST API lets you integrate document extraction into any application or automation pipeline.
All API requests are served at:
Machine-readable spec: openapi.json
API Resources
The API is structured around the following core resources:
- Authentication: Secure request signing using API Keys.
- Account: Verify your key and check credit balance (
GET /v1/me,GET /v1/credits). - API Integration Guide: Connect PerfectParser to scripts and automation tools.
- Automation Integrations: Polling, webhooks, idempotency, and retry patterns for Zapier, Make, n8n, and custom pipelines.
- Parsers: Managing extraction templates, schema designs, and sample files.
- Extractions: Submitting documents, checking status, retrieving results, and exporting — including per-document endpoints nested under each extraction job.
- Webhooks: Configuring outbound event triggers to receive results in real-time.
Documents are not a top-level resource. Each document belongs to an extraction job. Use nested routes like GET /v1/extractions/:extraction_id/documents/:document_id — see Extractions.
Which endpoint do I call?
| Goal | Endpoint |
|---|---|
| Verify API key / account | GET /v1/me |
| Check credit balance | GET /v1/credits |
| Create a parser template | POST /v1/parsers |
| Detect fields from a sample | POST /v1/parsers/:id/detect-fields |
| Submit files for extraction | POST /v1/extractions |
| Is the job done? | GET /v1/extractions/:id |
| All results at once | GET /v1/extractions/:id/results |
| One document (webhook retry, large batch) | GET /v1/extractions/:id/documents/:doc_id |
| Export entire batch | GET /v1/extractions/:id/export |
| Export one file | GET /v1/extractions/:id/documents/:doc_id/export |
| Real-time notifications | Webhooks |
Response Format
Successful responses wrap resources in a named envelope:
Common envelopes: { parser }, { extraction }, { document }, { user }, { credits }, { webhooks }, { webhook }.
List endpoints return { items: [...], next_cursor: "..." } or similar pagination fields.
Errors return a 4xx or 5xx status with a structured payload:
Every response includes rate-limit headers — see Authentication.
Error Codes
PerfectParser returns standard HTTP status codes combined with machine-readable error strings in the response body.
| HTTP Status | Error Code | Description |
|---|---|---|
400 | INVALID_PAYLOAD | Invalid or missing request parameters. |
400 | PARSER_NOT_CONFIGURED | Parser has no schema — configure it first. |
400 | SCHEMA_ALREADY_EXISTS | detect-fields was already run on this parser. |
401 | UNAUTHORIZED | Missing or invalid API key. |
402 | INSUFFICIENT_CREDITS | Account balance too low. |
404 | PARSER_NOT_FOUND | Parser not found or belongs to another account. |
404 | RESOURCE_NOT_FOUND | Extraction or document not found. |
409 | CONFLICT | A parser with this name already exists. |
429 | RATE_LIMITED | Too many requests. Retry with exponential back-off. |
500 | INTERNAL_ERROR | Server error. Contact support if persistent. |
503 | SERVICE_UNAVAILABLE | Database temporarily unavailable. |