API Documentation

🤖 AI-Powered Form Filling

Our API now uses advanced AI to automatically fill PDF forms. Simply provide context about what should be filled, and our AI will intelligently map your data to the correct form fields. No need to know exact field names!

Authentication

All API requests must be authenticated using a Bearer token. First, obtain an access token using your API key, then include it in subsequent requests.

Authorization: Bearer YOUR_ACCESS_TOKEN

Get Access Token

Exchange your API key for a temporary access token.

POST/v1/auth/token

Parameters

api_key
string
Your API key
Required

Request Example

1
2
3
4
5
curl -X POST https://autofillpdf.com/api/v1/auth/token \ -H "Content-Type: application/json" \ -d '{ "api_key": "YOUR_API_KEY" }'

Response Example

1
2
3
4
5
{ "access_token": "eyJhbGciOiJIUzI1NiIs...", "token_type": "Bearer", "expires_in": 3600 }

Endpoints

Fill PDF with AI

Upload a PDF form and provide context about what should be filled. AI will automatically identify fields and fill them appropriately.

POST/v1/fill-pdf

Parameters

pdf
file
PDF form file to fill
Required
context
string
Natural language description of the information to fill in the form. Be as detailed as possible.
Required

Request Example

1
2
3
4
5
curl -X POST https://autofillpdf.com/api/v1/fill-pdf \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "pdf=@template.pdf" \ -F 'context=My name is John Doe, I live at 123 Main St in New York, NY 10001. My email is john@example.com and my phone is (555) 123-4567.'

Response Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{ "success": true, "file_url": "https://autofillpdf.com/api/files/filled_123.pdf", "expires_in": 3600, "fields_filled": ["name", "email", "address", "phone"], "available_fields": ["name", "email", "address", "phone", "date"], "ai_generated_values": { "name": "John Doe", "email": "john@example.com", "address": "123 Main St", "phone": "(555) 123-4567" }, "pages": 1, "message": "PDF filled successfully with AI" }

Extract Fields

Extract all form fields from a PDF to understand its structure.

POST/v1/extract-fields

Parameters

pdf
file
PDF form file
Required

Request Example

1
2
3
4
curl -X POST https://autofillpdf.com/api/v1/extract-fields \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "pdf=@form.pdf"

Batch Process

Coming Soon

Fill multiple PDF templates in a single request with AI.

POST/v1/batch-fill

AI Context Examples

Good Context Examples

Provide detailed, natural language descriptions. The more specific information you include, the better our AI can map data to the correct form fields.

Personal Information

"My name is John Doe, I live at 123 Main Street in New York, NY 10001. My email is john@example.com and my phone number is (555) 123-4567. I was born on January 15, 1990."

Job Application

"I am applying for a Software Engineer position. I have 5 years of experience in web development. I graduated from MIT with a Computer Science degree in 2018. My salary expectation is $120,000."

Medical Form

"Patient name: Sarah Smith, DOB: 03/22/1985, Insurance: Blue Cross Blue Shield, Policy #: BC123456789, Emergency contact: Mark Smith (spouse) at (555) 987-6543."

Support

Need help with our API? We're here to assist you with integration, troubleshooting, and feature requests.

Get Help

Email Support
support@autofillpdf.com
Live Chat
Available 9AM-5PM EST

Resources

Documentation
Complete API reference
Code Examples
Sample integrations

Quick Start

New to our API? Here's what you need to get started:

  1. Sign up for an account and choose a plan
  2. Generate your API key from the dashboard
  3. Make your first API call to get an access token
  4. Start filling PDFs or extracting fields