The SMS Templates API provides operations to manage custom SMS templates for verification.
Note: Only SMS custom Templates are available through the API.
SMS Templates customize the SMS message that is sent to users. One default SMS Template is provided. All custom Templates must have the variable ${code}
as part of the text. The ${code}
variable is replaced with the actual SMS code when the message is sent. Optionally, you can also use the variable ${org.name}
. If a Template contains ${org.name}
, it is replaced with the organization name before the SMS message is sent.
Only two macros are supported for SMS Templates:
Type |
Description |
---|---|
${code} | The one-time verification code that's required for a user to sign in. |
${org.name} | The Okta org name that the user is trying to authenticate into. |
Note: The length of your SMS message can't exceed 160 characters. If the verification code portion of the message falls outside of the 160-character limit, your message isn't sent.
okta.templates.read
Lists all custom SMS templates. A subset of templates can be returned that match a template type.
Success
Forbidden
Too Many Requests
[- {
- "id": "6NQUJ5yR3bpgEiYmq8IC",
- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}"
}, - "created": "2024-04-25T17:35:02.000Z",
- "lastUpdated": "2024-04-25T17:35:02.000Z"
}
]
okta.templates.manage
Creates a new custom SMS template
name | string [ 1 .. 50 ] characters Human-readable name of the Template |
template | string [ 1 .. 161 ] characters Text of the Template, including any macros |
translations | object (SmsTemplateTranslations)
|
type | string (SmsTemplateType) [ 1 .. 50 ] characters Type of the Template |
Success
Bad Request
Forbidden
Too Many Requests
{- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}"
}
}
{- "id": "6NQUJ5yR3bpgEiYmq8IC",
- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}"
}, - "created": "2024-04-25T17:35:02.000Z",
- "lastUpdated": "2024-04-25T17:35:02.000Z"
}
okta.templates.read
Retrieves a specific template by id
Success
Forbidden
Not Found
Too Many Requests
{- "id": "6NQUJ5yR3bpgEiYmq8IC",
- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}"
}, - "created": "2024-04-25T17:35:02.000Z",
- "lastUpdated": "2024-04-25T17:35:02.000Z"
}
okta.templates.manage
Updates only some of the SMS Template properties:
name | string [ 1 .. 50 ] characters Human-readable name of the Template |
template | string [ 1 .. 161 ] characters Text of the Template, including any macros |
translations | object (SmsTemplateTranslations)
|
type | string (SmsTemplateType) [ 1 .. 50 ] characters Type of the Template |
Success
Bad Request
Forbidden
Not Found
Too Many Requests
{- "translations": {
- "de": "${org.name}: ihre bestätigungscode ist ${code}."
}
}
{- "id": "6NQUJ5yR3bpgEiYmq8IC",
- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}",
- "de": "${org.name}: ihre bestätigungscode ist ${code}."
}, - "created": "2024-04-25T17:35:02.000Z",
- "lastUpdated": "2024-04-25T17:35:02.000Z"
}
okta.templates.manage
Replaces the SMS Template
Notes: You can't update the default SMS Template.
name | string [ 1 .. 50 ] characters Human-readable name of the Template |
template | string [ 1 .. 161 ] characters Text of the Template, including any macros |
translations | object (SmsTemplateTranslations)
|
type | string (SmsTemplateType) [ 1 .. 50 ] characters Type of the Template |
Success
Bad Request
Forbidden
Not Found
Too Many Requests
{- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}"
}
}
{- "id": "6NQUJ5yR3bpgEiYmq8IC",
- "name": "Custom",
- "type": "SMS_VERIFY_CODE",
- "template": "${org.name}: your verification code is ${code}",
- "translations": {
- "es": "${org.name}: el código de verificación es ${code}",
- "fr": "${org.name}: votre code de vérification est ${code}",
- "it": "${org.name}: il codice di verifica è ${code}"
}, - "created": "2024-04-25T17:35:02.000Z",
- "lastUpdated": "2024-04-25T17:35:02.000Z"
}
okta.templates.manage
Deletes an SMS template
No Content
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": [ ]
}