REST API + MCP
PDF form filling
for AI agents.
Pagewrite maps form fields, writes answers into the PDF, and returns field errors your agent can fix.
Sign in with Google. Pay with usage credits.
IRS Form 1040Filled sample
Why use it with an LLM?
-
Reuse the mapping
Recognized forms skip repeat OCR and field analysis, saving processing time and model spend.
New formMap fields Recognized formReuse mapping -
Fill the original PDF
Write answers into form fields, including forms that start as flat files or scans.
NameMaria L. Santos Single -
Fix specific fields
Get field errors your agent can use to correct rejected values and retry.
1234566 characters. Only 5 boxes.
Connect your agent.
Upload → inspect fields → fill → download
# Shell + jq · replace the key and PDF path API=https://pagewrite.dev/api/forms KEY=cnk_… form_id=$(curl -fsS "$API" -H "X-API-Key: $KEY" \ -F "pdf=@housing_form.pdf" | jq -er '.form_id') # Inspect the actual field IDs, labels and constraints curl -fsS "$API/$form_id/fields" -H "X-API-Key: $KEY" # Create values.json: {"values":{"FIELD_ID_FROM_SCHEMA":"VALUE"}} curl -fsS "$API/$form_id/fill" -H "X-API-Key: $KEY" \ -H "Content-Type: application/json" --data-binary @values.json # Check the returned errors and validation before downloading curl -fsS "$API/$form_id/download" -H "X-API-Key: $KEY" -o filled.pdf
# Illustrative tool calls for your MCP agent form = analyze_form(pdf_path="/absolute/path/housing_form.pdf") form_id = form["form_id"] schema = list_fields(form_id=form_id) # Choose field_id and value from the schema and user input result = fill_fields(form_id=form_id, values={field_id: value}) # Inspect result.errors, warnings and validation; fix any rejects download_filled_pdf( form_id=form_id, save_to="/absolute/path/filled.pdf" )
// Example 200 response excerpt: one value rejected { "filled_count": 0, "errors": [{ "field_name": "field_015", "code": "value_too_long", "message": "Value has 6 characters but the field has only 5 character cells — shorten the value and re-send this field.", "expected_cells": 5, "provided_length": 6 }], "warnings": [], "pdf_updated": false } // Valid values can succeed in the same request; check every error
New features and supported forms.