---
title: "Create an email template (draft)"
method: POST
path: "/templates"
tags: ["templates"]
---

# Create an email template (draft)

`POST /templates`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/templates`
- Auth: HTTP bearer

## Request body

- object
  - `templateKey` string
  - `name` string
  - `definition` unknown

## Response `201`

Created

- object
  - `success` boolean, required
  - `template` object, required

## Other responses

- `400`: Invalid parameters
- `401`: Missing or invalid API key
- `409`: templateKey already exists

---

[API](https://skmtc.dev/mailly/apis/mailly-api.md) · [All operations](https://skmtc.dev/mailly/apis/mailly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailly/apis/mailly-api/revisions/1ceb29637301?raw)
