Skip to main content
POST
Fill Forms

Parameters

string
A JSON-encoded array of { "field": "<name>", "value": <value> } objects. Each field must match the field name as it appears in the PDF template. Omit or pass null to read values from the attached data file instead. If no data file is provided and this field is empty, a 422 error is raised.Example
boolean
default:"false"
When true, the request fails if any supplied field name does not match a field present in the PDF. When false (default), unrecognised field names are silently ignored and the remaining fields are still filled.

Strict mode

By default, extra field names in your payload are discarded without error. Enable strict when you want a hard guarantee that every key you supply maps to a real form field — useful for catching typos or schema drift between your data source and the PDF template.

File Upload

There are two ways to provide form field values:

Inline form fields (using params):

Pass the PDF document via the file parameter, and provide field values directly in the fields array within params:

Data file (using files[0] and files[1]):

Pass the PDF as files[0] and the data file as files[1]. The data file can be CSV, JSON, XFDF, or FDF format. Fill Forms accepts up to 25 input files per request, and their combined size must not exceed the 100 MB per-request limit.
Fill a PDF form by supplying field values against a form template. The endpoint maps the provided field data onto the template’s form fields and returns a flattened PDF with the fields populated.

Supported data file formats

The files[1] data file must be sent with one of the following content types:
The data file must use one of the four content types above. Other content types (including application/octet-stream and text/plain) are rejected with a 415 error.
The formats are equivalent — each maps form field names to the values to set. The following all fill the same fields: CSV example:
JSON example:
XFDF example:
FDF example:
The field names must match the respective AcroForms names. Recognized checkbox values are: true, yes, 1, x (case insensitive). All values are stringified (e.g. {"age": 27} is interpreted as {"age": "27"}).

Output File Format

The endpoint can return output either as JSON or as a binary file. The format depends on the Accept header (details below), which defaults to application/json.

Processing

When requesting JSON, you can run the operation synchronously or asynchronously. This is determined by the Prefer header (details below).
  • In sync mode, the response includes a URL pointing to the processed file.
  • In async mode, the request creates a Job, and the response contains the Job ID and status so you can track progress.
Binary (octet-stream) responses are only available for synchronous operations.

Custom File Delivery

The endpoint supports custom file-delivery destinations through the optional delivery parameter. You can provide an upload target, such as your own PUT endpoint or a pre-signed S3 URL, and Nitro will upload the resulting file there. This works for both synchronous and asynchronous processing.
  • Sync delivery

    In synchronous calls, the delivery parameter lets you direct Nitro to upload the output file to a custom URL endpoint or a pre-signed URL (e.g S3), by providing an upload url in the uploadResultTo or uploadResultsTo properties.

    Custom endpoint

    If implementing the upload endpoint by yourself, make sure your code or middleware configuration accepts requests without content-type headers.

    S3 delivery

    If you are using S3 to manage delivery uploads, follow this AWS documentation to generate a pre-signed PUT URL.
    If using the AWS provided Python script, omit the Content-Type in Params to get the pre-signed url. For example:
  • Async delivery

    In asynchronous flows, you can also provide a custom URL or pre-signed S3 object via uploadResultTo or uploadResultsTo, to upload your file(s) once the Job is done processing.

    Callback

    For asynchronous processing, you can also include a callback URL within the delivery parameter. This callback is a POST endpoint that Nitro will call once the Job is created and running, providing details about the file-processing job. Example of Nitro’s callback request body:

Response behavior Matrix

This matrix shows the expected response behavior based on content type, sync/async mode, and custom file-delivery settings.

Limits

The Platform API has the following limits:
  • File size: Maximum of 100 MB per request for direct uploads and synchronous requests; asynchronous requests with remote-file (URL) input allow up to 300 MB. This applies to single-file and multi-file requests (multi-file requests are limited by their combined size). Some operations allow more — Merge accepts up to 1.5 GB for asynchronous remote-file input.
  • Page count: Maximum of 500 pages per individual document, or 2500 pages for asynchronous requests with remote-file (URL) input. This applies to single-file and multi-file requests. Multiple documents may exceed the page limit in total.
  • Retention time: Inputs and outputs are deleted approximately 15 minutes after the operation completes.

Request

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
enum<string>
default:*/*

Controls response format and behavior. See endpoint description above for detailed response combinations.

  • application/json: Returns JSON response with operation result
  • application/octet-stream: Returns binary file content
  • */*: Defaults to JSON response
Available options:
application/json,
application/octet-stream,
*/*
Prefer
enum<string>

Controls synchronous vs asynchronous operation. See endpoint description above for behavior details.

  • respond-async: Makes request asynchronous, returns job status for polling
  • No value: Synchronous response
Available options:
respond-async

Body

multipart/form-data
method
enum<string>
default:fill-forms
required

The Generations' endpoint method: fill-forms

Available options:
fill-forms
params
Fill Forms · object
required
file
file

The source PDF document when using inline field values via params.fields. Use this parameter when providing form field values directly instead of a data file.

files
file[]

The source PDF and data file when using a data file. files[0] is the source PDF document (application/pdf). files[1] is the data file containing form field values (CSV, JSON, XFDF, or FDF format).

delivery
object

This endpoint lets you supply your own URL to receive the single-file output. The URL may point to a custom API endpoint or a pre-signed S3 URL.

The HTTP method defaults to PUT, but you can change it based on your implementation needs via the verb parameter. You can also provide custom headers, such as authentication headers or any others required by your endpoint.

Response

Returns either JSON or binary output depending on the Accept header (defaults to JSON). JSON responses include a file URL for synchronous tasks or a job status for asynchronous tasks.

file
object