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

# Update an email template

`POST /email_templates/{id}`

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string — The name of the email template
  - `subject` string — The subject of the email template. Variables are supported via `{{ variableName }}`
  - `body` string — The plaintext version of the body of the email template. Variables are supported via `{{ variableName }}`
  - `template_html` string — The HTML representation of the email template. Mutually exclusive with plain text email templates.
  - `template_json` object — The JSON representation of the email template. This will override the `name`, `subject`, and `body` properties
  - `new_template_json` object — The JSON representing the rich text email template. Mutually exclusive with plain text email templates
  - `new_template_html` string — The HTML representation of the rich text email template. Mutually exclusive with plain text email templates
  - `attachments` union[] — An array of existing attachment IDs or new attachments that will always be sent with this template
    - union
      - string
      - object
        - `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
  - `kind` 'unlayer' | 'editor' | 'old_editor' | 'html' — The kind of the email template
  - `metadata` object — The metadata for the email template

## Response `200`

The updated `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)
