---
title: "Create a template"
method: POST
path: "/v3/templates"
tags: ["Application-level templates"]
---

# Create a template

`POST /v3/templates`

Creates an application-level template.

## Request body

- object
  - `body` string, required — The body content of the template, in HTML format.
  - `engine` 'handlebars' | 'mustache' | 'nunjucks' | 'twig' — The templating engine to use.
  - `name` string, required — The name of the template.
  - `subject` string, required — The subject line of the template.

## Response `200`

Success. Returns template.

- object
  - `request_id` string, required — The ID of the request.
  - `data` Template, required — A custom message template.
    - `app_id` string, nullable — The ID of the Nylas application associated with the template. Returned only if the template is configured at the application level.
    - `body` string, required — The body content of the template, in HTML format.
    - `created_at` integer, required — When the template was created, in seconds using the Unix timestamp format.
    - `engine` 'handlebars' | 'mustache' | 'nunjucks' | 'twig', required — The templating engine.
    - `grant_id` string, nullable — The ID of the grant associated with the template. Returned only if the template is configured at the grant level.
    - `id` string, required — The template ID.
    - `name` string, required — The name of the template.
    - `object` string, required — The object type identifier.
    - `subject` string, required — The subject line of the template.
    - `updated_at` integer, required — When the template was last updated, in seconds using the Unix timestamp format.

## 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)
