PerfectParser Docs

API Reference Overview

Full reference for the PerfectParser REST API — authentication, parsers, extractions, account, and webhooks.

API Reference

The PerfectParser REST API lets you integrate document extraction into any application or automation pipeline.

All API requests are served at:

https://api.perfectparser.com

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?

GoalEndpoint
Verify API key / accountGET /v1/me
Check credit balanceGET /v1/credits
Create a parser templatePOST /v1/parsers
Detect fields from a samplePOST /v1/parsers/:id/detect-fields
Submit files for extractionPOST /v1/extractions
Is the job done?GET /v1/extractions/:id
All results at onceGET /v1/extractions/:id/results
One document (webhook retry, large batch)GET /v1/extractions/:id/documents/:doc_id
Export entire batchGET /v1/extractions/:id/export
Export one fileGET /v1/extractions/:id/documents/:doc_id/export
Real-time notificationsWebhooks

Response Format

Successful responses wrap resources in a named envelope:

{
  "extraction": { "extraction_id": "ext_abc", "status": "processing" }
}

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:

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "A valid API key is required. Pass your key via the X-API-Key header.",
    "status": 401
  }
}

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 StatusError CodeDescription
400INVALID_PAYLOADInvalid or missing request parameters.
400PARSER_NOT_CONFIGUREDParser has no schema — configure it first.
400SCHEMA_ALREADY_EXISTSdetect-fields was already run on this parser.
401UNAUTHORIZEDMissing or invalid API key.
402INSUFFICIENT_CREDITSAccount balance too low.
404PARSER_NOT_FOUNDParser not found or belongs to another account.
404RESOURCE_NOT_FOUNDExtraction or document not found.
409CONFLICTA parser with this name already exists.
429RATE_LIMITEDToo many requests. Retry with exponential back-off.
500INTERNAL_ERRORServer error. Contact support if persistent.
503SERVICE_UNAVAILABLEDatabase temporarily unavailable.

On this page