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
or Push
) that it supports. You can read templates with this API, but you cannot create, update, or delete them.
Template name | ID | Description | Delivery methods | Supported predefined variables | Dynamic variables allowed |
---|---|---|---|---|---|
Credential Issued | credential_issued |
Users will receive this message when a credential is issued to them | SMS , Email , Push |
credential.name (optional), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Credential Revoked | credential_revoked |
Users will receive this message when a credential they have is revoked | SMS , Email , Push |
credential.name (optional), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Credential Updated | credential_updated |
Users will receive this message when a credential they have is updated | SMS , Email , Push |
credential.name (optional), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Credential Verification Push | credential_verification |
Users’ digital wallet will receive this message as a pushed notification of creation of a credential verification presentations session | Push |
None | No |
Device pairing | device_pairing |
Users will receive this message to pair their device for strong authentication | SMS , Email , Voice |
otp (required), user.username (optional), user.name.given (optional), user.name.family (optional), current-year (optional) |
Yes |
Digital Wallet Pairing | digital_wallet_pairing |
Users will receive this message to setup and pair a digital wallet. | SMS , Email |
app.open.url (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Email Address Verification (Admin) | email_verification_admin |
Admins will receive this message to verify their email address | Email |
code (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Email Address Verification (User) | email_verification_user |
Users will receive this message to verify their email address | Email |
code (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Email and Phone Verification for Verify | email_phone_verification |
Users will receive this message to verify their phone number or email address for a verify transaction | SMS , Email |
otp (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
General | general |
Use this multi-purpose template to create custom notifications | SMS , Email , Voice |
user.username (optional), user.name.given (optional), user.name.family (optional), current-year (optional) |
Yes |
ID Verification | id_verification |
Users will receive this message to verify their email address | SMS , Email |
app.open.url (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
New Device Paired | 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 | SMS , Email |
device.name (required), org.name (optional), report.fraud (optional) - inserts a link for reporting fraudulent pairing attempts |
No |
Password Recovery | recovery_code_template |
Users who need to reset their password will receive this message | Email |
code.value (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
No |
Strong Authentication | strong_authentication |
Users will receive this message for strong authentication | SMS , Email , Push , Voice |
otp (required for SMS , Email , Voice ), user.username (optional), user.name.given (optional), user.name.family (optional), current-year (optional) |
Yes |
Transaction | transaction |
Users will receive this message for transaction approval | SMS , Email , Push , Voice |
otp (required for SMS , Email , Voice ), user.username (optional), user.name.given (optional), user.name.family (optional) |
Yes |
Verification Code | verification_code_template |
Users will receive this message to verify their email address | Email |
code.value (required), user.username (optional), user.name.given (optional), user.name.family (optional) |
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, see Creating custom contents.
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, see 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 |
---|---|---|
credential_issued |
Create Credential Issuance Rule or Update Credential Issuance Rule | Apply Credential Issuance Rule Staged Changes or its automated equivalent when the issuance rule’s automation.issue is PERIODIC . |
credential_issued |
Create a User Credential | Create a User Credential |
credential_revoked |
Create Credential Issuance Rule or Update Credential Issuance Rule | Apply Credential Issuance Rule Staged Changes or its automated equivalent when the issuance rule’s automation.revoke is PERIODIC . |
credential_updated |
Create Credential Issuance Rule or Update Credential Issuance Rule | Apply Credential Issuance Rule Staged Changes or its automated equivalent when the issuance rule’s automation.update is PERIODIC . |
credential_updated |
Update a User Credential | Update a User Credential |
credential_verification |
Create Credential Verification Presentation Session (NATIVE - Push Notification) | Create Credential Verification Presentation Session (NATIVE - Push Notification) |
device_pairing |
Defined by the flow status. | Initiated by the DEVICE_SELECTION_REQUIRED flow status. |
digital_wallet_pairing |
Create Digital Wallet | Create Digital Wallet |
email_phone_verification |
Create Verify Policy or Update Verify Policy, but cannot define a locale. | Create Verify Transaction |
email_verification_admin |
Defined by the flow status. | Initiated by the VERIFICATION_REQUIRED flow status. See Send Email Verification (Code). |
email_verification_user |
Defined by the flow status. | Initiated by the VERIFICATION_REQUIRED flow status. See Send Email Verification (Code). |
general |
Defined by the flow status. | Initiated by a flow status that sends a one-time passcode through email, SMS, or voice. |
id_verification |
Cannot define a variant or locale | Create Verify Transaction |
new_device_paired |
Add the notifications property to the Create MFA User Device request. |
See MFA Devices. |
recovery_code_template |
Defined by the flow status. | Initiated by the RECOVERY_CODE_REQUIRED flow status. The user initiated a password.forgot flow action and a recovery code must be sent. |
strong_authentication |
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. |
transaction |
Defined by the pi.template property in an authorize request’s request property JWT. |
Initiated by the authorize request. See Authorize (Transaction Approval). |
verification_code_template |
Defined by the flow status. | Initiated by the VERIFICATION_REQUIRED flow status. See Register User. |
Each content, whether default or custom, is associated with one template, one deliveryMethod
, one locale
, and optionally, one variant
(for more information on variants, see Creating custom contents). When a request for content is executed at runtime, it includes a template, deliveryMethod
, locale
and, optionally, a variant
.
PingOne matches the best text notification content for the user based on locale
and variant
name.
If a locale
is specified on the request (for example, on the notification.template.locale
property on POST /environments/{{envID}}/users/{{userID}}/devices
), it overrides the user’s preferred language setting.
If the locale
on the request (or the user’s preferred locale) does not match a notification content with the exact locale, PingOne uses the best matching locale (based on the language, ignoring the region) if available. For example, es-ES
falls back to es
.
For the locale
property value, PingOne supports language tags with quality values as described in Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content.
For voice notifications, PingOne uses the best matching language based on the supported languages of the provider (Twilio, Syniverse, or a custom provider).
Content available languages |
Voice provider support |
User preferred language |
Locale in the request |
Resulting notification language |
Description |
---|---|---|---|---|---|
fr-CA it (default) |
fr-CA it en |
fr-CA |
fr-CA |
fr-CA |
User’s preference and locale in the request match an available language in the content templates |
fr-CA it (default) |
fr-CA it en |
es |
es |
it |
Default content language used: neither user’s preference nor locale in the request match an available content language |
fr-CA it (default) |
fr-CA it en |
es |
it |
Default content language used: no locale in the request, and no match of user’s preference with available content languages | |
fr-CA it (default) |
fr-CA it en |
es |
it |
Default content language used: no definition for user’s preference, and no match of locale in the request with available content languages | |
fr-CA it (default) |
fr-CA it en |
it |
Default content language used: no definition for both user’s preference locale in the request | ||
fr-CA it (default) |
fr-CA it en |
es |
fr-CA |
fr-CA |
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 |
fr it (default) |
fr it en |
es |
fr-CA |
fr |
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 (fr ~= fr-CA ). |
fr-CA it |
fr-CA it en |
es |
es |
en |
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. |
fr it (default)es |
fr it en |
fr |
es |
SMS,email,push:es Voice: fr |
User preferred language matches an available content’s locale (es ). For notifications of type SMS, Email and Push, es will be used.Since es is not a supported voice language, for Voice notifications, fr will be used, since it matches the locale in the request and is also supported for text-to-speech. |
Add and update custom contents with POST /environments/{{envID}}/templates/{{templateName}}/contents
and PUT /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.
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.
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 are placeholders for values that change depending on the context. For example:
Hi ${user.username}! Your one time passcode is ${otp}.
${user.username}
variable has a value of John
.${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
.
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"
]
}
}
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}
.
You can filter GET /environments/{{envID}}/templates
and GET /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 | createdAt |
|
Templates and contents collections | updatedAt |
|
Contents collections | default |
|
Contents collections | locale |
|
Contents collections | deliveryMethod |
|
Contents collections | variant |
|
Additionally, the logical and
and or
operators may be used for building compound expressions.
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, see Conventions.
Property | Type | Required? | Mutable? | Description |
---|---|---|---|---|
id |
String | Required | Immutable | The template id. |
displayName |
String | Required | Mutable | The template’s display name. |
deliveryMethods |
Array | Required | Mutable | The delivery methods supported for this template. Valid values are SMS , Voice , Email and Push . |
createdAt |
Date | N/A | Read only | The time the resource was created. |
updatedAt |
Date | N/A | Read only | The time the resource was last updated. |
description |
String | Optional | Mutable | The description of the template. |
variables |
Object | Required | Mutable | Lists the variables you can use in each template content. The required property indicates whether the variable is required in template content. If required is true , the requiredForDeliveryMethods property lists the deliveryMethods types that require the variable. Note that if required is true , but requiredForDeliveryMethods is not returned, all deliveryMethods types are required. For more information, see Variables. |
allowDynamicVariables |
Boolean | Required | Mutable | Specifies whether dynamic variables can be used in the template’s contents. For more information, see Dynamic variables. |
Property | Type | Required? | Mutable? | Description |
---|---|---|---|---|
id |
String | Required | Immutable | The template id. |
createdAt |
Date | N/A | Read only | The time the resource was created. |
updatedAt |
Date | N/A | Read only | The time the resource was last updated. |
default |
Boolean | Optional | Mutable | Specifies whether the template is a predefined default template. |
locale |
String | Required | Immutable | A valid case-insensitive locale, complying with the ISO-639 language code and ISO-3166 country code standards:
POST /environments/{{envID}}/templates/{{templateName}}/contents . |
deliveryMethod |
String | Required | Immutable | The content’s delivery method. Possible values are Email , SMS , Voice or Push . Cannot be changed after it is initially set in POST /environments/{{envID}}/templates/{{templateName}}/contents . |
pushCategory |
String | Optional | Mutable | For Push content, you can specify what type of banner should be displayed to the user. The available options are:
|
content |
String | Required/Optional | Mutable | Only required when deliveryMethod is SMS or Voice . The SMS or voice text.
|
voice |
String | Optional | Mutable | Relevant only if deliveryMethod is Voice . Options are Alice , Man , or Woman . Voice OTP supports vendor-specific voices.
|
body |
String | Required/Optional | Mutable | Only required when deliveryMethod is Email or Push . The email or push text (maximum 400 characters for push text). Email text cannot be larger than 100 kB. Email text can contain HTML. If supported, this can include variables. |
variant |
String | Optional | Mutable | Holds the unique user-defined name for each content variant that uses the same template + deliveryMethod + locale combination. This property is case insensitive and has a limit of 100 characters. For more information, see Creating custom contents. |
sender |
String | Optional | Mutable | Relevant when deliveryMethod is SMS . The SMS sender ID. This property can contain only alphanumeric characters and spaces, and its length cannot exceed 11 characters. In some countries, it is impossible to send an SMS with an alphanumeric sender ID. For those countries, the sender ID must be empty. For SMS recipients in specific countries, refer to Twilio’s documentation on International support for Alphanumeric Sender ID. |
from.name |
String | Optional | Mutable | Relevant when deliveryMethod is Email .The email’s sender name. If the environment uses the Ping Identity email sender, the name “PingOne” is used. You can configure other email sender names per environment. See Note for details. |
from.address |
String | Optional | Mutable | Relevant when deliveryMethod is Email .The sender email address. If the environment uses the Ping Identity email sender, or if the address field is empty, the address “noreply@pingidentity.com” is used. You can configure other email sender addresses per environment. See Note for details. |
subject |
String | Optional | Mutable | Relevant when deliveryMethod is Email . The email’s subject line. Cannot exceed 256 characters. If supported, can include variables. |
replyTo.name |
String | Optional | Mutable | Relevant when deliveryMethod is Email .The email’s “reply to” name. If the environment uses the Ping Identity email sender, the name “PingOne” is used. You can configure other email “reply to” names per environment. See Note for details. |
replyTo.address |
String | Optional | Mutable | Relevant when deliveryMethod is Email .The “reply to” email address. If the environment uses the Ping Identity email sender, or if the address field is empty, the address “noreply@pingidentity.com” is used. You can configure other email “reply to” addresses per environment. See Note for details. |
charset |
String | Optional | Mutable | Relevant when deliveryMethod is Email . If not specified, UTF-8 is the default value. |
emailContentType |
String | Optional | Mutable | Relevant when deliveryMethod is Email . If not specified, text/html is the default value. |
title |
String | Optional | Mutable | Relevant when deliveryMethod is Push . The push title (maximum 200 characters). If supported, this can include variables. |
To see the effects of these events for an API call, see the event types in the Audit Report, Audit Activities API, or Webhook stream.
Service | Event |
---|---|
notifications | NOTIFICATION.CREATED |
notifications | NOTIFICATION.UPDATED |
notifications | NOTIFICATION.REJECTED |
templates | CONTENT.CREATED |
templates | CONTENT.UPDATED |
templates | CONTENT.DELETED |
Code | Message |
---|---|
200 | Successful operation. |
201 | Successfully created. |
204 | Successfully removed. No content. |
400 | The request could not be completed. |
401 | You do not have access to this resource. |
404 | The requested resource was not found. |