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.

application/json

Body Required

  • templates array[object] Required
    Hide templates attributes Show templates attributes object
    • languageTag string Required

      The language tag of the email template, e.g., en or fr.

      Minimum length is 1, maximum length is 16.

    • templateType string Required

      The type of the email template, e.g. SignIn or ForgotPassword

      Values are SignIn, Register, ForgotPassword, OrganizationInvitation, Generic, UserPermissionValidation, or BindNewIdentifier.

    • details object Required

      The details of the email template.

      Additional properties are allowed.

      Hide details attributes Show details attributes object
      • subject string Required

        The template of the email subject.

      • content string Required

        The template of the email body.

      • contentType string("text/html") | string("text/plain")

        The content type of the email body. (Only required by some specific email providers.)

      • 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.)

Responses

PUT /api/email-templates
curl \
 --request PUT https://[tenant_id].logto.app/api/email-templates \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"templates":[{"languageTag":"string","templateType":"SignIn","details":{"subject":"string","content":"string","contentType":"string","replyTo":"string","sendFrom":"string"}}]}'
Request examples
{
  "templates": [
    {
      "languageTag": "string",
      "templateType": "SignIn",
      "details": {
        "subject": "string",
        "content": "string",
        "contentType": "string",
        "replyTo": "string",
        "sendFrom": "string"
      }
    }
  ]
}
Response examples (200)
[
  {
    "tenantId": "string",
    "id": "string",
    "languageTag": "string",
    "templateType": "SignIn",
    "details": {
      "subject": "string",
      "content": "string",
      "contentType": "string",
      "replyTo": "string",
      "sendFrom": "string"
    },
    "createdAt": 42.0
  }
]