Generate PDF from Template
Create a PDF using your custom template and structured JSON data. This is the primary endpoint for template-based PDF generation.Path Parameters
templateName(string, required): The name of your custom template created in the dashboard
Request Headers
x-api-key(string, required): Your API key for authenticationContent-Type:application/json
Request Body
Response
Success (200):previewUrl as the src for an iframe (or <object> tag) when you want to render a read-only preview directly in your UI. The URL is short-lived and expires alongside the download link.
Error (400/401/404):
Example Request
Template Data Structure
ThecontextJson object structure depends entirely on your template design. Common patterns include:
Certificate Template:
Error Codes
TEMPLATE_NOT_FOUND: Template with specified name doesn’t existINVALID_API_KEY: API key is invalid or expiredMISSING_TEMPLATE_DATA: Required template fields are missingQUOTA_EXCEEDED: Account has exceeded PDF generation limits
Authorizations
Path Parameters
URL-encoded name of the template to use for PDF generation
Body
application/json
Response
PDF generated successfully
Whether the PDF generation was successful
Example:
true
Signed URL to download the generated PDF (expires in 1 hour)
Signed URL to preview the generated PDF in an iframe (expires in 1 hour)
Name of the generated PDF file
Size of the generated PDF in bytes
ID of the template used for generation
Name of the template used for generation