Create Template
Create a template with either the Handlebars HTML engine or the FabricJS canvas engine.
engine field.
engine, the API defaults to fabric for backwards compatibility. New
HTML templates should set engine: "html" explicitly.Handlebars HTML templates
Setengine: "html" and pass your template source in html. Pictify compile-validates
it on save and fails with HTTP 422 if a block is unclosed or a helper is unknown.
Auto-added variables
Any{{identifier}} referenced in the template body that is not declared in
variableDefinitions is automatically added as a text variable on save. The response
echoes the added names under addedVariables so your client can surface them:
engine=html authoring loop feel “just work” — you can type
{{price}} into your template and save; the variable appears on the next read
without a separate declaration step.
strictVariables and jsEnabled
Two HTML-only toggles affect render behaviour:
strictVariables
true, rendering fails with HTTP 422 if a root-level variable referenced in the
template was not supplied. Leave off if you rely on {{#if optional}} guards.jsEnabled
true, scripts inside the template execute during render (Chart.js, KaTeX,
animated SVG). Off by default to prevent runaway loops. A 30s hard timeout always applies.false and can be flipped with PUT /templates/{uid}.
Helpers and expressions
HTML templates have access to the full Pictify helper library — string casing, number and currency formatting, date formatting, array helpers, and JSON inspection. See Expressions for the complete reference.FabricJS canvas templates
Setengine: "fabric" (or omit — it’s the default) and pass a FabricJS canvas JSON
object in fabricJSData. Multi-page canvases are supported via pages.
data:image/... sources inside fabricJSData are uploaded to Pictify storage
during save and replaced with CDN URLs. No extra step needed.Rendering
Once saved, render withPOST /templates/{uid}/render
and pass variable values in the variables object.
Authorizations
API key obtained from the Pictify dashboard
Body
Human-readable template name. Shown in the dashboard.
Template engine. Set html to author with Handlebars + HTML.
fabric, html Required for engine=html. Handlebars source. Must compile.
Undeclared {{identifier}} references are auto-added as text variables.
Required for engine=fabric. FabricJS canvas JSON.
Render width in px.
Render height in px.
Template type tag (e.g. og-image, twitter-card). Free-form.
Variable schema. For engine=html, identifiers referenced in the template
body but not declared here are auto-added as text variables and returned
under addedVariables in the response.
engine=html only. When true, scripts inside the template execute at
render time. Enables Chart.js, KaTeX, and animated SVG. Disables
infinite-loop protection; the 30s hard timeout still applies.
engine=html only. When true, missing root-level variables throw
HTTP 422 at render time. Leave off if you rely on {{#if optional}} guards.
image, pdf Page preset when outputFormat=pdf.
A4, A4_LANDSCAPE, LETTER, LETTER_LANDSCAPE, LEGAL, A3, TABLOID Multi-page canvas pages (engine=fabric only).