Create PDF From Template
apitemplate.create_pdf
ActionBusiness appsconnection required
Calls the APITemplate.io API with the connection's credentials.
Render a saved PDF template with your own JSON data.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- APITemplate.io
- Secret shape
- the API key, or {"api_key": "…"}
- Config it needs
- base_url
- Resolved by
- config.connection_id, else node.connection_id
Configuration
7 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
template_id The template to render, as shown in the APITemplate.io web console. | string | Yes | — | — | 00377b2b1e0ee394 |
data The values the template's placeholders are filled with, as a JSON object. | object | No | — | — | {"invoice_number":"INV38379","total_amount":82542.56} |
export_type How the result comes back: 'json' stores the file on APITemplate's CDN and returns a download_url, 'file' returns the document itself and stores nothing. | string | No | json | one of "json", "file" | — |
output_format What to render the template as. Leave blank for APITemplate's default, a PDF. | string | No | — | one of "pdf", "html", "png", "jpeg" | — |
filename Name for the generated file, ending in the right extension. Defaults to a UUID. | string | No | — | — | invoice-89326.pdf |
expiration Minutes before APITemplate deletes the file from its CDN. 0 keeps it permanently. | number | No | — | 0–10080 | — |
meta Your own reference for this render; it comes back on apitemplate.list_objects. | string | No | — | — | inv-iwj343jospig |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"data": {
"invoice_number": "INV38379",
"total_amount": 82542.56
},
"export_type": "json",
"filename": "invoice-89326.pdf",
"meta": "inv-iwj343jospig",
"template_id": "00377b2b1e0ee394"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
status APITemplate's own verdict for the render: 'success'. | string | — |
download_url URL of the generated file on APITemplate's CDN; empty when export_type is 'file'. | string | — |
template_id The template that was rendered. | string | — |
total_pages How many pages the generated PDF has. | number | — |
transaction_ref APITemplate's reference for this render; pass it to apitemplate.delete_object. | string | — |
post_actions Results of any configured Post Actions, such as an upload to your own S3 bucket. | array | — |
file_content The file, base64-encoded. | string | — |
content_encoding | string | base64 |
filename | string | app-main.zip |
content_type | string | application/zip |
size Raw size in bytes (before base64). | number | — |
{
"content_encoding": "base64",
"content_type": "application/zip",
"download_url": "",
"file_content": "",
"filename": "app-main.zip",
"post_actions": [],
"size": 0,
"status": "",
"template_id": "",
"total_pages": 0,
"transaction_ref": ""
}Notes
- Every render spends one of the account's API credits; apitemplate.account_information reports how many are left.
- With export_type 'json' the file is stored on APITemplate's CDN and the node emits a download_url; with 'file' nothing is stored and the node emits the file itself.
See Create PDF From Template run in a workflow.
In a technical demo we add the APITemplate.io connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.