Template API

Preview a template payload

Renders a template payload as a PDF without saving it as a template or draft. Each successful preview render counts toward your available document conversions.

post/v1/templates/preview

Request

  • Base URL: https://api.pdfbolt.com
  • URL: https://api.pdfbolt.com/v1/templates/preview
  • Auth: API key in header PERSONAL-ACCESS-TOKEN

Query parameters

responseFormat'pdf' | 'json' | 'url'

Response format. Defaults to url, which returns a temporary documentUrl, expiresAt, and documentSizeMb. Use pdf to return raw PDF bytes or json to return pdfBase64 and documentSizeMb. Every format returns the conversion cost in the x-pdfbolt-conversion-cost response header.

Request body

templateEngine'HANDLEBARS' required

Template engine used to evaluate template content.

contentstring byte required

Base64-encoded complete UTF-8 HTML document with optional Handlebars placeholders.

sampleDataobject required

JSON object used to evaluate the template during validation and preview.

Response

Preview rendered successfully.

OR

Changes

No recorded changes to this operation across all 1 revision of this API.