PDF Form Filling API — Fill PDF Forms Programmatically with Python & REST

Upload a fillable PDF, auto-detect all fields, submit values as JSON, and download the completed form. Works with Python, JavaScript, cURL, Go, Ruby, and any language that speaks HTTP.

W-4 Form W-9 Form I-9 Form
LIVE DEMO
Saved over 80 hours a year
"I was never sure if my IRS forms like W-9 were filled correctly. Now, I can complete the forms accurately without any external help."
Sarah Mitchell, Operations Manager
Templates

Ready-to-use templates

Pre-configured fillable PDF templates for the most common forms. Upload your own or use one of ours.

How It Works

How to Fill a PDF Form Programmatically?

Three API calls. Upload your template, detect fields, submit values as JSON, and download the filled PDF.

STEP 01

Upload your PDF template

POST your fillable PDF to the API. Any AcroForm or XFA-based PDF works. The endpoint returns a template ID.

STEP 02

Detect form fields

Call the detect endpoint to auto-discover all field names, types, and positions. No manual mapping needed.

STEP 03

Fill fields with JSON

Submit a JSON payload mapping field names to values. The API validates and fills every field in one request.

STEP 04

Download the filled PDF

Get the completed PDF from the API response or receive it via webhook callback. Ready to email, sign, or store.

Code Examples

Fill a PDF in three lines of code

Copy any example below and run it. Replace the API key with your own from the dashboard.

# Upload template and fill fields in one request
curl -X POST https://api.docuqueue.com/api/v1/fill \
  -H "api-key: wp2_your_key" \
  -F "template=@w9-form.pdf" \
  -F 'fields={"name": "Jane Smith", "tax_id": "123-45-6789", "signature_date": "2026-08-14"}' \
  -o filled-w9.pdf
import requests

# Upload template and fill fields
response = requests.post(
    "https://api.docuqueue.com/api/v1/fill",
    headers={"api-key": "wp2_your_key"},
    files={"template": open("w9-form.pdf", "rb")},
    data={"fields": '{"name": "Jane Smith", "tax_id": "123-45-6789"}'}
)

# Save filled PDF
with open("filled-w9.pdf", "wb") as f:
    f.write(response.content)
{
  "status": "completed",
  "fields_filled": 3,
  "fields_detected": 12,
  "download_url": "https://api.docuqueue.com/storage/filled/w9-abc123.pdf",
  "expires_at": "2026-08-15T12:00:00Z",
  "validation": {
    "passed": 3,
    "warnings": 0
  }
}

Full API reference at /api-docs. Batch fill up to 50 forms per request with a CSV upload.

Field Detection

AI scans your PDF and finds every field

Upload any fillable PDF. The API detects field names, types, positions, and confidence scores. No manual mapping needed.

Upload PDF
POST your template
AI Scans
Detects all fields
Fields Found
Names, types, positions
Fill with JSON
Map values to fields
Text Field

Employee Name

Accepts alphanumeric input. Auto-validates format.

98%
Secure Text

Social Security Number

Masked input with format validation (XXX-XX-XXXX).

95%
Signature

Authorized Signature

Signature field with timestamp and audit trail.

92%
Checkbox

Filing Status

Boolean toggle. Supports single and group selections.

99%
Dropdown

State

Predefined options. Validates against allowed values.

97%
Date

Date of Birth

Date picker with format validation (MM/DD/YYYY).

96%
Form Types

What works and what does not

The API handles most fillable PDFs out of the box. Here is what to expect with different form types.

Fully Supported

  • AcroForm fields (text, checkbox, radio, dropdown)
  • Flat PDFs with embedded text fields
  • Government forms (W-9, W-4, I-9, 1099)
  • Contracts, leases, and insurance forms
  • XFA-based forms (legacy enterprise systems)

Limitations

  • Handwritten forms (no OCR for handwriting)
  • Low-quality scans (below 150 DPI)
  • Image-only PDFs without form fields
  • Password-protected PDFs (remove protection first)

Field Type Checking

Validates that text fields receive text, dates receive dates, and numbers receive numbers. Rejects mismatched types before filling.

Required Field Validation

Identifies required fields in the PDF and returns errors if any are missing from your JSON payload. Prevents incomplete submissions.

Format Validation

Enforces format rules: SSN (XXX-XX-XXXX), phone ((XXX) XXX-XXXX), dates (MM/DD/YYYY). Catches errors before the PDF is generated.

Webhooks

Async processing with webhook callbacks

Submit a job and get notified when it completes. Ideal for high-volume workflows and CI/CD pipelines.

Submit Job
POST /api/v1/fill
Processing
Fields detected and filled
Webhook Fires
POST to your URL
Download
Filled PDF ready
// Webhook payload delivered to your endpoint
{
  "event": "fill.completed",
  "job_id": "job_abc123",
  "status": "completed",
  "fields_filled": 3,
  "download_url": "https://api.docuqueue.com/storage/filled/w9-abc123.pdf",
  "expires_at": "2026-08-15T12:00:00Z",
  "processing_time_ms": 847
}

Synchronous

Response includes the filled PDF directly. Best for single forms and real-time workflows. Timeout at 30 seconds.

Asynchronous

Returns a job ID immediately. Webhook fires when complete. Best for batch processing and background workflows.

MCP Integration

Connect AI Agents

DocuQueue integrates with Claude, Cursor, ChatGPT, and other AI agents via MCP (Model Context Protocol). Let your AI detect fields, fill forms, and route documents through natural language.

Your agent can upload a PDF template, detect all fields, fill them with data from your systems, and download the completed form. No code required, just conversation.

Claude
Cursor
ChatGPT
LangChain
// MCP config for Claude Desktop
{
  "mcpServers": {
    "docuqueue": {
      "command": "npx",
      "args": [
        "-y",
        "@docuqueue/mcp-server"
      ],
      "env": {
        "DOCUQUEUE_API_KEY": "wp2_your_key"
      }
    }
  }
}
// Then talk to your agent:
"Fill the W-9 form for Jane Smith,
 SSN 123-45-6789, and download it"

// The agent will:
// 1. Upload your W-9 template
// 2. Detect all 12 fields
// 3. Fill name, SSN, date
// 4. Return the completed PDF
Features

Why Use DocuQueue for PDF Form Filling?

No software to install. No complex setup. Just upload, fill, and download.

Auto-detect fields

Upload any PDF and the API detects every fillable field automatically. Text fields, checkboxes, radio buttons, dropdowns, and signatures. Zero manual mapping.

Any form type

AcroForm, XFA, government forms, contracts, insurance applications. Over 48 field types supported. If it is a fillable PDF, the API handles it.

Batch processing

Fill up to 50 forms per request. Upload a CSV with 500 contractor records and generate every W-9 in minutes. Scales to 10,000 PDFs per hour.

Works everywhere

REST API works with Python, JavaScript, Go, Ruby, PHP, cURL, and any HTTP client. No SDK required. Just POST JSON.

Webhook callbacks

Get notified when documents are processed. Connect to CI/CD pipelines, automation workflows, and backend systems for async PDF generation.

Secure by default

All data encrypted at rest and in transit. Filled PDFs deleted immediately after processing. GDPR compliant. Bank-level encryption. API keys for every request.

Use Cases

Who Uses PDF Form Filling APIs?

Teams across every industry use DocuQueue to automate document workflows at scale.

Pricing

How Much Does the PDF Filling API Cost?

Start free. Pay only when you need more volume.

Free Tier

25 free credits. Fill up to 50 forms. No credit card required. Perfect for testing the API and small projects.

Starter

$9/month for 250 credits. Batch processing, template fill, form filling. Ideal for growing teams.

Enterprise

Custom volume. Dedicated infrastructure. SLA guarantees. Contact sales for high-throughput document automation.

View full pricing →

FAQ

Frequently Asked Questions

What is a PDF form filling API?
A PDF form filling API is a REST endpoint that programmatically fills fillable PDF forms. You upload a PDF template, send field values as JSON, and receive a completed PDF. DocuQueue's API auto-detects all AcroForm fields and supports batch processing.
How to fill a PDF form with Python?
Use the requests library to call DocuQueue's REST API. Upload your PDF template, then POST a JSON payload mapping field names to values. The API returns a filled PDF. No Python PDF libraries needed.
How to auto-fill PDF forms programmatically?
DocuQueue auto-detects all fillable fields in your PDF. Upload the template, call the detect endpoint to discover field names and types, then submit a JSON payload with the field values. The API handles text fields, checkboxes, radio buttons, dropdowns, and signature fields.
What makes DocuQueue different from other PDF fillers?
Most PDF fillers require manual field mapping or complex desktop software. DocuQueue auto-detects fields, works via REST API from any language, and supports batch processing. No installation, no field mapping, no learning curve. View the source code and examples on GitHub.
What if my PDF is not a fillable form?
DocuQueue works with any fillable PDF (AcroForm). If your PDF is a flat scan or image, you will need to convert it to a fillable format first. Most government forms, tax documents, and business templates are supported out of the box.
Is my data secure?
Yes. All data is encrypted at rest and in transit. We never store your filled documents after processing. Your PDFs are deleted immediately after download. We are GDPR compliant and use bank-level encryption.
Can I fill the same PDF template multiple times?
Yes. Upload the same PDF template and fill it with different data each time. This is ideal for generating multiple contracts, invoices, or certificates from a single template.
Can I batch fill multiple forms?
Yes. Upload a CSV with multiple records and generate hundreds of filled PDFs in one batch. Up to 50 forms per request, scaling to 10,000 PDFs per hour.
How much does the PDF filling API cost?
DocuQueue offers a free tier with 25 credits (enough for 25 form fills). No credit card required. Paid plans start at $9/month for 250 credits. Enterprise pricing with dedicated infrastructure is available for high-volume needs.
What types of forms can I fill?
Any fillable PDF: W-9, W-4, I-9, 1099, contracts, lease agreements, insurance forms, and government documents. The API supports AcroForm and XFA formats with over 48 field types.
Does the API support webhook callbacks?
Yes. Configure a webhook URL to receive notifications when documents are processed. This integrates with automation workflows, CI/CD pipelines, and backend systems that need async PDF generation.
Do I need to install anything?
No. DocuQueue is a hosted REST API. No software to install, no plugins required. Just make HTTP requests from any language or tool.
Can I use this API to build AI agents for document automation?
Yes. DocuQueue's API is designed for AI agent integration. Use the REST API, webhooks, or MCP to build AI agents that automatically detect fields, fill forms, and route documents. Works with LangChain, AutoGPT, and custom AI workflows.
How do I automate PDF form filling for my enterprise?
DocuQueue offers multiple integration options: REST API for custom apps, webhooks for event-driven workflows, Zapier/n8n for no-code automation, and MCP for AI-powered processing. Process thousands of forms per hour with enterprise-grade reliability.

Written by Arun, Founder of DocuQueue

Ready to fill your first form?

Get your API key, upload a PDF, and start filling forms programmatically in minutes.

Get Started Free