Email templates v2 API
The WSO2 Identity Server - Email Template API (version v2).
Download the OpenAPI definition (YAML)
Security schemes
BasicAuth: HTTP basic
OAuth2: oauth2
authorizationCode flow, token URL https://localhost:9443/oauth2/token, authorization URL https://localhost:9443/oauth2/authorize
Email Template Types
An email template type can have multiple email templates for different languages.
Retrieves all the email template types.
GET /email/template-types
Retrieves all the email template types in the system.
Scope(Permission) required: internal_email_mgt_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer (int32) | Maximum number of records to return. This option is not yet supported. | |
offset | query | integer (int32) | Number of records to skip for pagination. This option is not yet supported. | |
sortOrder | query | string | Define the order in which the retrieved records should be sorted. This option is not yet supported. Allowed values: | |
sortBy | query | string | Attribute by which the retrieved records should be sorted. This option is not yet supported. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Search results matching the given criteria. | array of EmailTemplateType |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
500 | Internal Server Error. | Error |
Adds a new email template type.
POST /email/template-types
Adds a new email template type to the system. An email template type can have any number of
organization or application email templates.
- Attribute displayName of the template type should be unique.
Scope(Permission) required: internal_email_mgt_create
Request body: application/json
Email template type to be added.
Schema: EmailTemplateTypeOverview
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Display name of the email template type. |
templates | array of EmailTemplate |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Item Created | EmailTemplateType |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
409 | Item Already Exists. | Error |
500 | Internal Server Error. | Error |
Retrieves the email template type corresponding to the template type id.
GET /email/template-types/{template-type-id}
Retrieves the email template type in the system identified by the template-type-id.
Scope(Permission) required: internal_email_mgt_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Search results matching the given criteria. | EmailTemplateTypeWithID |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Removes an email template type.
DEL /email/template-types/{template-type-id}
Removes an existing email template type with all its email templates
from the system.
Scope(Permission) required: internal_email_mgt_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Item Deleted. | |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Email Templates
An email template of a specific type and a language.
Retrieves the list of email templates in the template type id.
GET /email/template-types/{template-type-id}/org-templates
Retrieves the list of email templates in the template type id.
Scope(Permission) required: internal_email_mgt_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
limit | query | integer (int32) | Maximum number of records to return. This option is not yet supported. | |
offset | query | integer (int32) | Number of records to skip for pagination. This option is not yet supported. | |
sortOrder | query | string | Define the order in which the retrieved records should be sorted. This option is not yet supported. Allowed values: | |
sortBy | query | string | Attribute by which the retrieved records should be sorted. This option is not yet supported. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Search results matching the given criteria. | array of SimpleEmailTemplate |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Adds a new email template to an existing email template type.
POST /email/template-types/{template-type-id}/org-templates
Another email template with the same locale should not already exist in the
respective email template type.
Scope(Permission) required: internal_email_mgt_create
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
Request body: application/json
Email template to be added.
Schema: EmailTemplateWithID
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
contentType | string | Yes | Content type of the email template. |
subject | string | Yes | The subject of the email. |
body | string | Yes | The body of the email. |
footer | string | The footer of the email. |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Item Created | SimpleEmailTemplate |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
409 | Item Already Exists. | Error |
500 | Internal Server Error. | Error |
Retrieves a single email template.
GET /email/template-types/{template-type-id}/org-templates/{locale}
Retrieves the email template that matches to the template-type-id and the locale.
Scope(Permission) required: internal_email_mgt_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
locale | path | string | Yes | This should be a valid locale. |
limit | query | integer (int32) | Maximum number of records to return. This option is not yet supported. | |
offset | query | integer (int32) | Number of records to skip for pagination. This option is not yet supported. | |
sortOrder | query | string | Define the order in which the retrieved records should be sorted. This option is not yet supported. Allowed values: | |
sortBy | query | string | Attribute by which the retrieved records should be sorted. This option is not yet supported. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Search results matching the given criteria. | EmailTemplateWithID |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Replaces an existing email template.
PUT /email/template-types/{template-type-id}/org-templates/{locale}
Replaces the email template identified by the template-type-id and the locale.
Scope(Permission) required: internal_email_mgt_update
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
locale | path | string | Yes | This should be a valid locale. |
Request body: application/json
Email templates for the template type.
Schema: EmailTemplateWithID
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
contentType | string | Yes | Content type of the email template. |
subject | string | Yes | The subject of the email. |
body | string | Yes | The body of the email. |
footer | string | The footer of the email. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Item Updated. | |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Removes an email template.
DEL /email/template-types/{template-type-id}/org-templates/{locale}
Removes an email template identified by the template-type-id and the locale.
Scope(Permission) required: internal_email_mgt_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
locale | path | string | Yes | This should be a valid locale. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Item Deleted. | |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Application Email Templates
An application-specific email template of a specific type and a language.
Application-specific email templates are triggered whenever the user interacts with applications that use the default WSO2 Identity Server UI. However, if the user interacts directly with APIs, application-specific email templates are supported by the following APIs:
- User creation with SCIM2 APIs
- Locking/Unlocking accounts with SCIM2 APIs
- Password recovery API V2
- Email verification flows
- Resend email flows
Note: To ensure application-specific branding is applied during the above API interactions, they must be invoked using an access token issued specifically for the application. If an access token generated from admin credentials is used instead, the branding will default to organization-specific settings.
Retrieves the list of application email templates in the template type id.
GET /email/template-types/{template-type-id}/app-templates/{app-uuid}
Retrieves the list of application email templates in the template type id.
Scope(Permission) required: internal_email_mgt_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
app-uuid | path | string | Yes | Application UUID. |
resolve | query | boolean | Specifies whether to return resolved template/s throughout the ancestor organization hierarchy. Default: | |
limit | query | integer (int32) | Maximum number of records to return. This option is not yet supported. | |
offset | query | integer (int32) | Number of records to skip for pagination. This option is not yet supported. | |
sortOrder | query | string | Define the order in which the retrieved records should be sorted. This option is not yet supported. Allowed values: | |
sortBy | query | string | Attribute by which the retrieved records should be sorted. This option is not yet supported. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Search results matching the given criteria. | array of SimpleEmailTemplate |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Adds a new application email template to an existing email template type.
POST /email/template-types/{template-type-id}/app-templates/{app-uuid}
Another application email template with the same locale should not already exist in the
respective email template type.
Scope(Permission) required: internal_email_mgt_create
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
app-uuid | path | string | Yes | Application UUID. |
Request body: application/json
Email template to be added.
Schema: EmailTemplateWithID
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
contentType | string | Yes | Content type of the email template. |
subject | string | Yes | The subject of the email. |
body | string | Yes | The body of the email. |
footer | string | The footer of the email. |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Item Created | SimpleEmailTemplate |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
409 | Item Already Exists. | Error |
500 | Internal Server Error. | Error |
Retrieves a single email template of application.
GET /email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}
Retrieves the application email template that matches to the template-type-id and the locale.
Scope(Permission) required: internal_email_mgt_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
app-uuid | path | string | Yes | Application UUID. |
locale | path | string | Yes | This should be a valid locale. |
resolve | query | boolean | Specifies whether to return resolved template/s throughout the ancestor organization hierarchy. Default: | |
limit | query | integer (int32) | Maximum number of records to return. This option is not yet supported. | |
offset | query | integer (int32) | Number of records to skip for pagination. This option is not yet supported. | |
sortOrder | query | string | Define the order in which the retrieved records should be sorted. This option is not yet supported. Allowed values: | |
sortBy | query | string | Attribute by which the retrieved records should be sorted. This option is not yet supported. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Search results matching the given criteria. | EmailTemplateWithID |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Replaces an existing application email template.
PUT /email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}
Replaces the application email template identified by the template-type-id and the locale.
Scope(Permission) required: internal_email_mgt_update
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
app-uuid | path | string | Yes | Application UUID. |
locale | path | string | Yes | This should be a valid locale. |
Request body: application/json
Email templates for the template type.
Schema: EmailTemplateWithID
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
contentType | string | Yes | Content type of the email template. |
subject | string | Yes | The subject of the email. |
body | string | Yes | The body of the email. |
footer | string | The footer of the email. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Item Updated. | |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Removes an email template.
DEL /email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}
Removes an email template identified by the template-type-id and the locale.
Scope(Permission) required: internal_email_mgt_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template-type-id | path | string | Yes | Email Template Type ID. |
app-uuid | path | string | Yes | Application UUID. |
locale | path | string | Yes | This should be a valid locale. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Item Deleted. | |
400 | Invalid input request. | Error |
401 | Unauthorized. | |
403 | Forbidden. | |
404 | The specified resource is not found. | Error |
500 | Internal Server Error. | Error |
Schemas
EmailTemplateType
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Display name of the email template type. |
self | string | Yes | Location of the created/updated resource. |
EmailTemplateTypeOverview
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Display name of the email template type. |
templates | array of EmailTemplate |
EmailTemplateTypeWithID
Type: EmailTemplateType
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Display name of the email template type. |
self | string | Yes | Location of the created/updated resource. |
id | string | Yes | Unique ID of the email template type. |
EmailTemplateWithID
Type: EmailTemplate
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
contentType | string | Yes | Content type of the email template. |
subject | string | Yes | The subject of the email. |
body | string | Yes | The body of the email. |
footer | string | The footer of the email. |
EmailTemplate
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
contentType | string | Yes | Content type of the email template. |
subject | string | Yes | The subject of the email. |
body | string | Yes | The body of the email. |
footer | string | The footer of the email. |
SimpleEmailTemplate
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
locale | string | Yes | Locale of the email template. |
self | string | Yes | Location of the created/updated resource. |
Error
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | |
message | string | Yes | |
description | string | ||
traceId | string |
Was this page helpful?