Introduction

The ParseGrid API converts unstructured documents — PDFs, scans, screenshots — into structured JSON. All endpoints are JSON over HTTPS and return predictable response shapes.

Base URL
https://api.parsegrid.io/v1

All requests must be made over HTTPS. Calls to plain HTTP are rejected.

Versioning

The API is versioned by URL prefix (/v1). Breaking changes are released under a new prefix; non-breaking additions ship inside the current version with backward compatibility.

Authentication

Authenticate every request with a bearer token. Your API key is issued the moment you purchase a plan — it's emailed to you and available any time in your customer portal. Treat it as a secret.

Header
Authorization: Bearer PG_SK_…

Requests missing or carrying an invalid token return 401 Unauthorized. Rotate tokens regularly; the dashboard supports overlapping active tokens to enable zero-downtime rotation.

Key Scopes
Scope Access Description
extract read/write Submit documents and retrieve results.
admin read/write Manage project settings, models, and usage.
readonly read Retrieve results and metrics; cannot submit jobs.

Errors

ParseGrid uses standard HTTP status codes. Successful requests return 2xx; client mistakes return 4xx; server issues return 5xx. Every error response includes a machine-readable code and a human-readable message.

Common Codes
Status Code Meaning
400 invalid_request The request payload is malformed or missing required fields.
401 unauthorized The Authorization header is absent or the token is invalid.
404 not_found The referenced job, document, or project does not exist.
413 payload_too_large The document exceeds the 25MB upload limit.
429 rate_limited You have exceeded your plan's per-second rate limit.
500 internal_error An unexpected server-side failure. Please retry with backoff.

Parse Document

Submit an unstructured document (PDF, PNG, or JPG) to the extraction engine. ParseGrid will perform layout analysis, OCR, and table reconstruction to return structured JSON data.

Endpoint
POST /v1/parse
Request Parameters
Parameter Type Description
file binary The document file to be parsed. Max size 25MB.
model_id string Optional. Specify a custom-trained model for extraction.
ocr_engine string Choose between standard or high_res.
Capabilities

Our engine supports complex grid detection and nested data hierarchies. By default, the engine attempts to classify the document type and apply relevant schema mapping.

Introduction · Ping Shell
curl https://api.parsegrid.io/v1/ping
Ping Response JSON
{ "status": "ok", "version": "v1" }
Authentication Shell
curl https://api.parsegrid.io/v1/parse \ -H "Authorization: Bearer PG_SK_920..."
Unauthorized Response JSON
{ "error": { "code": "unauthorized", "message": "Missing or invalid token." } }
Error Response Shape JSON
{ "error": { "code": "invalid_request", "message": "Field 'file' is required.", "request_id": "req_2K91xZ" } }
Parse Document · Request (cURL) Shell
curl -X POST https://api.parsegrid.io/v1/parse \ -H "Authorization: Bearer PG_SK_920..." \ -F "file=@invoice_001.pdf" \ -F "ocr_engine=high_res"
Response Example JSON
{ "id": "job_8x2L19", "status": "success", "data": { "document_type": "invoice", "confidence": 0.992, "fields": { "total": 124.50, "vendor": "Stark Ind." }, "tables": [ { "name": "Line Items", "rows": 12 } ] } }