PDF Filling API

Fill out PDF forms with JSON data. Upload your PDF, map fields with our drag-and-drop template editor, then fill it programmatically. DocSpring has a REST API and official SDKs in 9 languages.

Start Free Trial

Fill out a PDF with a few lines of code

Send a POST request with your data and get back a download URL for the filled-out PDF. Test mode is free and unlimited.

# frozen_string_literal: true

require 'docspring'

client = DocSpring::Client.new
response = client.generate_pdf(
  template_id: 'YOUR_TEMPLATE_ID',
  test: true,
  data: { first_name: 'John', last_name: 'Smith' },
  metadata: { user_id: 123 }
)
puts "Download your PDF at: #{response.submission.download_url}"

Read the API documentation

How PDF Filling Works

Upload PDF Template

Upload your PDF

We automatically import fields from fillable PDFs. Flat PDF? Drag and drop fields anywhere on the page.

Set up your fields

Map your fields once

Name your fields and set data types in the visual template editor. Each template gets a JSON schema.

Send an API request

Fill it via API

POST your JSON data and download the filled-out PDF: one at a time, in batches, or synchronously.

Everything an engineering team needs to fill PDFs

SDKs & REST API

Official client libraries in 9 languages: Ruby, Python, JavaScript, TypeScript, PHP, C#, Java, Go, and Elixir. Plus an OpenAPI specification for everything else. Clear error messages and documentation that developers actually like.

Fillable & flat PDFs

Fillable form fields are imported automatically. For flat PDFs, place fields visually with the drag-and-drop template editor. No coordinates or PDF internals required.

Data validation

Every template has a JSON schema. Bad data returns a clear validation error instead of a silently wrong document. This is critical for insurance, lending, and healthcare paperwork.

Batch & synchronous APIs

Generate one PDF synchronously in a single request, process batches of up to 50 PDFs, or use the asynchronous API with webhooks for high-volume workloads.

E-signatures with Data Requests

Need someone else to fill in the blanks and sign? Data Requests are embeddable forms that collect data and legally binding e-signatures with an audit trail, then fill out the PDF.

Embed the template editor

White-label the drag-and-drop template editor inside your own application, so your customers can manage their own PDF templates without leaving your product.

Built for regulated documents

SOC 2 Type II Certified

SOC 2 Type II

GDPR Compliant

GDPR Compliant

SOC 2 Type 2 certified, GDPR compliant, with US, EU & AU data residency and BAAs available. Self-hosted enterprise licenses if your documents can never leave your infrastructure.

Learn More

PDF Filling API FAQ

What is a PDF filling API?

A PDF filling API lets your application fill out PDF forms programmatically. With DocSpring, you upload a PDF template once, place fields with our drag-and-drop template editor, then send a POST request with JSON data whenever you need a filled-out PDF. The API returns a download URL for the generated document.

Can I fill out flat PDFs that have no form fields?

Yes. DocSpring works with both fillable PDFs (AcroForms) and flat PDFs. If your PDF has fillable form fields, we import them automatically. If it is a flat document, you can drag and drop fields anywhere on the page with the template editor.

Which languages have API client libraries?

DocSpring provides official client libraries in 9 languages: Ruby, Python, JavaScript, TypeScript, PHP, C#, Java, Go, and Elixir. There is also a REST API with an OpenAPI specification that works with any language or HTTP client.

Can DocSpring handle high volumes of PDFs?

Yes. You can generate a single PDF synchronously and receive the finished document in one request, use the asynchronous API with webhooks, or batch-generate up to 50 PDFs per request. Customers use DocSpring to process thousands of insurance, lending, and healthcare documents every day.

Does DocSpring validate the data I send?

Every template has a JSON schema generated from its fields. Submission data is validated against this schema before the PDF is generated, so a renamed field or a wrong data type returns a clear validation error instead of a silently broken document.

Is DocSpring secure enough for financial, insurance, and healthcare documents?

DocSpring is SOC 2 Type 2 certified and GDPR compliant, with US, EU, and AU data residency options and Business Associate Agreements (BAAs) available. Self-hosted enterprise licenses are also available if your documents can never leave your infrastructure.

Can people sign the filled-out PDFs?

Yes, with our Data Requests feature: you send someone an embeddable form that collects data and a legally binding e-signature, then fills out the PDF with an audit trail.

What Our Customers Say

What Our Customers Say

Start filling out PDFs in minutes, not weeks

Sign up for a free trial and try out DocSpring with your own PDFs.