Skip to content

Create an SMS template

Request

OAuth 2.0 scope:
  • okta.templates.manage

Creates a new custom SMS template

Bodyapplication/jsonrequired
namestring, [ 1 .. 50 ] characters

Human-readable name of the Template

templatestring, [ 1 .. 161 ] characters

Text of the Template, including any macros

translationsobject(SmsTemplateTranslations)
  • Template translations are optionally provided when you want to localize the SMS messages. Translations are provided as an object that contains key:value pairs: the language and the translated Template text. The key portion is a two-letter country code that conforms to ISO 639-1. The value is the translated SMS Template.
  • Just like with regular SMS Templates, the length of the SMS message can't exceed 160 characters.
typestring, [ 1 .. 50 ] characters(SmsTemplateType)

Type of the Template

Value:"SMS_VERIFY_CODE"
curl -i -X POST \
  https://subdomain.okta.com/api/v1/templates/sms \
  -H 'Content-Type: application/json' \
  -d '{
    "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}"
    }
  }'

Responses

Success

Bodyapplication/json
createdstring, (date-time)read-only
idstringread-only
lastUpdatedstring, (date-time)read-only
namestring, [ 1 .. 50 ] characters

Human-readable name of the Template

templatestring, [ 1 .. 161 ] characters

Text of the Template, including any macros

translationsobject(SmsTemplateTranslations)
  • Template translations are optionally provided when you want to localize the SMS messages. Translations are provided as an object that contains key:value pairs: the language and the translated Template text. The key portion is a two-letter country code that conforms to ISO 639-1. The value is the translated SMS Template.
  • Just like with regular SMS Templates, the length of the SMS message can't exceed 160 characters.
typestring, [ 1 .. 50 ] characters(SmsTemplateType)

Type of the Template

Value:"SMS_VERIFY_CODE"
Response
{ "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" }