sms_templates
Creates, updates, deletes, gets or lists a sms_templates resource.
Overview
| Name | sms_templates |
| Type | Resource |
| Id | okta.templates.sms_templates |
Fields
The following fields are returned by SELECT queries:
- list_sms_templates
- get_sms_template
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | Human-readable name of the Template |
created | string (date-time) | |
lastUpdated | string (date-time) | |
template | string | Text of the Template, including any macros |
translations | object | - 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. |
type | string | Type of the Template |
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | Human-readable name of the Template |
created | string (date-time) | |
lastUpdated | string (date-time) | |
template | string | Text of the Template, including any macros |
translations | object | - 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. |
type | string | Type of the Template |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_sms_templates | select | subdomain | templateType | Lists all custom SMS templates. A subset of templates can be returned that match a template type. |
get_sms_template | select | subdomain | Retrieves a specific template by id | |
create_sms_template | insert | subdomain | Creates a new custom SMS template | |
update_sms_template | update | subdomain | 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. | |
replace_sms_template | replace | subdomain | Replaces the SMS Template > Notes: You can't update the default SMS Template. | |
delete_sms_template | delete | subdomain | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
subdomain | string | The 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) |
templateType | string |
SELECT examples
- list_sms_templates
- get_sms_template
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 }}'
;
Retrieves a specific template by id
SELECT
id,
name,
created,
lastUpdated,
template,
translations,
type
FROM okta.templates.sms_templates
WHERE subdomain = '{{ subdomain }}' -- required
;
INSERT examples
- create_sms_template
- Manifest
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
;
# Description fields are for documentation purposes
- name: sms_templates
props:
- name: subdomain
value: string
description: Required parameter for the sms_templates resource.
- name: name
value: string
description: >
Human-readable name of the Template
- name: template
value: string
description: >
Text of the Template, including any [macros](https://developer.okta.com/docs/apihttps://developer.okta.com/docs/api/openapi/okta-management/management/tag/Template/)
- name: translations
value: object
description: >
- 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](https://www.loc.gov/standards/iso639-2/php/code_list.php). The value is the translated SMS Template.
- Just like with regular SMS Templates, the length of the SMS message can't exceed 160 characters.
- name: type
value: string
description: >
Type of the Template
valid_values: ['SMS_VERIFY_CODE']
UPDATE examples
- update_sms_template
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
- replace_sms_template
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
- delete_sms_template
Deletes an SMS template
DELETE FROM okta.templates.sms_templates
WHERE subdomain = '{{ subdomain }}' --required
;