List templates
Templates
Templates
Create, manage, and render reusable templates
GET
List templates
Templates
Templates are reusable designs with dynamic variables. Create once, render with different data.For expression syntax and conditional rendering, see Expressions.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /templates | List templates |
POST | /templates | Create template |
GET | /templates/{uid} | Get template |
PUT | /templates/{uid} | Update template |
DELETE | /templates/{uid} | Delete template |
POST | /templates/{uid}/render | Render template to an image |
GET | /templates/{uid}/variables | Get variables defined in a template |
Variable Types
Templates support different variable types in{{variable}} placeholders:
| Type | Example | Description |
|---|---|---|
string | "Hello World" | Text content |
number | 42, 3.14 | Numeric values |
boolean | true, false | Conditional rendering |
array | ["a", "b"] | Lists for iteration |
object | {name: "..."} | Nested data |
Using Variables in Templates
Simple Interpolation
Conditional Rendering
Expressions
Layout Variants
Templates support multiple layout variants for different platforms. Each layout stores a separate canvas design optimized for a specific size (e.g., Twitter 1200x675, Instagram 1080x1080).- Layouts are created via the AI Resize feature in the editor
- Variables are shared across all layouts
- Render a specific layout with the
layoutparameter, or multiple withlayouts - The
defaultlayout key refers to the base template
Template Content
A template requires eitherhtml or fabricJSData (FabricJS canvas JSON), but not both.
Authorizations
API key obtained from the Pictify dashboard
Query Parameters
Required range:
x <= 100Available options:
newest, oldest, name Available options:
all, image, pdf