---
title: "Create an email template"
method: POST
path: "/email_templates"
tags: ["Email Templates"]
---

# Create an email template

`POST /email_templates`

Creates a Liquid email template. Variables are auto-extracted when omitted.

## Headers

- `Idempotency-Key` string

## Request body

- CreateEmailTemplateRequest
  - `html_body` string, nullable — Liquid template HTML body.
  - `name` string, required — Letters, numbers, spaces, hyphens, and underscores only.
  - `subject` string, nullable — Liquid template subject.
  - `text_body` string, nullable — Liquid template text body.
  - `variables` string[] — Template variables. Auto-extracted from subject/body fields when absent.

## Response `201`

Template created.

- EmailTemplateResponse
  - `data` EmailTemplate, required
    - `created_at` string, date-time, required
    - `html_body` string, nullable, required
    - `id` string, uuid, required
    - `name` string, required
    - `record_type` 'email_template', required
    - `subject` string, nullable, required
    - `text_body` string, nullable, required
    - `updated_at` string, date-time, required
    - `variables` string[], required

## Other responses

- `400` — Bad Request / Validation Failed (10015). Invalid, duplicate, empty, malformed, or overlong Idempotency-Key headers are rejected by Edge with HTTP 400 and error code 10015.
- `401` — Not authorized (10006).
- `409` — A request with the same Idempotency-Key is still being processed (10036). Retry later with the same key and request.
- `413` — Request body exceeds the 8,000,000-byte limit for this endpoint.
- `422` — Validation Failed (10015) or changeset validation error. Reusing an Idempotency-Key with a different request also returns 422 (10027).
- `503` — Service unavailable (10016), including an unavailable upstream dependency or unavailable Edge idempotency protection for a keyed request.

## Changes

- **2026-07-16** `2fb3b617430a` — 12 warning, 6 info
  - added the new `recipient_suppressed` enum value to the `errors/items/code` response property for the response status `400`
  - added the new `recipient_suppressed` enum value to the `errors/items/code` response property for the response status `401`
  - added the new `recipient_suppressed` enum value to the `errors/items/code` response property for the response status `409`
  - added the new `recipient_suppressed` enum value to the `errors/items/code` response property for the response status `413`
  - …14 more
- **2026-07-14** `021f0faf96df` — 1 breaking, 1 warning
  - for the `header` request parameter `Idempotency-Key`, the maxLength was decreased from `512` to `255`
  - changed the pattern of the `header` request parameter `Idempotency-Key` from `^(?:[A-Za-z0-9_-]{1,255}|"(?:[\x20-\x21\x23-\x5B\x5D-\x7E]|\\["\\]){1,255}")$` to `^[A-Za-z0-9_-]{1,255}$`
- **2026-07-12** `b3c5aebde44c` — 4 warning, 5 info
  - added the new `10027` enum value to the `errors/items/code` response property for the response status `401`
  - added the new `10027` enum value to the `errors/items/code` response property for the response status `422`
  - added the new `10036` enum value to the `errors/items/code` response property for the response status `401`
  - added the new `10036` enum value to the `errors/items/code` response property for the response status `422`
  - …5 more
- **2026-07-07** `6ef0ae248bf7` — 1 info
  - endpoint added
- …earlier changes not shown

[Full history](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/changes/email_templates/post.md)

---

[API](https://skmtc.dev/team-telnyx/apis/telnyx-api-2.md) · [All operations](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/team-telnyx/telnyx-api-2/revisions/3fdc16374d70/schema)
