Parse Document
Extract → Parse Document
The Parse Document API extracts structured data from a PDF using a template you create in the PDF4me dashboard. You send docContent (optional; if omitted the document is fetched by docName), docName, TemplateId (GUID) or TemplateName, ParseId (GUID), and optionally async. The API returns JSON with parsed data (document type, page count, extracted fields). Use the tester below to try it; more details are in the sections that follow.
Try the Parse Document API
:::note Quick reference
Endpoint: POST /api/v2/ParseDocument · Required: api-key, docName, TemplateId (or TemplateName), ParseId
:::
:::info Try it live Use the form below to send your API key, PDF (Base64 or referenced by docName), template ID or name, and parse ID. The response is JSON with parsed document data. No code required—fill the fields and click Send request. :::
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Parse Document?
This endpoint extracts structured data from a PDF using a parse template you create in the PDF4me dashboard. You provide the PDF (docContent optional—if omitted the document is fetched by docName), docName, TemplateId (GUID) or TemplateName, and ParseId (GUID). The API returns JSON with document type, page count, and extracted fields based on your template’s capture areas and keys.
Key features
- Template-based – Create a template in the dashboard: upload a sample PDF, draw capture areas, configure keys and regex.
- TemplateId or TemplateName – Use the template’s GUID or name from the dashboard.
- ParseId – Unique GUID per parsing operation (generate client-side or use API-provided).
- Structured output – JSON with document type, page count, and extracted structured data.
Getting Template and Parse IDs
- Access PDF4me Dashboard: Go to the parse document page.
- Create a Template: Click "Add" and input a template name, then save.
- Configure Template: Upload a template PDF, draw capture areas, configure keys and regular expressions, test the parse, and save.
- Get Template ID: Copy the unique GUID for your template (or use TemplateName).
- Generate Parse ID: Create a unique GUID for each parsing operation (client-side or via a tool).
:::tip Best for Use when you have recurring document types (invoices, forms) and need structured extraction. Combine with Classify Document to route by type, then parse with the right template. :::
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | No | PDF file content (Base64). If omitted, document is fetched by docName. |
| docName | string | Yes | PDF file name with .pdf extension. |
| TemplateId | string | Yes* | Unique GUID for the parse template (from dashboard). *Use TemplateId or TemplateName. |
| TemplateName | string | No | Template name (alternative to TemplateId). |
| ParseId | string | Yes | Unique GUID for this parsing operation. |
| async | boolean | No | Enable asynchronous processing. |
When to use Parse Document
- Invoices and forms – Extract structured fields (amount, date, vendor) from recurring document types.
- Document automation – Use templates to pull data from similar PDFs into CRM, ERP, or databases.
- Compliance – Extract key fields for retention or audit from standardized documents.
:::info Need the full API? For request/response schemas and code samples, see Parse Document in the PDF4me API docs. :::
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF document in Base64 format or a public URL to a PDF file
- A Parse Template created in your PDF4me dashboard (Create Parse Template)
- You need the Template ID (GUID) or Template Name from your parse template
- A Parse ID (GUID) for the parsing operation
Response Format
The API returns a JSON response with parsed document data including document type, page count, and extracted structured information.