---
title: "Preview an email template"
method: POST
path: "/email-templates/{id}/preview"
tags: ["Email"]
---

# Preview an email template

`POST /email-templates/{id}/preview`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/email-templates/{id}/preview`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `messages:read`)

The template filled with data, in the style of the site, without sending anything. missing_variables lists what has no value.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `data` object: The values for the variables, like { "name": "Sam", "order_number": "1042" }. Text, numbers or true/false.

## Response `200`

The subject, html and text as they would be sent.

- object
  - `subject` string, required
  - `html` string, nullable, required
  - `text` string, nullable, required
  - `missing_variables` string[], required: Variables without a value in data and without a fallback ({{name|there}}); they come out empty.

## Other responses

- `400`: Bad Request: invalid_json.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

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