Skip to main content
POST
/
api
/
v1
/
templates
/
{templateId}
/
generate
Generate PDF (sync)
curl --request POST \
  --url https://pdfgorilla.io/api/v1/templates/{templateId}/generate \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "data": {},
  "jsonData": "<string>"
}
'
Renders a PDF synchronously. The connection stays open until the file is ready (up to the render timeout). The response body is raw PDF bytes, not JSON.

Request

Path parameters

templateId
string
required
ID of your template from the dashboard or Studio URL.

Headers

x-api-key
string
required
Your API key. You can use Authorization: Bearer <key> instead.
Content-Type
string
required
Must be application/json.

Body

data
object
JSON object whose keys match the placeholders in your template. Example: { "customer": { "name": "Acme" } }.
jsonData
string
Same data as a JSON string (escaped JSON). Use either data or jsonData. If both are sent, jsonData wins.

Response

HTTP 200: PDF file

Successful responses are binary PDF, with headers similar to:
Content-Type: application/pdf
Content-Disposition: attachment; filename="your-template-name.pdf"
Cache-Control: no-store

Error responses

JSON shape (except some low-level failures):
{
  "error": "Short explanation."
}
Some responses also include hint, and quota exhaustion returns used, limit, remaining, and resetAt. See Errors.
StatusWhen
400Bad JSON, or data / jsonData not a plain object
401Missing or invalid API key
404Template not found or not owned by your account
413Body or field exceeds size limits
422Template or data breaks complexity rules
429Rate limit, monthly page quota, or transient render-service queue saturation
500Internal server error
502PDF service unavailable
504Render took too long

Examples

curl -X POST https://pdfgorilla.io/api/v1/templates/TEMPLATE_ID/generate \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": {"customer": {"name": "Acme Corp"}}}' \
  --output out.pdf

Rate limits

IdentitySync generate
API key60 per minute
Dashboard session20 per minute
Job quotas and payload limits are described in Limits.