Skip to content

Templates

Use these endpoints to discover your templates and the variables they expect, so your code can send the right payload to the export endpoint.

GET /api/templates

Returns a light summary of your templates, most recently updated first.

Terminal window
curl https://app.imprime.io/api/templates -H "x-api-key: $IMPRIME_API_KEY"
[
{
"_id": "6ada52d12b452e53f3c518e3",
"title": "Tutorial",
"code": "START",
"pageSize": { "width": 1920, "height": 1080 },
"createdAt": "2026-10-22T18:15:45.067Z",
"updatedAt": "2026-10-22T18:15:46.322Z"
}
]
Field Description
_id Template ID — what you pass to the export endpoint
title Also used as the PDF file name (<title>.pdf)
code Short human-readable code shown next to the title in the editor
pageSize Page dimensions in points, e.g. 1920 × 1080 (16:9) or 1240 × 1754 (A4)

GET /api/templates/{id}

Returns the full template. The field you’ll actually use is variableData: it tells you exactly which keys the export endpoint accepts.

Terminal window
curl https://app.imprime.io/api/templates/$ID -H "x-api-key: $IMPRIME_API_KEY" \
| jq '.variableData'
[
{
"_id": "6ada52d12b452e53f3c518ea",
"type": "string",
"name": "client",
"default": "ImprimeCorp",
"required": false,
"maxLength": 28
},
{
"_id": "6ada52d12b452e53f3c518ed",
"type": "boolean",
"name": "discount",
"default": true,
"required": false
},
{
"_id": "6ada52d12b452e53f3c518ee",
"type": "object-list",
"name": "lines",
"required": false,
"maxItems": 4,
"itemFields": [
{ "name": "label", "type": "string", "required": true, "maxLength": 24 },
{ "name": "price", "type": "string", "required": true, "maxLength": 10 }
],
"default": [
{ "label": "A5 flyers", "price": "$85" },
{ "label": "A3 posters", "price": "$120" }
]
}
]

See Variables for what each type expects at export time.

The response also contains pages (the laid-out content), pageNumbering and pageSize. Those describe the design and are managed in the editor — read them if you’re curious, but don’t build on their exact shape.