Email notification templates

Use these methods to manage email notification templates configured in the Back Office. Such templates are used to deliver email notifications about the occurred events to clients and Back Office users.

GET[host]/v2/mails/notifications/templates

Get a list of email notification templates

GET[host]v2/mails/notifications/templates/{templateId}

Get email notification template details

POST[host]/v2/mails/notifications/templates

Create a new email notification template

PATCH[host]v2/mails/notifications/templates/{templateId}

Update an email notification template

DELETE[host]v2/mails/notifications/templates/{templateId}

Delete an email notification template

GET[host]/v2/mails/notifications/types

Get a list of notification types

GET[host]v2/mails/notifications/types/{typeId}

Get notification type details

POST[host]/v2/mails/notifications/types

Create a new notification type

PATCH[host]v2/mails/notifications/types/{typeId}

Update a notification type

DELETE[host]v2/mails/notifications/types/{typeId}

Delete a notification type

Get a list of email notification templates

Use this method to obtain a list of email notification templates created in the Back Office.

To obtain detailed information about a specific email notification template, use a separate method to get email notification template details.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

The following filter parameters are available for this method:

typeId

The identifier of a notification type for which the template is used.

locale

The locale identifier (such as en_US).

subject

The email subject.

isEnabled

If true, the result includes only the enabled templates; otherwise , false.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/mails/notifications/templates

curl --location -g --request GET 'https://host.name/api/v2/mails/notifications/templates?limit=10&offset=0&sort_order=desc&filter[name]=%3Cstring%3E&filter[caption]=%3Cstring%3E&filter[isEnabled]=0&sort_by=name' \
--header 'Authorization: Bearer <token>'

Response

The response includes an array of Email Notification Template objects providing the information about the templates matching the request parameters.

Get email notification template details

Use this method to obtain detailed information about a specified email notification template.

To obtain a list of all email notification templates created in the Back Office, use a separate method to get a list of email notification templates.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

templateId integer required

The identifier of an email notification template.

GET[host]/v2/mails/notifications/templates/{templateId}

curl --location --request GET 'https://host.name/api/v2/mails/notifications/templates/:templateId' \
--header 'Authorization: Bearer <token>'

Response

The response includes an Email Notification Template object providing the information about the specified template.

Create a new email notification template

Use this method to create a new email notification template.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for an email notification template:

typeId integer required

The identifier of a notification type for which the template is used.

locale string

The locale identifier (such as en_US).

extendsId integer

The type of an email template. Possible values:

  • mails

  • notifications

  • types

isEnabled boolean

If true, the email notification template is enabled and can be used to deliver notifications; otherwise, false.

subject string

The email subject.

template string

The content of the email template, in HTML format.

POST[host]/v2/mails/notifications/templates

curl --location --request POST 'https://host.name/api/v2/mails/notifications/templates' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "typeId": 1,
  "locale": "en_US",
  "extendsId": 1,
  "isEnabled": "1",
  "subject": "Trading Account Created",
  "template": "Template"
}'

Response

The response includes an Email Notification Template object providing the information about the created template.

Update an email notification template

Use this method to update an email notification template.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

templateId integer required

The identifier of an email notification template.

Body:

The following field values can be updated:

typeId integer

The identifier of a notification type.

locale string

The locale identifier (such as en_US).

extendsId integer

The type of an email template. Possible values:

  • mails

  • notifications

  • types

isEnabled boolean

If true, the email notification template is enabled and can be used to deliver notifications; otherwise, false.

subject string

The email subject.

template string

The content of the email template, in HTML format.

PATCH[host]v2/mails/notifications/templates/{templateId}

curl --location --request PATCH 'https://host.name/api/v2/mails/notifications/templates/:templateId' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "typeId": 1,
  "locale": "en_US",
  "extendsId": "notifications",
  "isEnabled": "1",
  "subject": "Mail subject",
  "template": "Mail template"
}'

Response

The response includes an Email Notification Template object providing the information about the updated template.

Delete an email notification template

Use this method to delete a specified email notification template.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

typeId integer required

The identifier of an email notification template.

DELETE[host]v2/mails/notifications/templates/{templateId}

curl --location --request DELETE 'https://host.name/api/v2/mails/notifications/templates/:templateId' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.

Get a list of notification types

Use this method to obtain a list of notification types configured in the Back Office.

To obtain detailed information about a specific notification type, use a separate method to get notification type details.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

The following filter parameters are available for this method:

name

The notification type name.

caption

The notification type description.

isEnabled

If true, the result includes only the enabled notification types; otherwise, false.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/mails/notifications/types

curl --location -g --request GET 'https://host.name/api/v2/mails/notifications/types?limit=10&offset=0&sort_order=desc&filter[name]=%3Cstring%3E&filter[caption]=%3Cstring%3E&filter[isEnabled]=0&sort_by=name' \
--header 'Authorization: Bearer <token>'

Response

The response includes an array of Notification Type objects providing the information about the notification types matching the request parameters.

Get notification type details

Use this method to obtain detailed information about a specified notification type.

To obtain a list of all notification types created in the Back Office, use a separate method to get a list of notification types.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

typeId integer required

The identifier of a notification type.

GET[host]/v2/mails/notifications/types/{typeId}

curl --location --request GET 'https://host.name/api/v2/mails/notifications/types/1' \
--header 'Authorization: Bearer <token>'

Response

The response includes a Notification Type object providing the information about the specified notification type.

Create a new notification type

Use this method to create a new notification type.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for a notification type:

name string required

The notification type’s name.

caption string required

The notification type’s caption.

isEnabled boolean required

If true, the notification type is enabled and can be used to deliver notifications; otherwise, false.

POST[host]/v2/mails/notifications/types

curl --location --request POST 'https://host.name/api/v2/mails/notifications/types' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "accountCreated",
  "caption": "accountCreated",
  "isEnabled": 1
}'

Response

The response includes a Notification Type object providing the information about the created notification type.

Update a notification type

Use this method to update a notification type.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

typeId integer required

The notification type identifier.

Body:

The following field values can be updated:

name string

The notification type’s name.

caption string

The notification type’s caption.

isEnabled boolean

If true, the notification type is enabled and can be used to deliver notifications; otherwise, false.

PATCH[host]v2/mails/notifications/types/{typeId}

curl --location --request PATCH 'https://host.name/api/v2/mails/notifications/types/:typeId' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "templateName",
  "caption": "templateTitle",
  "isEnabled": 1
}'

Response

The response includes a Notification Type object providing the information about the updated notification type.

Delete a notification type

Use this method to delete a specified notification type.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

typeId integer required

The identifier of a notification type.

DELETE[host]v2/mails/notifications/types/{typeId}

curl --location --request DELETE 'https://host.name/api//v2/mails/notifications/types/:typeId' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.