---
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 a successful write. Present when an input was discarded or did not take effect as requested. This includes block fields that do not render as their names suggest, sequence email-step formatting restored on top of submitted blocks, and sender-identity conflicts such as a replyToName that differs from the saved profile. Each message identifies the affected input and gives recovery guidance. Absent when there is nothing to report.

## Other responses

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

## Changes

> 121 revisions in range; 10 could not be searched.

- **2026-08-16** `6fd2903b91ce` — 3 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `401` status
  - added the optional property `code` to the response with the `500` status
- **2026-08-02** `36f92fc0caa2` — 3 breaking
  - the response property `success` became optional for the status `400`
  - the response property `success` became optional for the status `401`
  - the response property `success` became optional for the status `500`
- **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

[Full 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/73f826277d9a/schema)
