v1
latestOpenAPI 3.1.02026-08-06244570.4 KBPDF Async
Generate PDF asynchronously
Queue a PDF generation job for async processing.
Authentication: API Key required (x-api-key header)
How It Works
- Submit a job with template and data
- Receive a job_id immediately
- Poll /v1/pdf/status/{job_id} for completion
- Optionally receive a webhook notification
When to Use Async
Use async generation when:
- Processing large documents or batches
- You can't wait for synchronous response
- You want webhook notifications
Webhooks
If webhook_url is provided, we'll POST to it when the job completes or fails:
{
"event": "pdf.completed",
"job_id": "...",
"status": "completed",
"result": {
"url": "https://...",
"filename": "invoice.pdf"
}
}
Webhooks include HMAC-SHA256 signature in X-TemplateFox-Signature header if you provide a webhook_secret.
Credits: 1 credit deducted immediately (refunded if job fails permanently).
post/v1/pdf/create-async
Request body
Example request
{
"data": {
"invoice_number": "INV-001",
"name": "John Doe"
},
"expiration": 86400,
"export_type": "url",
"filename": "invoice-001",
"template_id": "HMQywVpZxqAM",
"webhook_url": "https://example.com/webhooks/pdf"
}Response
Job queued successfully
Example response
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"credits_remaining": 99
}