---
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

---

[API](https://skmtc.net/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.net/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sequenzy/sequenzy-api/versions/af1cf9620482/schema)
