---
title: "Create a template"
method: POST
path: "/templates"
tags: ["Templates"]
---

# Create a template

`POST /templates`

## Request body

- CreateTemplateInput
  - `name` string, required
  - `subject` string, required
  - `html` string, required
  - `text` string
  - `variables` string[]
  - `builder_type` 'html' | 'visual' — Authoring mode. `visual` stores the block tree in builder_blocks; PostStack compiles it to HTML on save.
  - `builder_blocks` object[] — Block tree when builder_type is `visual`. Ignored otherwise.

## Response `200`

OK

- object
  - `success` boolean

---

[API](https://skmtc.dev/poststack/apis/poststack-api.md) · [All operations](https://skmtc.dev/poststack/apis/poststack-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/poststack/poststack-api/revisions/0f5bfcfae749/schema)
