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

# Update an email template

`PATCH /email-templates/{id}`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/email-templates/{id}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `messages:write`)

Changes only the fields you send. Emails that are scheduled with this template use the new version when they go out.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `name` string
  - `subject` string
  - `html` string, nullable
  - `text` string, nullable
  - `style` 'site' | 'none'
  - `site_id` string, uuid, nullable

## Response `200`

The updated template.

- object
  - `id` string, uuid, required
  - `name` string, required
  - `subject` string, required
  - `html` string, nullable, required
  - `text` string, nullable, required
  - `style` 'site' | 'none', required: site: the name, logo and colors of the project's site around the email. none: sent as it is.
  - `site_id` string, uuid, nullable, required
  - `variables` string[], required: The variables in the subject and content, like name or order_number.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Bad Request: invalid_json.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `409`: Conflict: conflict.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
