Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Email templates API

Download OpenAPI (YAML)Version v1

Base URL: https://api.asgardeo.io/t/<ORG_NAME>/api/server/v1

The WSO2 Identity Platform - Email Templates API (version v1).

Download the OpenAPI definition (YAML)

Security schemes​

OAuth2: oauth2

clientCredentials flow, token URL https://api.asgardeo.io/t/{org-name}/oauth2/token

4 scopes
ScopeDescription
internal_email_mgt_viewGrants read access
internal_email_mgt_createGrants write access
internal_email_mgt_deleteGrants permission to delete records
internal_email_mgt_updateGrants permission to update existing records

Email template types​

An email template type can have multiple email templates for different languages.

Get email template types​

GET /email/template-types

Retrieves all the email template types in your organization, with limited details of the email templates.

Scopes required: internal_email_mgt_view

Parameters

NameInTypeRequiredDescription
requiredAttributesquerystring

Specifies the required parameters in the response. See the response schema for the complete list of parameters your can get in the response. </br></br> By default, all the required parameters (in the response schema) will be returned. Use this parameter to specify additional attributes that you need in the response.

Responses

CodeDescriptionSchema
200

Results matching the request criteria

array of EmailTemplateTypeWithoutTemplates
400

Invalid input request

Error
401

Unauthorized

403

Forbidden

500

Internal Server Error

Error

Add email template type​

POST /email/template-types

Adds a new email template type to your organization. An email template type can have any number of email templates.

  • Note that the displayName attribute of the template type should be unique.

Scopes required: internal_email_mgt_create

Request body: application/json

Use the following parameters in your request body to define your new email template type.

Schema: EmailTemplateType

2 properties
NameTypeRequiredDescription
displayNamestringYes

The unique display name of the email template type.

templatesarray of EmailTemplateWithIDYes

Email templates for the template type.

Responses

CodeDescriptionSchema
201

Item Created

EmailTemplateTypeWithoutTemplates
400

Invalid input request

Error
401

Unauthorized

403

Forbidden

409

Item Already Exists

Error
500

Internal Server Error

Error

Remove email template type​

DEL /email/template-types/{template-type-id}

Removes an existing email template type with all its email templates from your organization.

Scopes required: internal_email_mgt_delete

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

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 language.

Get email templates per type​

GET /email/template-types/{template-type-id}

Retrieves an email template type (matching the template type ID) including all of its email templates.


Scopes required: internal_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

Responses

CodeDescriptionSchema
200

Results matching the request criteria

EmailTemplateTypeWithID
400

Invalid input request

Error
401

Unauthorized

403

Forbidden

404

The specified resource is not found

Error
500

Internal Server Error

Error

Replace all email templates​

PUT /email/template-types/{template-type-id}

Replaces all the email templates of the respective email template type with the newly provided email templates.

Scopes required: internal_email_mgt_update

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

Request body: application/json

Use the following parameters in your request body. These parameter values will replace all the content in all the existing templates for the template type.

Schema: array of EmailTemplateWithID

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

Add email template​

POST /email/template-types/{template-type-id}

Adds a new email template to a template type. Note that the template ID is the locale and it be unique for the template type. You cannot have two templates with the same locale for a template type.

Scopes required:
internal_email_mgt_create

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

Request body: application/json

Use the following parameters in your request body to define your new email template type.

Schema: EmailTemplateWithID

5 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body (HTML) of the email.

footerstringYes

The footer of the email.

idstringYes

Unique ID of the email template. This ID represents the locale of the email template.

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

List email templates per type​

GET /email/template-types/{template-type-id}/templates

Retrieves the list of email templates for the template type ID.

Scopes required: internal_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

Responses

CodeDescriptionSchema
200

Results matching the request 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

Get an email template​

GET /email/template-types/{template-type-id}/templates/{template-id}

Retrieves the email template that matches the specified template ID and template type.

Scopes required: internal_email_mgt_view

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

template-idpathstringYes

Email template ID. This should be a valid locale.

Responses

CodeDescriptionSchema
200

Results matching the request criteria

EmailTemplateWithID
400

Invalid input request

Error
401

Unauthorized

403

Forbidden

404

The specified resource is not found

Error
500

Internal Server Error

Error

Replace an email template​

PUT /email/template-types/{template-type-id}/templates/{template-id}

Replaces the email template identified by the template ID and template type.

Scopes required: internal_email_mgt_update

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

template-idpathstringYes

Email template ID. This should be a valid locale.

Request body: application/json

Email templates for the template type

Schema: EmailTemplateWithID

5 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body (HTML) of the email.

footerstringYes

The footer of the email.

idstringYes

Unique ID of the email template. This ID represents the locale of the email template.

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

Remove email template​

DEL /email/template-types/{template-type-id}/templates/{template-id}

Removes an email template identified by the template ID and template type.

Scopes required: internal_email_mgt_delete

Parameters

NameInTypeRequiredDescription
template-type-idpathstringYes

The ID of the email template type.

template-idpathstringYes

Email template ID. 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​

EmailTemplateTypeWithoutTemplates​

Type: object

4 properties
NameTypeRequiredDescription
idstringYes

Unique ID of the email template type.

displayNamestringYes

Display name of the email template type.

templatesarray of EmailTemplateWithID

Email templates for the template type. This is the HTML template of the email body.

selfstringYes

Location of the created/updated resource.

EmailTemplateType​

Type: object

2 properties
NameTypeRequiredDescription
displayNamestringYes

The unique display name of the email template type.

templatesarray of EmailTemplateWithIDYes

Email templates for the template type.

EmailTemplateTypeWithID​

Type: EmailTemplateType

3 properties
NameTypeRequiredDescription
displayNamestringYes

The unique display name of the email template type.

templatesarray of EmailTemplateWithIDYes

Email templates for the template type.

idstringYes

Unique ID of the email template type.

EmailTemplate​

Type: object

4 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body (HTML) of the email.

footerstringYes

The footer of the email.

EmailTemplateWithID​

Type: EmailTemplate

5 properties
NameTypeRequiredDescription
contentTypestringYes

Content type of the email template.

subjectstringYes

The subject of the email.

bodystringYes

The body (HTML) of the email.

footerstringYes

The footer of the email.

idstringYes

Unique ID of the email template. This ID represents the locale of the email template.

SimpleEmailTemplate​

Type: object

2 properties
NameTypeRequiredDescription
idstringYes

Unique ID of the email template. This ID represents the 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?