---
title: "Replace email templates"
method: PUT
path: "/api/email-templates"
tags: ["Email templates"]
---

# Replace email templates

`PUT /api/email-templates`

Create or replace a list of email templates. If an email template with the same language tag and template type already exists, its details will be updated.

## Request body

- object
  - `templates` object[], required
    - `languageTag` string, required — The language tag of the email template, e.g., `en` or `fr`.
    - `templateType` 'SignIn' | 'Register' | 'ForgotPassword' | 'OrganizationInvitation' | 'Generic' | 'UserPermissionValidation' | 'BindNewIdentifier' | 'MfaVerification' | 'BindMfa', required — The type of the email template, e.g. `SignIn` or `ForgotPassword`
    - `details` object, required — The details of the email template.
      - `subject` string, required — The template of the email subject.
      - `content` string, required — The template of the email body.
      - `contentType` union — The content type of the email body. (Only required by some specific email providers.)
        - string, "text/html"
        - string, "text/plain"
      - `replyTo` string — The reply name template of the email. If not provided, the target email address will be used. (The render logic may differ based on the email provider.)
      - `sendFrom` string — The send from name template of the email. If not provided, the default Logto email address will be used. (The render logic may differ based on the email provider.)

## Response `200`

The list of newly created or replaced email templates.

- object[]
  - `tenantId` string, required
  - `id` string, required
  - `languageTag` string, required
  - `templateType` 'SignIn' | 'Register' | 'ForgotPassword' | 'OrganizationInvitation' | 'Generic' | 'UserPermissionValidation' | 'BindNewIdentifier' | 'MfaVerification' | 'BindMfa', required
  - `details` object, required
    - `subject` string, required
    - `content` string, required
    - `contentType` union
      - string, "text/html"
      - string, "text/plain"
    - `replyTo` string
    - `sendFrom` string
  - `createdAt` number, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — Unprocessable Content

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
