v1
latestOpenAPI 3.1.02026-08-06244570.4 KBPDF
Generate PDF from template
Generate a PDF from a saved template with dynamic data.
Authentication: API Key required (x-api-key header)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| template_id | string | ✅ Yes | Template short ID (12 characters) |
| data | object | ✅ Yes | Key-value data to render in template |
| export_type | string | No | url (default) or binary |
| expiration | integer | No | URL expiration in seconds (60-604800, default: 86400) |
Export Types
- url (default): PDF is uploaded to CDN, returns JSON with URL
- binary: Returns raw PDF bytes directly
Credits: 1 credit deducted per successful generation.
Rate Limits: 60 requests/min (free), 120 requests/min (paid). Headers included in response.
post/v1/pdf/create
Request body
Example request
{
"data": {
"invoice_number": "INV-001",
"name": "John Doe"
},
"expiration": 86400,
"export_type": "url",
"filename": "invoice-001",
"template_id": "HMQywVpZxqAM"
}Response
PDF generated successfully
Example response
{
"credits_remaining": 99,
"expires_in": 86400,
"filename": "invoice-001.pdf",
"url": "https://cdn.templatefox.com/generated/abc123/invoice.pdf"
}