---
title: "Create an email template"
method: POST
path: "/businesses/{id}/email_templates"
tags: ["Email templates"]
---

# Create an email template

`POST /businesses/{id}/email_templates`

## Path parameters

- `id` string, required

## Request body

- union
  - object
    - `name` string, required — The name of the email template
    - `subject` string, required — The subject of the email template. Variables are supported via `{{ variableName }}`
    - `attachments` object[] — An array of attachments that will always be sent with this template
      - `content` string, required — The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'
      - `name` string, required — The intended name of the attachment
    - `one_off` boolean — Whether this is a one off email template
    - `metadata` object — The metadata of the email template
    - `kind` 'editor' | 'old_editor' — The kind of the email template
    - `template_json` unknown, required
  - object
    - `name` string, required — The name of the email template
    - `subject` string, required — The subject of the email template. Variables are supported via `{{ variableName }}`
    - `attachments` object[] — An array of attachments that will always be sent with this template
      - `content` string, required — The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'
      - `name` string, required — The intended name of the attachment
    - `one_off` boolean — Whether this is a one off email template
    - `metadata` object — The metadata of the email template
    - `kind` 'unlayer' — The kind of the email template
  - object
    - `name` string, required — The name of the email template
    - `subject` string, required — The subject of the email template
    - `attachments` object[] — An array of attachments that will always be sent with this template
      - `content` string, required — The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'
      - `name` string, required — The intended name of the attachment
    - `one_off` boolean — Whether this is a one off email template
    - `metadata` object — The metadata of the email template
    - `kind` 'unlayer' — The kind of the email template
    - `new_template_json` unknown, required
    - `new_template_html` string, required — The HTML representation of the rich text email template
  - object
    - `name` string, required — The name of the email template
    - `subject` string, required — The subject of the email template. Variables are supported via `{{ variableName }}`
    - `attachments` object[] — An array of attachments that will always be sent with this template
      - `content` string, required — The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'
      - `name` string, required — The intended name of the attachment
    - `one_off` boolean — Whether this is a one off email template
    - `metadata` object — The metadata of the email template
    - `kind` 'html' — The kind of the email template
    - `template_html` string, required — The HTML representing the email template

## Response `200`

The created `EmailTemplate` object

- EmailTemplate
  - `id` string, required — The ID of the email template
  - `name` string, required — The name of the email template
  - `subject` string, required — The subject of the email template. Variables are supported via `{{ variableName }}`
  - `body` string, nullable, required — (Deprecated) The body of the email template. Always `null` since there are no plaintext emails
  - `kind` 'html' | 'unlayer' | 'old_editor' | 'editor', required — The kind of the email template
  - `template_html` string, nullable, required — The HTML representation of the rich text email. May be null
  - `template_json` unknown, required
  - `new_template_json` unknown, required
  - `new_template_html` string, nullable, required — The new unlayer HTML template. May be null
  - `attachments` object[], required — An array of attachments associated with the email template
    - `id` string, required — The ID of the attachment
    - `name` string, required — The name of the attachment
  - `metadata` object, required — Arbitrary metadata associated with this email template
  - `created_at` string, required — The time when the email template was created in ISO 8601 format
  - `enabled_at` string, nullable — The time when the email template was enabled in ISO 8601 format

---

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