---
title: "Render an email template"
method: POST
path: "/email_templates/{id}/render"
tags: ["Email Templates"]
---

# Render an email template

`POST /email_templates/{id}/render`

Renders a template using the provided Liquid variables. Missing `template_variables` defaults to `{}`.

When the template has `strict_variables` enabled and a required variable (per `variable_schema`) is missing, returns 422 naming the variable. When the template has `autoescape` enabled, the rendered `html_body` expression output is HTML-escaped at the output boundary; `subject` and `text_body` are not autoescaped.

## Path parameters

- `id` string, uuid, required

## Request body

- RenderEmailTemplateRequest
  - `template_variables` object — Variables for Liquid template rendering. Non-object values are silently treated as an empty object.

## Response `200`

Rendered template content.

- RenderedEmailTemplateResponse
  - `data` RenderedEmailTemplate, required — Template object with `subject`, `html_body`, and `text_body` replaced by their Liquid-rendered values. All other template fields (id, name, variables, etc.) remain unchanged.
    - `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 — Legacy unstructured variable names. This path remains supported unchanged.
    - `strict_variables` boolean, required — Whether strict variable validation is enabled for this template. When `true`, sends and renders that are missing a variable marked `required: true` in `variable_schema` fail with 422 naming the variable.
    - `autoescape` boolean, required — Whether HTML autoescaping is enabled for this template. When `true`, only rendered `html_body` expression output is HTML-escaped at the output boundary; `subject` and `text_body` are never autoescaped.
    - `variable_schema` object, nullable, required — Structured variable requirements, or `null` when the template uses only the legacy `variables` array.
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `401` — Not authorized (10006).
- `404` — Resource not found (10001).
- `422` — Standalone template render failure (10015).

## Changes

> 82 revisions in range; 1 not diffed.

- **2026-09-23** `16bfa298dc71` — 3 info
  - added the required property `data/allOf[#/components/schemas/EmailTemplate]/autoescape` to the response with the `200` status
  - added the required property `data/allOf[#/components/schemas/EmailTemplate]/strict_variables` to the response with the `200` status
  - added the required property `data/allOf[#/components/schemas/EmailTemplate]/variable_schema` to the response with the `200` status
- **2026-09-22** `9621f6123ebc` — 6 warning
  - added the new `10011` enum value to the `errors/items/code` response property for the response status `401`
  - added the new `10011` enum value to the `errors/items/code` response property for the response status `404`
  - added the new `10011` enum value to the `errors/items/code` response property for the response status `422`
  - added the new `domain_graduation_limit_exceeded` enum value to the `errors/items/code` response property for the response status `401`
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/changes/email_templates/:id/render/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.dev/team-telnyx/apis/telnyx-api-2/revisions/16bfa298dc71?raw)
