PDF Generation API Parameters
Our API offers parameters for customizing PDF generation from HTML, URLs, and dynamic templates. This section details each parameter, with examples, to help you tailor the output to your needs.
This page lists common parameters shared across all endpoints. For endpoint-specific parameters (isEncoded, webhook, additionalWebhookHeaders, retryDelays), see the endpoint references:
/v1/direct– immediate PDF response./v1/sync– URL-based access./v1/async– background processing with webhook.
Source Parameters
You must provide exactly one of the following content sources: html, url, or templateId (with templateData). These parameters are mutually exclusive – use only one per API request.
html
Type: string
Required: No
Details: Accepts Base64-encoded HTML content, allowing you to provide the HTML directly for generating a PDF.
Usage:
{
"html": "PGh0bWw+Cjxib2R5Pgo8cD5UZXN0IHBhcmFncmFwaDwvcD4KPC9ib2R5Pgo8L2h0bWw+Cg=="
}
This example generates a PDF containing the text: “Test paragraph”.
Related reading: Optimizing HTML for Professional PDF Output.
url
Type: string
Required: No
Details: Accepts any valid HTTPS URL up to 2048 characters. Specifies the webpage to be converted to a PDF. PDFBolt rejects non‑HTTPS URLs and test domains (e.g., .test).
Usage:
{
"url": "https://example.com"
}
templateId
Type: string
Required: No
Details:
Specifies the unique identifier (UUID) of a published template to use for PDF generation. When using this parameter, templateData must also be provided to populate the template variables. Templates allow you to separate design from data, making document generation more efficient and maintainable.
Usage:
{
"templateId": "c2b5f574-19bc-4e34-9049-566176e6dc48",
"templateData": {
"customer_name": "John Doe",
"invoice_number": "INV-001"
}
}
- Templates must be created and published through the Templates Dashboard before they can be used via API.
- Learn more about template creation and management.
- Need a template fast? Generate one with AI from a simple description or reference files.
templateData
Type: object
Required: No (mandatory only if templateId is provided)
Details:
Contains the JSON data that replaces placeholder variables in your template to generate the final PDF. Property names in this object must match the variable names used in your template's Handlebars syntax. For example, if your template contains {{customer_name}}, your templateData should include a customer_name property with the actual value.
Usage:
{
"templateId": "c2b5f574-19bc-4e34-9049-566176e6dc48",
"templateData": {
"invoice_number": "INV-001",
"customer_name": "John Doe",
"items": [
{
"name": "Premium Service",
"price": "199.99"
}
],
"total": "199.99",
"is_paid": true
}
}
Template data is used only to generate the requested PDF. In request logs, the html and templateData fields are always redacted after processing is complete.
Your data remains private and secure. See our Privacy Policy and DPA for data protection details.