Skip to main content

API Overview

PDFGen Studio provides a RESTful API for generating PDFs, images, and documents from various sources.

Base URL

https://api.pdfgenstudio.com/api/v1

Renderer Endpoints

All four renderer endpoints handle options consistently:

EndpointMethodDescription
/renderer/templates/:idPOSTRender a template with dynamic data
/renderer/jsonPOSTGenerate document from JSON definition
/renderer/htmlPOSTConvert HTML to PDF/image
/renderer/urlPOSTCapture webpage as PDF/screenshot

Options Handling

All endpoints support options in both query parameters AND request body:

  • Query params - For quick/dynamic usage
  • Body options - For complex/structured requests
  • Query params take precedence over body.options

Example: Using Query Params

POST /api/v1/renderer/templates/123?format=png&response=base64&pixelRatio=3

Example: Using Body Options

{
"data": { "name": "John Doe" },
"options": {
"format": "pdf",
"response": "binary"
}
}

Example: Mixed (Query Wins)

POST /api/v1/renderer/json?format=png
Body: { "document": {...}, "options": { "format": "pdf" } }
# Result: format=png (query wins)

Common Response Formats

FormatContent-TypeDescription
pdfapplication/pdfPDF document
pngimage/pngPNG image
jpgimage/jpegJPEG image

Response Types

TypeDescription
binaryRaw binary data (default)
base64Base64 encoded string

HTTP Status Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not Found - Template or resource not found
422Unprocessable Entity - Validation failed
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Rate Limiting

API requests are rate limited based on your plan. Rate limit information is included in response headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1704412800