Skip to main content

sms_templates

Creates, updates, deletes, gets or lists a sms_templates resource.

Overview

Namesms_templates
TypeResource
Idokta.templates.sms_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring
namestringHuman-readable name of the Template
createdstring (date-time)
lastUpdatedstring (date-time)
templatestringText of the Template, including any macros
translationsobject- 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.
typestringType of the Template

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_sms_templatesselectsubdomaintemplateTypeLists all custom SMS templates. A subset of templates can be returned that match a template type.
get_sms_templateselectsubdomainRetrieves a specific template by id
create_sms_templateinsertsubdomainCreates a new custom SMS template
update_sms_templateupdatesubdomainUpdates only some of the SMS Template properties:
* All properties within the custom SMS Template that have values are updated.
* Any translation that doesn't exist is added.
* Any translation with a null or empty value is removed.
* Any translation with non-empty/null value is updated.
replace_sms_templatereplacesubdomainReplaces the SMS Template
> Notes: You can't update the default SMS Template.
delete_sms_templatedeletesubdomainDeletes an SMS template

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)
templateTypestring

SELECT examples

Lists all custom SMS templates. A subset of templates can be returned that match a template type.

SELECT
id,
name,
created,
lastUpdated,
template,
translations,
type
FROM okta.templates.sms_templates
WHERE subdomain = '{{ subdomain }}' -- required
AND templateType = '{{ templateType }}'
;

INSERT examples

Creates a new custom SMS template

INSERT INTO okta.templates.sms_templates (
data__name,
data__template,
data__translations,
data__type,
subdomain
)
SELECT
'{{ name }}',
'{{ template }}',
'{{ translations }}',
'{{ type }}',
'{{ subdomain }}'
RETURNING
id,
name,
created,
lastUpdated,
template,
translations,
type
;

UPDATE examples

Updates only some of the SMS Template properties:
* All properties within the custom SMS Template that have values are updated.
* Any translation that doesn't exist is added.
* Any translation with a null or empty value is removed.
* Any translation with non-empty/null value is updated.

UPDATE okta.templates.sms_templates
SET
data__name = '{{ name }}',
data__template = '{{ template }}',
data__translations = '{{ translations }}',
data__type = '{{ type }}'
WHERE
subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
created,
lastUpdated,
template,
translations,
type
;

REPLACE examples

Replaces the SMS Template
> Notes: You can't update the default SMS Template.

REPLACE okta.templates.sms_templates
SET
data__name = '{{ name }}',
data__template = '{{ template }}',
data__translations = '{{ translations }}',
data__type = '{{ type }}'
WHERE
subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
created,
lastUpdated,
template,
translations,
type
;

DELETE examples

Deletes an SMS template

DELETE FROM okta.templates.sms_templates
WHERE subdomain = '{{ subdomain }}' --required
;