> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Template

> Create an email template

Create a reusable email template with exactly one content source: `prompt` for Sequenzy-generated branded native blocks, `blocks` for finished caller-supplied content, or `html` for preserved/imported markup. `style` and `tone` are valid only with `prompt`; subject and preview values may override generated values.

Creating a standalone copy of a saved email or gallery design and AI rewriting
within that design are currently dashboard-only workflows. This endpoint has no source-template copy
operation, and `prompt` does not preserve an existing layout. See the
[documented interface exception](https://docs.sequenzy.com/concepts/email-templates.md#availability-across-interfaces)
for the scope and supported alternatives.

## Request

**name** `string` *required*

Template name. Sequenzy stores API-created templates with a `[Template]`
prefix.

**subject** `string`

Email subject line. Required with `html` or `blocks`; optional with `prompt`,
where it overrides the generated subject.

**previewText** `string | null`

Optional inbox preview override. With `prompt`, the generated preview is used
when this field is omitted.

**prompt** `string`

Natural-language request for Sequenzy to generate branded native template
blocks. Use this instead of `html` or `blocks`.

**style** `string`

Optional generation style. Valid only with `prompt`. Pass `designed` or
`plain` to force the designed or plain-text email style; other values are
freeform prompt guidance. Defaults to your company's email style preference
(designed unless you chose plain text).

**tone** `string`

Optional generation tone. Valid only with `prompt`.

**html** `string`

Raw HTML body. Use this or `blocks`, not both.

**blocks** `array`

Sequenzy email blocks. Use this or `html`, not both. Put block styling under
`styles`; top-level style keys like `backgroundColor`, `backgroundOpacity`,
`textColor`, `textAlign`, `borderColor`, `borderWidth`, and `borderRadius` are
normalized into `styles`.

**labels** `array`

Label names to assign to the template. Missing labels are created
automatically. The API also accepts `label` as a compatibility alias.

**isTemplate** `boolean` (default: false)

Save as a reusable master design. Master designs are offered first when a
dashboard sequence step or campaign starts from an existing email, and
starting from one always creates an independent copy.

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/templates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome",
    "prompt": "Welcome new customers and explain the next steps",
    "tone": "friendly"
  }'
```

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/templates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome",
    "subject": "Welcome!",
    "labels": ["edm"],
    "html": "<p>Thanks for joining.</p>"
  }'
```

## Responses

```json 200 theme={null}
{
  "success": true,
  "template": {
    "id": "email_abc123",
    "name": "[Template] Welcome",
    "subject": "Welcome!",
    "labels": ["edm"],
    "isTemplate": false
  }
}
```

```json 400 theme={null}
{
  "success": false,
  "error": "Provide exactly one of prompt, html, or blocks."
}
```

```json 401 theme={null}
{
  "success": false,
  "error": "Unauthorized"
}
```

```json 500 theme={null}
{
  "success": false,
  "error": "Failed to create template"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.