PerfectParser Docs

Create a Parser

Endpoint: POST /v1/parsers. Reference for creating a new parser template programmatically.

POST /v1/parsers

Creates a new parser template. If fields is omitted or empty, a blank parser container is created.

Body Parameters

ParameterTypeRequiredDescription
namestringUnique name for the parser (max 100 chars).
descriptionstringHuman-readable description.
result_modestringone_per_file (default) or one_per_page. Maps to dashboard One document per file / One document per page under How are your files organized?.
fieldsarrayList of field definitions containing name (required), type (optional), and description (optional). If omitted with a document_type, the preconfigured fields for that type are used.
document_typestringDocument type slug (e.g. invoices, receipts, purchase-orders). When provided without explicit fields, seeds the parser with a standard field configuration for that type. See the document types reference for valid values.
curl -X POST https://api.perfectparser.com/v1/parsers \
  -H "X-API-Key: pp_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Invoice Parser", "result_mode": "one_per_file"}'

Response 201 Created

{
  "parser": {
    "parser_id": "prs_999",
    "name": "Invoice Parser",
    "description": null,
    "result_mode": "one_per_file",
    "document_type": null,
    "schema": {},
    "fields": {},
    "has_sample_file": false,
    "created_at": "2026-06-20T10:00:00.000Z",
    "updated_at": "2026-06-20T10:00:00.000Z"
  }
}

Document Types

The following slugs are valid values for document_type:

SlugLabel
invoicesInvoice
receiptsReceipt
purchase-ordersPurchase Order
bank-statementsBank Statement
contractsContract
bills-of-ladingBill of Lading
delivery-notesDelivery Note
payslipsPayslip
insurance-policiesInsurance Policy
tax-formsTax Form
medical-recordsMedical Record
utility-billsUtility Bill

Common Error Responses

HTTP StatusError CodeDescription
400INVALID_PAYLOADRequest body validation failed or malformed JSON.
401UNAUTHORIZEDInvalid or missing API key.
409CONFLICTA parser with this name already exists.

On this page