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:
- Need more details? Check out our PDF fill documentation.
- A full glossary about supported field types and their formatting options.
- Understanding the power of field aliases.