Creates a background job and returns immediately with 202 and a jobId. Then use Get job status, Download job PDF, or Cancel job.
Request
Path parameters
Your API key, or Authorization: Bearer <key>.
Body
Data merged into the template (plain JSON object).
Same as data, but a JSON-encoded string. Use one or the other (not both required; if both are sent, jsonData takes precedence).
HTTPS URL called when the job reaches a terminal state (completed, failed, canceled). Must be public (not localhost).
Required when webhookUrl is set. Used to sign the webhook body. Max length: 512 chars. See Webhooks.
Stable key you choose. If you retry the same request, an existing job with this key is returned and deduplicated: true.
Response
HTTP 202: Job created
{
"jobId": "cma1b2c3d4e5f6g7h8i9j0k",
"status": "queued",
"deduplicated": false
}
Use this with GET /api/v1/jobs/{jobId}.
Usually "queued" for a new job. If deduplicated is true, this can be any existing job status.
true when an existing job was reused for the same idempotencyKey.
Error responses
| Status | Typical cause |
|---|
| 400 | Invalid body, webhook URL, or missing webhookSecret with webhookUrl |
| 401 | Auth failed |
| 404 | Template not found |
| 413 | Request too large |
| 422 | Data/template validation exceeded a complexity limit |
| 429 | Rate limit, page quota, or too many active jobs |
| 500 | Internal server error |
Examples
curl -X POST https://pdfgorilla.io/api/v1/templates/TEMPLATE_ID/generate-async \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data": {"orderId": "A-1"}}'
Job lifecycle (text)
queued -> processing -> completed
-> failed
-> canceled
-> expired (after retention)
Details: Get job status, Async workflow.
Rate limits
| Limit | Value |
|---|
| New async jobs per minute (per identity subject) | 20 |
| Additional generate-rate check for API-key requests | 60 per minute |
| Active jobs per account | 10 |
| Active jobs per API key | 20 |
See Limits.