These endpoints allow you to programmatically manage email customizations.
Okta provides many customizable email templates. For example, the UserActivation
email template allows users to activate their account. Use email customizations to override a template's default content. See the list of email templates.
Each template has default content that Okta translates to any one of the supported languages. The following settings determine the language for emails sent from Okta to a user, if the user hasn't selected a specific display language:
See Supported languages.
The following constraints apply to email customizations:
isDefault
is true
). Okta uses the default customization when no other customization applies to the user's language settings.Use the BCP 47 format to enable more locales than Okta's 27 default languages.
Once you create a customization with the new locale, the locale appears in the Admin Console along with the default-supported locales.
Include null
in the subject or body of the email customization. Okta replaces null
with a default value based on the following order of priority:
okta.templates.read
Lists all supported email templates
after | string The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the |
limit | integer [ 1 .. 200 ] Default: 20 A limit on the number of objects to return |
expand | Array of strings Specifies additional metadata to be included in the response |
Successfully returned the list of email templates.
Forbidden
Not Found
Too Many Requests
[- {
- "name": "UserActivation",
- "_embedded": {
- "customizationCount": 0,
- "settings": {
- "recipients": "ALL_USERS",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
}, - "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "settings": {
- "hints": {
- "allow": [
- "GET",
- "PUT"
]
}
}, - "defaultContent": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "customizations": {
- "hints": {
- "allow": [
- "GET",
- "POST",
- "DELETE"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
]
okta.templates.read
Retrieves the details of an email template by name
Successfully retrieved the email template.
Forbidden
Not Found
Too Many Requests
{- "name": "UserActivation",
- "_embedded": {
- "customizationCount": 0,
- "settings": {
- "recipients": "ALL_USERS",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
}, - "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "settings": {
- "hints": {
- "allow": [
- "GET",
- "PUT"
]
}
}, - "defaultContent": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "customizations": {
- "hints": {
- "allow": [
- "GET",
- "POST",
- "DELETE"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.templates.read
Lists all customizations of an email template
after | string The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the |
limit | integer [ 1 .. 200 ] Default: 20 A limit on the number of objects to return |
Successfully retrieved all email customizations for the specified email template.
Forbidden
Not Found
Too Many Requests
[- {
- "language": "en",
- "isDefault": true,
- "subject": "Welcome to ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Hello, ${user.profile.firstName}. Click <a href=\"${activationLink}\">here</a> to activate your account.</body></html>",
- "id": "oel11u6DqUiMbQkpl0g4",
- "created": "2021-11-09T20:38:10.000Z",
- "lastUpdated": "2021-11-11T20:38:10.000Z",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT",
- "DELETE"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "preview": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
]
okta.templates.manage
Creates a new Email Customization
subject required | string The email subject. May contain variable references.
|
body required | string The HTML body of the email. May contain variable references.
|
language required | string (Language) The language specified as an IETF BCP 47 language tag |
isDefault | boolean Whether this is the default customization for the email template. Each customized email template must have exactly one default customization. Defaults to |
Successfully created the email customization.
Bad Request
Forbidden
Not Found
Could not create the email customization because it conflicts with an existing email customization.
Too Many Requests
{- "language": "fr",
- "subject": "Bienvenue dans ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Bonjour ${user.profile.firstName}. <a href=\"${activationLink}\">Activer le compte</a></p></body></html>",
- "isDefault": false
}
{- "language": "fr",
- "subject": "Bienvenue dans ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Bonjour ${user.profile.firstName}. <a href=\"${activationLink}\">Activer le compte</a></p></body></html>",
- "isDefault": false,
- "id": "oel11u6DqUiMbQkpl0g4",
- "created": "2021-11-09T20:38:10.000Z",
- "lastUpdated": "2021-11-11T20:38:10.000Z",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT",
- "DELETE"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "preview": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.templates.manage
Deletes all customizations for an email template
Successfully deleted all customizations for the email template.
Forbidden
Not Found
Too Many Requests
{- "errorCode": "E0000006",
- "errorSummary": "You do not have permission to perform the requested action",
- "errorLink": "E0000006",
- "errorId": "sampleNUSD_8fdkFd8fs8SDBK",
- "errorCauses": [ ]
}
okta.templates.read
Retrieves an email customization by its unique identifier
404 Not Found
error response.
Successfully retrieved the email customization.
Forbidden
Not Found
Too Many Requests
{- "language": "en",
- "isDefault": true,
- "subject": "Welcome to ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Hello, ${user.profile.firstName}. Click <a href=\"${activationLink}\">here</a> to activate your account.</body></html>",
- "id": "oel11u6DqUiMbQkpl0g4",
- "created": "2021-11-09T20:38:10.000Z",
- "lastUpdated": "2021-11-11T20:38:10.000Z",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT",
- "DELETE"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "preview": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.templates.manage
Replaces an email customization using property values
404 Not Found
error response.
Request
subject required | string The email subject. May contain variable references.
|
body required | string The HTML body of the email. May contain variable references.
|
language required | string (Language) The language specified as an IETF BCP 47 language tag |
isDefault | boolean Whether this is the default customization for the email template. Each customized email template must have exactly one default customization. Defaults to |
Successfully updated the email customization.
Bad Request
Forbidden
Not Found
Could not update the email customization because the update would cause a conflict with an existing email customization.
Too Many Requests
{- "language": "fr",
- "subject": "Bienvenue dans ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Bonjour ${user.profile.firstName}. <a href=\"${activationLink}\">Activer le compte</a></p></body></html>",
- "isDefault": false
}
{- "language": "fr",
- "subject": "Bienvenue dans ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Bonjour ${user.profile.firstName}. <a href=\"${activationLink}\">Activer le compte</a></p></body></html>",
- "isDefault": false,
- "id": "oel11u6DqUiMbQkpl0g4",
- "created": "2021-11-09T20:38:10.000Z",
- "lastUpdated": "2021-11-11T20:38:10.000Z",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT",
- "DELETE"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "preview": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.templates.manage
Deletes an Email Customization by its unique identifier
Successfully deleted the email customization.
Forbidden
Not Found
Could not delete the email customization deleted because it is the default email customization.
Too Many Requests
{- "errorCode": "E0000006",
- "errorSummary": "You do not have permission to perform the requested action",
- "errorLink": "E0000006",
- "errorId": "sampleNUSD_8fdkFd8fs8SDBK",
- "errorCauses": [ ]
}
okta.templates.read
Retrieves a Preview of an Email Customization. All variable references are populated from the current user's context. For example, ${user.profile.firstName}
.
404 Not Found
error response.
Successfully generated a preview of the email customization.
Forbidden
Not Found
Too Many Requests
{- "subject": "Welcome to Okta!",
- "body": "<!DOCTYPE html><html><body><p>Hello, John. Click <a href=\"https://{yourOktaDomain}/...\">here</a> to activate your account.</body></html>",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "test": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.templates.read
Retrieves an email template's default content
language
parameterSuccessfully retrieved the email template's default content.
Forbidden
Not Found
Too Many Requests
{- "subject": "Welcome to ${org.name}!",
- "body": "<!DOCTYPE html><html><body><p>Hello, ${user.profile.firstName}. Click <a href=\"${activationLink}\">here</a> to activate your account.</body></html>",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "preview": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
okta.templates.read
Retrieves a preview of an Email Template's default content. All variable references are populated using the current user's context. For example, ${user.profile.firstName}
.
language
parameterSuccessfully generated a preview of the email template's default content.
Forbidden
Not Found
Too Many Requests
{- "subject": "Welcome to Okta!",
- "body": "<!DOCTYPE html><html><body><p>Hello, John. Click <a href=\"https://{yourOktaDomain}/...\">here</a> to activate your account.</body></html>",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}, - "defaultContent": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.templates.read
Retrieves an email template's settings
Successfully retrieved the email template's settings.
Forbidden
Not Found
Too Many Requests
{- "recipients": "ALL_USERS",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
okta.templates.manage
Replaces an email template's settings
Successfully updated the email template's settings.
Bad Request
Forbidden
Not Found
Could not update the email template's settings due to an invalid setting value.
Too Many Requests
{- "recipients": "ALL_USERS"
}
{- "recipients": "ALL_USERS",
- "_links": {
- "self": {
- "hints": {
- "allow": [
- "GET",
- "PUT"
]
}
}, - "template": {
- "hints": {
- "allow": [
- "GET"
]
}
}
}
}
okta.templates.read
Sends a test email to the current user’s primary and secondary email addresses. The email content is selected based on the following priority:
language
query parameter.
language
parameter is an additional language, the test email uses the customization corresponding to the language.Successfully sent a test email.
Forbidden
Not Found
Too Many Requests
{- "errorCode": "E0000006",
- "errorSummary": "You do not have permission to perform the requested action",
- "errorLink": "E0000006",
- "errorId": "sampleNUSD_8fdkFd8fs8SDBK",
- "errorCauses": [ ]
}