---
title: "Render an email message as HTML"
method: POST
path: "/v1/email-messages/{emailMessageId}/render"
tags: ["Email messages"]
---

# Render an email message as HTML

`POST /v1/email-messages/{emailMessageId}/render`

## Request

- Base URL: `https://app.loops.so/api`
- URL: `https://app.loops.so/api/v1/email-messages/{emailMessageId}/render`
- Auth: HTTP bearer

Render the HTML of an email message the way its preview email is rendered. Nothing is sent. The accepted variable fields are the same as for previews - campaigns accept `contactProperties`, workflows accept `contactProperties` and `eventProperties`, and transactional emails accept `dataVariables`. A variable without a value uses its fallback, or shows a missing-value marker as in a preview email. Supplying a field the parent cannot reference is rejected with 400.

## Request body

- EmailMessageRenderRequest
  - `contactProperties` object: Contact property values to render. Accepted for campaign and workflow emails.
  - `eventProperties` object: Event property values to render. Accepted for workflow emails only.
  - `dataVariables` object: Transactional data variables to render. Accepted for transactional emails only.

## Response `200`

Rendered email message.

- EmailMessageRenderResponse
  - `html` string, required: The rendered HTML. For emails made in the editor, it includes the rendered subject in `<title>` and the rendered preview text.

## Other responses

- `400`: Invalid request body, a variable field the parent cannot reference, a sending domain without a domain or address, or a from or reply-to address that renders to an invalid email.
- `401`: Invalid API key or content API not enabled for this team.
- `404`: Email message not found.
- `405`: Wrong HTTP request method.

## Changes

> 16 revisions in range; 2 not diffed.

- **2026-11-05** `c2713626c6fc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/loops/apis/loops-openapi-spec/changes/v1/email-messages/:emailMessageId/render/post.md)

---

[API](https://skmtc.dev/loops/apis/loops-openapi-spec.md) - [All operations](https://skmtc.dev/loops/apis/loops-openapi-spec/llms.txt) - [OpenAPI document](https://skmtc.dev/loops/apis/loops-openapi-spec/revisions/c2713626c6fc?raw)
