---
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
  - `name` string, required — Letters, numbers, spaces, hyphens, and underscores only.
  - `subject` string, nullable — Liquid template subject.
  - `html_body` string, nullable — Liquid template HTML body.
  - `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
    - `record_type` 'email_template', required
    - `id` string, uuid, required
    - `name` string, required
    - `subject` string, nullable, required
    - `html_body` string, nullable, required
    - `text_body` string, nullable, required
    - `variables` string[], required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, 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.

---

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