Notifications Templates
The templates endpoints manage notifications templates and notifications contents. Each content is based on one specific template. Each template can be associated with multiple contents.
Each environment has a set of predefined notifications templates it can access. A template represents a specific process flow, for example, device_pairing or strong_authentication, that requires a notification. Each template defines the deliveryMethods (Email, SMS, Voice, WhatsApp, or Push) that it supports. You can read templates with this API, but you cannot create, update, or delete them.
Notifications templates settings
| Template name | ID | Description | Delivery methods | Supported predefined variables | Dynamic variables allowed |
|---|---|---|---|---|---|
Credential Issued |
|
Users will receive this message when a credential is issued to them |
|
|
No |
Credential Revoked |
|
Users will receive this message when a credential they have is revoked |
|
|
No |
Credential Updated |
|
Users will receive this message when a credential they have is updated |
|
|
No |
Credential Verification Push |
|
Users' digital wallet will receive this message as a pushed notification of creation of a credential verification session |
|
None |
No |
Device pairing |
|
Users will receive this message to pair their device for strong authentication |
|
|
Yes (for delivery methods other than WhatsApp) |
Digital Wallet Pairing |
|
Users will receive this message to setup and pair a digital wallet. |
|
|
No |
Email Address Verification (Admin) |
|
Admins will receive this message to verify their email address |
|
|
No |
Email Address Verification (User) |
|
Users will receive this message to verify their email address |
|
|
No |
Email and Phone Verification for Verify |
|
Users will receive this message to verify their phone number or email address for a verify transaction |
|
|
No |
General |
|
Use this multi-purpose template to create custom notifications |
|
|
Yes |
ID Verification |
|
Users will receive this message to verify their email address |
|
|
No |
New Device Paired |
|
When a new device is paired, a notification will be sent to the user that a device has been registered to their account |
|
|
No |
Password Recovery |
|
Users who need to reset their password will receive this message |
|
|
No |
Strong Authentication |
|
Users will receive this message for strong authentication |
|
|
Yes (for delivery methods other than WhatsApp) |
Transaction |
|
Users will receive this message for transaction approval |
|
|
Yes |
Verification Code |
|
Users will receive this message to verify their email address |
|
|
No |
A content defines one message text choice for a notification. Each content is always associated with one template and has one deliveryMethod and one locale. Each template comes with one predefined default content for each of its supported deliveryMethods. You cannot delete or update the default contents with this API. However, you can create custom contents for a template (up to 1000 custom contents per template). To create custom contents, refer to Creating custom contents.
|
Trial License Environments: If your environment has a trial license, you cannot use the built-in PingOne email service (@pingone.com) to send custom email notifications. You cannot create custom email notification contents unless you use a custom email domain or your own SMTP server. If you need to use the built-in PingOne email service, your email notifications must use the predefined default email content. |
|
You need the Environment Admin role to perform operations on notifications templates and notifications contents resources. |
Notification templates assignment and initiation
A notification template is defined for a specifc process flow to convey information about the process flow to its user. Typically, a service provides a request that can assign a specific variant or a specific locale or both (for more information on variants and locales, refer to Creating custom contents) for a notification used by its process flow. For example, Create Credential Issuance Rule has a notification.template object that can set the notification template variant and locale for notifications sent when a user credential is created, updated, or revoked through Apply Credential Issuance Rule Staged Changes or its automated equivalent.
In this table, the notification template in Template name is assigned a variant or locale in the request in Defined by and the supported process flow begins with the request in Initiated by.
| Template name | Defined by | Initiated by |
|---|---|---|
|
Create Credential Issuance Rule or Update Credential Issuance Rule |
Apply Credential Issuance Rule Staged Changes or its automated equivalent when the issuance rule’s |
|
||
|
Create Credential Issuance Rule or Update Credential Issuance Rule |
Apply Credential Issuance Rule Staged Changes or its automated equivalent when the issuance rule’s |
|
Create Credential Issuance Rule or Update Credential Issuance Rule |
Apply Credential Issuance Rule Staged Changes or its automated equivalent when the issuance rule’s |
|
||
|
Create Credential Verification Session (NATIVE - Push Notification) |
Create Credential Verification Session (NATIVE - Push Notification) |
|
Defined by the flow status. |
Initiated by the |
|
||
|
Create Verify Policy or Update Verify Policy, but cannot define a locale. |
|
|
Defined by the flow status. |
Initiated by the |
|
Defined by the flow status. |
Initiated by the |
|
Defined by the flow status. |
Initiated by a flow status that sends a one-time passcode through email, SMS, or voice. |
|
Cannot define a variant or locale |
|
|
Add the |
Refer to MFA Devices. |
|
Defined by the flow status. |
Initiated by the |
|
Defined by the flow status. |
Initiated by an MFA flow status that sends a push notification on mobile apps or a one-time passcode through email, SMS, or voice. |
|
Defined by the |
Initiated by the authorize request. Refer to Authorize (Transaction Approval). |
|
Defined by the flow status. |
Initiated by the |
Runtime logic for content selection
Each content, whether default or custom, is associated with one template, one deliveryMethod, one locale, and optionally, one variant (for more information on variants, refer to Creating custom contents). When a request for content is executed at runtime, it includes a template, deliveryMethod, and optionally a variant.
When determining the language to use for a notification, PingOne uses the following logic:
-
The preferred language is determined by:
-
Checking first if
localeis specified in the API request, for example, in thenotification.template.localeproperty forPOST {{apiPath}}/environments/{{envID}}/users/{{userID}}/devices. -
If
localewas not specified in the request, the preferred language that was set for the user in PingOne is used. -
If there is no preferred language set for the user in PingOne, the Accept-Language header in the request is checked.
-
If the Accept-Language header does not indicate a language preference, the default language for the PingOne environment is used.
-
-
Once the language preference has been determined, PingOne checks if there is a notification content that matches. If there is not an exact match, PingOne uses the best match (based on the language, ignoring the region) if available. For example,
es-ESfalls back toes. -
For voice notifications, PingOne uses the best matching language based on the supported languages of the provider (Twilio, Syniverse, or a custom provider).
-
The
localeproperty supports the syntax defined for the Accept-Language header in Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content, including the use of quality values.
Content language selection examples
Content |
Voice |
User |
Locale |
Resulting |
Description |
|
|
|
|
|
User’s preference and locale in the request match an available language in the content templates |
|
|
|
|
|
Default content language used: neither user’s preference nor locale in the request match an available content language |
|
|
|
|
Default content language used: no locale in the request, and no match of user’s preference with available content languages |
|
|
|
|
|
Default content language used: no definition for user’s preference, and no match of locale in the request with available content languages |
|
|
|
|
Default content language used: no definition for both user’s preference locale in the request |
||
|
|
|
|
|
Locale in the request used: user’s preference does not match an available language in the content templates, but the locale in the request does |
|
|
|
|
|
User preferred language doesn’t match any of the available contents' locales, but locale in the request has a close match to an available content’s locale ( |
|
|
|
|
|
Both user preferred language and locale in the request don’t match an available content’s locale and there’s no available content for the environment’s default language. Falling back to English. |
|
|
|
|
SMS,email,push: |
User preferred language matches an available content’s locale ( |
Creating custom contents
Add and update custom contents with POST {{apiPath}}/environments/{{envID}}/templates/{{templateName}}/contents and PUT {{apiPath}}/environments/{{envID}}/templates/{{templateName}}/contents/{{contentID}}. Each content is associated with one template and has one deliveryMethod and one ISO language code (locale). You can define multiple custom contents for each template + deliveryMethod + locale combination with the variant property.
Variants
If you have more than one custom content that uses the same template, deliveryMethod, and locale, these contents must have different values for the variant property. The variant property holds the unique user-defined name for each content variant that uses the same template + deliveryMethod + locale combination.
|
If you attempt to create a custom content for an existing combination of template, Custom notifications variants are not supported for the following templates:
|
variant values can be reused by contents across different template + deliveryMethod + locale combinations. They need to be unique within the same template + deliveryMethod + locale combination only. As a best practice, use the same variant value for contents with the same message text. For example, the variant value variant_A can be used by a content with the strong_authentication + email + en combination and also by a content with the strong_authentication + push + en combination. For two contents that both use the strong_authentication + email + en combination though, if one content uses the variant value of variant_A, the other content must use a variant value such as variant_B.
Use PATCH environments/{{envID}}/templates/{{templateName}}/contents?filter=variant eq {{variantName}} to bulk update the variant value in contents with the same variant value. Use DELETE environments/{{envID}}/templates/{{templateName}}/contents?filter=variant eq {{variantName}} to bulk delete contents with the same variant value.
|
|
Variables
Variables are placeholders for values that change depending on the context. For example:
-
The SMS content is
Hi ${user.username}! Your one time passcode is ${OTP}. -
The
${user.username}variable has a value ofJohn. -
The
${OTP}variable has a value of `548263 `.
The resulting message is:
Hi John! Your one time passcode is 548263, which includes the variable values John and 548263.
|
Notifications content variables are case insensitive. |
Predefined variables
If a template includes predefined variables, the template lists which variables can be optionally used in its contents and which variables are required in its contents. For example, user.username can be optionally used by strong_authentication contents, while otp is required for all SMS, Voice and Email contents.
"variables": {
"user.username": {
"required": false
},
"otp": {
"required": true,
"requiredForDeliveryMethods": [
"SMS",
"Voice",
"Email"
]
}
}
|
Before you create or update a custom content, you should always do a GET Read One Template on the notification template to determine its supported variables. |
Dynamic variables
In addition to predefined variables, most templates also allow dynamic variables. If a template has the property allowDynamicVariables set to true, its contents can contain any user-defined variable in the format ${variable_name}.
|
Before you create or update a custom content, you should always do a GET Read One Template on the notification template to determine its supported variables. In addition, for the |
Filtering result data
You can filter GET {{apiPath}}/environments/{{envID}}/templates and GET {{apiPath}}/environments/{{envID}}/templates/{{templateName}}/contents results by applying a SCIM filtering expression to the request URL. For large collections, a filtering expression appended to the query returns a targeted, more useful data set. For example, the following URL-encoded SCIM filter returns templates created before 2018-07-30 and updated after 2018-08-30:
https://api.pingone.com/v1/environments/5caa81af-ec05-41ff-a709-c7378007a99c/templates?filter=(createdAt%20lt%20%222018-08-30%22)%20and%20(updatedAt%20gt%20%222018-07-30%22)%20
SCIM operators can be applied to the following attributes:
| Collection | Attribute | Supported |
|---|---|---|
Templates and contents collections |
|
* eq (equals) * ne (not equals) * gt (greater than) * ge (greater than or equals) * lt (less than) * le (less than or equals) |
Templates and contents collections |
|
* eq (equals) * ne (not equals) * gt (greater than) * ge (greater than or equals) * lt (less than) * le (less than or equals) |
Contents collections |
|
* eq (equals) |
Contents collections |
|
* eq (equals) * sw (starts with) |
Contents collections |
|
* eq (equals) |
Contents collections |
|
* eq (equals) * sw (starts with) |
Additionally, the logical and and or operators may be used for building compound expressions.
Ordering result data
You can order the collections returned by the GET collection endpoints according to the createdAt and updatedAt attribute. Ordering by any attribute returns the collection in a descending order. Using the attribute with the "-" prefix returns the collection ordered in descending order. For example, the following URL returns all the templates ordered by ascending creation date:
https://api.pingone.com/v1/environments/5caa81af-ec05-41ff-a709-c7378007a99c/templates?order=-createdAt
|
For more information about SCIM syntax and operators, refer to Filtering collections.
Properties
Template Properties
| Property | Type | Required? | Mutable? | Description |
|---|---|---|---|---|
|
String |
Required |
Immutable |
The template id. |
|
String |
Required |
Mutable |
The template’s display name. |
|
Array |
Required |
Mutable |
The delivery methods supported for this template. Valid values are |
|
Date |
N/A |
Read only |
The time the resource was created. |
|
Date |
N/A |
Read only |
The time the resource was last updated. |
|
String |
Optional |
Mutable |
The description of the template. |
|
Object |
Required |
Mutable |
Lists the variables you can use in each template content. The |
|
Boolean |
Required |
Mutable |
Specifies whether dynamic variables can be used in the template’s contents. For more information, refer to Dynamic variables. |
Content Properties
| Property | Type | Required? | Mutable? | Description |
|---|---|---|---|---|
|
String |
Required/Optional |
Mutable |
Only required when |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Required/Optional |
Mutable |
Only required when * SMS: UC-2 encoding is used for text that contains non GSM-7 characters. UC-2 encoded text cannot exceed 67 characters. GSM-7 encoded text cannot exceed 153 characters. If supported, it can include variables. * Voice: Limited to 1Kb characters. * * * In the following message example, |
|
Date |
N/A |
Read only |
The time the resource was created. |
|
Boolean |
Optional |
Mutable |
Specifies whether the template is a predefined default template. |
|
String |
Required |
Immutable |
The content’s delivery method. Possible values are |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
N/A |
Read only |
The template id. |
|
String |
Required |
Immutable |
A valid case-insensitive locale, complying with the ISO-639 language code and ISO-3166 country code standards: * Two-character language code, for example, "en". * Two-character language code followed by a two-character country code, separated by an underscore or dash, for example: "en_GB", "en-GB". Cannot be changed after it is initially set in |
|
String |
Optional |
Mutable |
For Push content, you can specify what type of banner should be displayed to the user. The available options are: * BANNER_BUTTONS - the banner contains both Approve and Deny buttons * WITHOUT_BANNER_BUTTONS - when the user clicks the banner, they are taken to an application that contains the necessary approval controls. * APPROVE_AND_OPEN_APP - when the Approve button is clicked, authentication is completed and the user is taken to the relevant application. If this parameter is not provided, the default is BANNER_BUTTONS. Note that to use the non-default push banners, you must implement them in your application code, using the PingOne SDK. For details, refer to the README for iOS and the README for Android. |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
N/A |
Read only |
The ID of the template type, for example, |
|
String |
Optional |
Mutable |
Relevant when |
|
String |
Optional |
Mutable |
The Twilio ID of the Verify template to use. Can be included when using Twilio Verify. |
|
String |
Optional |
Mutable |
The locale of the Verify template to use. Required if you have specified a value for |
|
Date |
N/A |
Read only |
The time the resource was last updated. |
|
String |
Optional |
Mutable |
Holds the unique user-defined name for each content variant that uses the same template + |
|
String |
Optional |
Mutable |
Relevant only if * Supported Twilio voices:<ul><li>Man, Woman * Alice (Twilio only) * Amazon Polly * Supported Syniverse voices: * Man, Woman * Woman only |
|
Object |
Required |
Mutable |
Required when creating content for WhatsApp delivery. Contains the necessary information for identifying the WhatsApp template that should be used for the content. Use |
|
String |
Optional |
Mutable |
If included, should be set to |
|
String |
Required |
Mutable |
The WhatsApp-provided ID of the template. |
|
String |
Required |
Mutable |
The language of the template. |
|
String |
Required |
Mutable |
The name of the template. |
|
Notifications Templates events generated
Refer to Audit Reporting Events for the events generated.