---
title: "Render template as HTML"
method: POST
path: "/v3/grants/{grant_id}/templates/render"
tags: ["Grant-level templates"]
---

# Render template as HTML

`POST /v3/grants/{grant_id}/templates/render`

Renders the HTML content of a grant-level template using the provided variables and specified
templating engine.

## Request body

- object
  - `body` string, required — The body content of the template, in HTML format.
  - `engine` 'handlebars' | 'mustache' | 'nunjucks' | 'twig', required — The templating engine to use.
  - `strict` boolean — When `true`, Nylas returns an error if the template contains variables that aren't defined in the `variables` object.
  - `variables` object, required — A set of key/value pairs representing variables to substitute for values in the template.

## Response `200`

Success. Returns rendered HTML.

- object
  - `request_id` string, required — The ID of the request.
  - `data` object, required
    - `body` string, required — The rendered HTML with variables substituted.

## Other responses

- `400` — Error: Bad request

---

[API](https://skmtc.dev/nylas/apis/nylas-api.md) · [All operations](https://skmtc.dev/nylas/apis/nylas-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nylas/nylas-api/revisions/51c2c1b4ecff/schema)
