Kalpana Docs
Resources

Update a template

Change a template's name, description, or tags.

PATCH /api/templates/{id}

Requires templates:update. Send only the fields to change.

FieldRequiredDescription
workspace_idYesWorkspace slug or id. Note the field name differs from most endpoints.
nameNoNew name, 1 to 200 characters. Spaces at either end are trimmed.
descriptionNoNew description, up to 2000 characters.
tagsNoAn array of strings. Replaces the template's tags.
expected_updated_atNoThe updatedAt you last read. The change applies only while the template still has it; otherwise the call fails with 409. Left out, the last write wins.
curl --request PATCH "https://app.kalpana.one/api/templates/tpl_123" \
  --header "x-api-key: $KALPANA_API_KEY" \
  --header "content-type: application/json" \
  --data '{"workspace_id":"acme","name":"Product card v2","tags":["platform:meta"]}'

Response

{
  "id": "tpl_123",
  "name": "Product card v2",
  "description": null,
  "width": 1080,
  "height": 1080,
  "workspaceId": "ws_123",
  "previewImageKey": "ws_123/previews/tpl_123.png",
  "previewMotionKey": null,
  "previewImageUrl": "https://cdn.example/preview.png",
  "previewVideoUrl": null,
  "isAnimated": false,
  "createdAt": "2026-09-01T10:00:00.000Z",
  "updatedAt": "2026-09-02T08:30:00.000Z",
  "tags": ["platform:meta"],
  "status": "ready",
  "createdBy": "user_123",
  "sceneTemplate": { "nodes": {} },
  "fontsMap": {},
  "variables": {},
  "missingFonts": [],
  "assets": { "fonts": [], "images": {} }
}

sceneTemplate, variables, missingFonts and assets are the first page's, in the same shape as Get a template. Unlike Get a template, assets covers the first page only, and there is no pages or flows. status is one of assets_pending, draft, ready or failed. previewImageKey and previewMotionKey are storage keys; use the URLs instead. fontsMap is always empty.

The design itself is edited in the Studio. The body also accepts the Studio's design fields, which this reference does not cover.

Errors

StatusCause
403Your role or key lacks templates:update.
404The template is not in this workspace or has been deleted.
409expected_updated_at no longer matches: the template was changed since you read it. Read it again, then retry.
Was this page helpful?

Updated 4 Nov 2026

On this page