PerfectParser Docs

Update a Parser

Endpoint: PATCH /v1/parsers/:id. Reference for updating the configuration or schema of an existing parser.

PATCH /v1/parsers/:id

Updates specific configuration parameters of an existing parser. This is the preferred method for making partial updates.

Path Parameters

ParameterTypeRequiredDescription
idstring✅The unique ID of the parser to update.

Body Parameters

ParameterTypeRequiredDescription
namestring❌Updated name for the parser (max 100 chars).
descriptionstring❌Updated description text.
result_modestring❌one_per_file or one_per_page. Maps to dashboard One document per file / One document per page.
fieldsarray❌Full replacement list of field definitions. Each field: name (required), type (optional: string, number, boolean, date, array, object), description (optional), required (optional boolean). Re-generates underlying parser schema.
document_typestring | null❌Document type slug (e.g. invoices). Pass null to clear. See the Create Parser reference for valid slugs.
curl -X PATCH https://api.perfectparser.com/v1/parsers/prs_999 \
  -H "X-API-Key: pp_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{"description": "Updated description text."}'

Response 200 OK

{
  "parser": {
    "parser_id": "prs_999",
    "name": "Invoice Parser",
    "description": "Updated description text.",
    "result_mode": "one_per_file",
    "document_type": "invoices",
    "schema": {
      "type": "object",
      "properties": {
        "invoice_number": { "type": "string" },
        "total_amount": { "type": "number" }
      }
    },
    "fields": {
      "invoice_number": { "description": "" },
      "total_amount": { "description": "" }
    },
    "has_sample_file": true,
    "sample_file_id": "smp_123",
    "created_at": "2026-06-20T10:00:00.000Z",
    "updated_at": "2026-06-20T10:05:12.000Z"
  }
}

Common Error Responses

HTTP StatusError CodeDescription
400INVALID_PAYLOADRequest body validation failed or malformed JSON.
401UNAUTHORIZEDInvalid or missing API key.
404PARSER_NOT_FOUNDThe requested parser does not exist or belongs to another account.
409CONFLICTA parser with this name already exists.

On this page