---
title: "Add or update template"
method: POST
path: "/resources/mail/v1/configs/templates"
tags: ["Email templates"]
---

# Add or update template

`POST /resources/mail/v1/configs/templates`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/mail/v1/configs/templates`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/mail/v1/configs/templates/post.ts> (a function with typed inputs; its response is checked against the schema)

This route creates or updates an email template. Select the email template using the type. The type value needs to be the name of one of the Frontegg email templates. See the dropdown for available values. Also, set the sender using senderEmail. Optionally, include values for the other available body params. Send the information for the template in the POST body. A vendor token is required for this route, it can be obtained from the vendor authentication route.

## Request body

- CreateTemplateDto
  - `type` 'ResetPassword' | 'ActivateUser' | 'InviteToTenant' | 'PwnedPassword' | 'MagicLink' | 'OTC' | 'ConnectNewDevice' | 'UserUsedInvitation' | 'ResetPhoneNumber' | 'BulkInvitesToTenant' | 'MFAEnroll' | 'MFAUnenroll' | 'NewMFAMethod' | 'MFARecoveryCode' | 'RemoveMFAMethod' | 'EmailVerification' | 'BruteForceProtection' | 'SuspiciousIP' | 'MFAOTC' | 'ImpossibleTravel' | 'BotDetection' | 'SmsAuthenticationEnabled' | 'UnlockUser' | 'UnlockUserSuccess' | 'ActivateUserWithCode' | 'InviteToTenantWithCode', required
  - `senderEmail` string
  - `redirectURL` string: Only required for: ResetPassword, ActivateUser, InviteToTenant, MagicLink, BulkInvitesToTenant
  - `htmlTemplate` string
  - `subject` string
  - `fromName` string
  - `successRedirectUrl` string
  - `active` boolean

## Response `201`

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
