Tutorials

Fill PDFs over API

You can fill PDFs over API using a unique Anvil URL and example payload. In this article, we’ll walk you through how to fill standardized document templates over API. We’ll also show you how to use some advanced features* to create fillable PDFs and automatically repeat PDF pages. If you need to collect information and signatures, use a Workflow or an Etch packet instead.

* Advanced features are available on Custom plans.

Back to Help Center

Getting started

Anvil’s PDF fill API allows you to easily fill documents with data you already have. Before you can start filling your PDFs, you’ll need to templatize them first. As part of this process, you’ll want to assign correct field types and customize your field aliases. We highly recommend using Document AI, since it automatically identifies and tags fields with an appropriate name, type, and alias.

If you choose not to leverage Document AI, just note that assigning field aliases is a crucial step! During the fill process, you’ll pass data into your fields by matching data values with a field key (field alias or field id). By default, all fields are automatically assigned a randomized field id which makes it difficult to identify fields when you’re filling your PDF over API.

Field aliases act as human-readable keys, making it easy for you to identify which fields you’re filling. Additionally, field aliases help you automatically pass the same piece of data across multiple fields. This means you only need to provide data once and all fields with a matching field alias will automatically be filled in.

Once your PDF templates are set up, you’re ready to fill them with data.

Fill PDFs over API

Anvil allows you to programmatically fill templatized PDFs with a JSON payload by making a POST request to our PDF fill endpoint. This allows you to quickly and easily fill in PDFs with data you already have. The PDF fill API also supports advanced features, such as Interactive fields and Repeating pages when you are on a Custom plan.

Watch the tutorial below to learn everything you need to know about how to fill your PDFs over API.

Additional resources

Here are some additional resources to help you get started with filling in your PDFs over API:

Back to Help Center

Other common posts

1 - 0 of 0

Contact support

We know dealing with tech support can be painful. It's our goal to help you as quickly and efficiently as possible. Once we get your message, we will email you back as soon as we can.
    Want to try Anvil first?