Quickstart
Generate your first PDF in under 5 minutes. You'll call the API, poll for the result, and download the file.
Prerequisites: a PDFox account and an API key. Create one here — it takes 30 seconds.
What you'll build
You'll send a template ID and a JSON data payload to the Generate PDF endpoint. PDFox renders the PDF asynchronously and returns a signed download URL when it's ready.
Steps
1
Submit a generate job
Send templateId + data to POST /v1/generate. The response contains a jobId — generation is asynchronous.
2
Poll for completion
Call GET /v1/jobs/:jobId every 1–2 seconds until status is completed or failed.
3
Download the PDF
The completed job contains a signed downloadUrl. Fetch it directly or redirect your user to it — the URL expires after 1 hour.
4
(Optional) Set up a webhook
Instead of polling, register a webhook URL and PDFox will POST a job.completed event when the PDF is ready. See Webhooks.
Next steps
- Authentication — understand API key scopes
- Create a template — build your own template in the visual editor
- Webhooks — avoid polling entirely
- Full API reference — all parameters for the generate endpoint
curl https://api.pdfox.com/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "tpl_demo_invoice",
"data": {
"company": "Acme Corp",
"invoiceNumber": "INV-001",
"total": 1250.00
}
}'curl https://api.pdfox.com/v1/jobs/JOB_ID \ -H "Authorization: Bearer YOUR_API_KEY"
curl -L "DOWNLOAD_URL" -o invoice.pdf
