Kalpana Docs
Resources

Get a template

Read a template's variables, pages, previews, and missing-font information.

GET /api/templates/{id}

Requires templates:read.

Query parameters

NameTypeRequiredDescription
workspacestringYesWorkspace slug or id.
curl "https://app.kalpana.one/api/templates/tpl_123?workspace=acme" \
  --header "x-api-key: $KALPANA_API_KEY"

Response

{
  "id": "tpl_123",
  "name": "Product card",
  "description": null,
  "width": 1080,
  "height": 1080,
  "workspaceId": "ws_123",
  "isAnimated": false,
  "createdAt": "2026-09-01T10:00:00.000Z",
  "updatedAt": "2026-09-02T08:30:00.000Z",
  "previewImageUrl": "https://cdn.example/preview.png",
  "previewVideoUrl": null,
  "sceneTemplate": { "nodes": {} },
  "variables": {
    "headline": {
      "node_type": "text",
      "spans": [{ "span_index": 0, "value": "Weekend offer", "enabled": true }]
    }
  },
  "missingFonts": [],
  "pages": [
    {
      "id": "page_123",
      "name": "Page 1",
      "description": null,
      "scene": { "nodes": {} },
      "variables": {},
      "isAnimated": false,
      "previewImageUrl": "https://cdn.example/preview.png",
      "previewVideoUrl": null,
      "previewSceneKey": null
    }
  ],
  "flows": [],
  "flow": null,
  "assets": {
    "fonts": [{ "family": "Inter", "style": "Bold", "url": "https://storage.example/signed-font-url" }],
    "images": {}
  }
}

The scene objects are shortened here.

FieldDescription
id, workspaceId, name, descriptionIdentity of the template.
width, heightCanvas size in pixels.
isAnimatedtrue when the template has motion.
previewImageUrl, previewVideoUrlPreviews of the first page, or null. The video URL is null for static templates.
variablesMap of variable id to its definition, for the first page. Each definition has a node_type of text, image, or style, and holds the default value.
pagesEvery page of the template, in order, each with its own id, name, description, scene, variables, isAnimated, previewImageUrl, previewVideoUrl and previewSceneKey. id is null for a template not yet split into pages.
missingFontsFonts the first page uses that the workspace has not uploaded, each as { family, style, weight, italic }. Get a template summary lists them for every page.
assetsSigned URLs the canvas uses to draw the template, for every page: fonts as { family, style, url } and images as a map of image key to URL.
sceneTemplateThe first page's design. Large; ignore it unless you need the layer tree.
flowsThe template's flows, in order, each with its own id, name, description, and flow (its definition). Each is a video made from some of its pages. Pass an id as a job's flow, or as a batch's flow.
flowThe definition of the first flow, the same as flows[0].flow, or null when there are none.
createdAt, updatedAtTimestamps.

The keys of variables are layer ids. A job or batch row fills a layer by its id or its name, through modifications: see Modifications for the keys and values. Get a template summary lists each page's layer names.

A job renders one page, named by its page id, and a batch names the pages it renders. Take each page's id from pages.

Resolve missingFonts before producing customer-facing files. Rows that use those fonts may not render as designed.

Errors

StatusCause
403Your role or key lacks templates:read.
404The template is not in this workspace or has been deleted.
Was this page helpful?

Updated 9 Nov 2026

On this page