Skip to main content

Email templates v2 API

Download OpenAPI (YAML)Version v2

Base URL: https://localhost:9443/t/carbon.super/o/api/server/v2

The WSO2 Identity Server - Email Template API (version v2).

Download the OpenAPI definition (YAML)

Security schemes​

OAuth2: oauth2

authorizationCode flow, token URL https://localhost:9443/oauth2/token, authorization URL https://localhost:9443/oauth2/authorize

4 scopes
ScopeDescription
viewinternal_org_email_mgt_view
createinternal_org_email_mgt_create
updateinternal_org_email_mgt_update
deleteinternal_org_email_mgt_delete

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_org_email_mgt_view

Parameters

NameInTypeRequiredDescription
limitqueryinteger (int32)

Maximum number of records to return. This option is not yet supported.

offsetqueryinteger (int32)

Number of records to skip for pagination. This option is not yet supported.

sortOrderquerystring

Define the order in which the retrieved records should be sorted. This option is not yet supported.

Allowed values: asc, desc

sortByquerystring

Attribute by which the retrieved records should be sorted. This option is not yet supported.

Responses

CodeDescriptionSchema
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_org_email_mgt_create

Request body: application/json

Email template type to be added.

Schema: EmailTemplateTypeOverview

2 properties
NameTypeRequiredDescription
displayNamestringYes

Display name of the email template type.

templatesarray of EmailTemplate

Responses

CodeDescriptionSchema
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_org_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

Responses

CodeDescriptionSchema
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_org_email_mgt_delete

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

Responses

CodeDescriptionSchema
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_org_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

limitqueryinteger (int32)

Maximum number of records to return. This option is not yet supported.

offsetqueryinteger (int32)

Number of records to skip for pagination. This option is not yet supported.

sortOrderquerystring

Define the order in which the retrieved records should be sorted. This option is not yet supported.

Allowed values: asc, desc

sortByquerystring

Attribute by which the retrieved records should be sorted. This option is not yet supported.

Responses

CodeDescriptionSchema
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_org_email_mgt_create

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

Request body: application/json

Email template to be added.

Schema: EmailTemplateWithID

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body of the email.

footerstring

The footer of the email.

Responses

CodeDescriptionSchema
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_org_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

localepathstringYes

This should be a valid locale.

limitqueryinteger (int32)

Maximum number of records to return. This option is not yet supported.

offsetqueryinteger (int32)

Number of records to skip for pagination. This option is not yet supported.

sortOrderquerystring

Define the order in which the retrieved records should be sorted. This option is not yet supported.

Allowed values: asc, desc

sortByquerystring

Attribute by which the retrieved records should be sorted. This option is not yet supported.

Responses

CodeDescriptionSchema
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_org_email_mgt_update

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

localepathstringYes

This should be a valid locale.

Request body: application/json

Email templates for the template type.

Schema: EmailTemplateWithID

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body of the email.

footerstring

The footer of the email.

Responses

CodeDescriptionSchema
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_org_email_mgt_delete

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

localepathstringYes

This should be a valid locale.

Responses

CodeDescriptionSchema
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_org_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

app-uuidpathstringYes

Application UUID.

resolvequeryboolean

Specifies whether to return resolved template/s throughout the ancestor organization hierarchy.

Default: false

limitqueryinteger (int32)

Maximum number of records to return. This option is not yet supported.

offsetqueryinteger (int32)

Number of records to skip for pagination. This option is not yet supported.

sortOrderquerystring

Define the order in which the retrieved records should be sorted. This option is not yet supported.

Allowed values: asc, desc

sortByquerystring

Attribute by which the retrieved records should be sorted. This option is not yet supported.

Responses

CodeDescriptionSchema
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_org_email_mgt_create

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

app-uuidpathstringYes

Application UUID.

Request body: application/json

Email template to be added.

Schema: EmailTemplateWithID

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body of the email.

footerstring

The footer of the email.

Responses

CodeDescriptionSchema
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_org_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

app-uuidpathstringYes

Application UUID.

localepathstringYes

This should be a valid locale.

resolvequeryboolean

Specifies whether to return resolved template/s throughout the ancestor organization hierarchy.

Default: false

limitqueryinteger (int32)

Maximum number of records to return. This option is not yet supported.

offsetqueryinteger (int32)

Number of records to skip for pagination. This option is not yet supported.

sortOrderquerystring

Define the order in which the retrieved records should be sorted. This option is not yet supported.

Allowed values: asc, desc

sortByquerystring

Attribute by which the retrieved records should be sorted. This option is not yet supported.

Responses

CodeDescriptionSchema
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_org_email_mgt_update

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

app-uuidpathstringYes

Application UUID.

localepathstringYes

This should be a valid locale.

Request body: application/json

Email templates for the template type.

Schema: EmailTemplateWithID

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body of the email.

footerstring

The footer of the email.

Responses

CodeDescriptionSchema
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_org_email_mgt_delete

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

Email Template Type ID.

app-uuidpathstringYes

Application UUID.

localepathstringYes

This should be a valid locale.

Responses

CodeDescriptionSchema
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
NameTypeRequiredDescription
displayNamestringYes

Display name of the email template type.

selfstringYes

Location of the created/updated resource.

EmailTemplateTypeOverview​

Type: object

2 properties
NameTypeRequiredDescription
displayNamestringYes

Display name of the email template type.

templatesarray of EmailTemplate

EmailTemplateTypeWithID​

Type: EmailTemplateType

3 properties
NameTypeRequiredDescription
displayNamestringYes

Display name of the email template type.

selfstringYes

Location of the created/updated resource.

idstringYes

Unique ID of the email template type.

EmailTemplateWithID​

Type: EmailTemplate

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body of the email.

footerstring

The footer of the email.

EmailTemplate​

Type: object

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body of the email.

footerstring

The footer of the email.

SimpleEmailTemplate​

Type: object

2 properties
NameTypeRequiredDescription
localestringYes

Locale of the email template.

selfstringYes

Location of the created/updated resource.

Error​

Type: object

4 properties
NameTypeRequiredDescription
codestringYes
messagestringYes
descriptionstring
traceIdstring

Was this page helpful?