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

# Create template

`POST /templates`

Creates a reusable email template from exactly one of prompt, HTML, or Sequenzy blocks.

## Request body

- object
  - `name` string, required
  - `subject` string — Required with HTML or blocks; optional with prompt, where it overrides the generated subject.
  - `previewText` string, nullable
  - `html` string — Raw HTML body. Mutually exclusive with blocks.
  - `blocks` object[] — Sequenzy email blocks. Mutually exclusive with html. Put visual styling under styles; top-level style keys such as backgroundColor, backgroundOpacity, borderColor, borderWidth, and borderRadius are normalized into styles.
  - `prompt` string — Natural-language request for branded native template blocks.
  - `style` string — Generation style; valid only with prompt.
  - `tone` string — Generation tone; valid only with prompt.
  - `labels` string[] — Label names to assign. Missing labels are created automatically.
  - `label` string[] — Compatibility alias for labels.

## Response `200`

Template created

- object
  - `success` boolean
  - `template` object
    - `id` string
    - `name` string
    - `subject` string
    - `labels` string[]
  - `warnings` string[] — Non-blocking advisories about the blocks that were written. The write succeeded. Present when a field was not part of the block schema and was discarded, or when a supported field does not control what its name suggests for that block type - for example styles.backgroundColor on a button colors the band behind the button while the fill comes from buttonColor. Each message names the offending path and the fields that block does accept. Absent when there is nothing to report.

## Other responses

- `400` — Validation error
- `401` — Unauthorized
- `500` — Template could not be created

## Changes

- **2026-07-29** `d03612b5fabd` — 1 info
  - added the optional property `warnings` to the response with the `200` status
- **2026-07-12** `d103f2b71fca` — 5 info
  - added the new optional request property `previewText`
  - added the new optional request property `prompt`
  - added the new optional request property `style`
  - added the new optional request property `tone`
  - …1 more
- **2026-05-13** `9a89cb9ec599` — 3 info
  - added the new optional request property `label`
  - added the new optional request property `labels`
  - added the optional property `template/labels` to the response with the `200` status
- **2026-05-11** `ee7b7111c55b` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/templates/post.md)

---

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