# Render a template

> **POST** `https://api.us.nylas.com/v3/grants/{grant_id}/templates/{template_id}/render`

Source: https://developer.nylas.com/docs/reference/api/grant-level-templates/render-grant-level-template/

Renders the specified application-level template with the provided variables.

**Authentication:** NYLAS_API_KEY, ACCESS_TOKEN

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `grant_id` | string | Yes | ID of the grant to access. You can also use the email address associated with the grant, or use `/me/` to refer to the grant associated with an access token. |
| `template_id` | string | Yes | The ID of the template to access. |

## Request body

Content-Type: application/json

- `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.

## Responses

### 200 - Success. Returns rendered template.

- `request_id` (string) **(required)** - The ID of the request.
- `data` (object) **(required)**
  - `body` (string) **(required)** - The rendered HTML body content with variables substituted.
  - `subject` (string) **(required)** - The rendered subject content with variables substituted.

### 400 - Error: Bad request



## Code samples

### cURL

```bash
curl --request POST \
  --url "https://api.us.nylas.com/v3/grants/<NYLAS_GRANT_ID>/templates/<TEMPLATE_ID>/render" \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "variables": {
      "user": {
        "name": "Nylas",
        "surname": "Tester"
      }
    }
  }'
```
