Skip to main content

subscriptions

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

Overview​

Namesubscriptions
TypeResource
Idokta.roles.subscriptions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
_linksobjectDiscoverable resources related to the subscription
channelsarrayAn array of sources send notifications to users. > Note: Currently, Okta only allows email channels.
notificationTypestringThe type of notification (AD_AGENT, AGENT_AUTO_UPDATE_NOTIFICATION, AGENT_AUTO_UPDATE_NOTIFICATION_LDAP, APP_IMPORT, CONNECTOR_AGENT, IWA_AGENT, LDAP_AGENT, OKTA_ANNOUNCEMENT, OKTA_UPDATE, RATELIMIT_NOTIFICATION, REPORT_SUSPICIOUS_ACTIVITY, USER_DEPROVISION, USER_LOCKED_OUT)
statusstringThe status of the subscription (subscribed, unsubscribed)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_subscriptions_notification_type_roleselectroleRef, notificationType, subdomainRetrieves a subscription by notificationType for a specified Role
list_subscriptions_roleselectroleRef, subdomainLists all subscriptions available to a specified Role
subscribe_by_notification_type_roleexecroleRef, notificationType, subdomainSubscribes a Role to a specified notification type. Changes to Role subscriptions override the subscription status of any individual users with the Role.
unsubscribe_by_notification_type_roleexecroleRef, notificationType, subdomainUnsubscribes a Role from a specified notification type. Changes to Role subscriptions override the subscription status of any individual users with the Role.

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
notificationTypestring
roleRefA reference to an existing role. Standard roles require a roleType, while Custom Roles require a roleId. See Standard roles.
subdomainstring(default: my-org)

SELECT examples​

Retrieves a subscription by notificationType for a specified Role

SELECT
_links,
channels,
notificationType,
status
FROM okta.roles.subscriptions
WHERE roleRef = '{{ roleRef }}' -- required
AND notificationType = '{{ notificationType }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

Lifecycle Methods​

Subscribes a Role to a specified notification type. Changes to Role subscriptions override the subscription status of any individual users with the Role.

EXEC okta.roles.subscriptions.subscribe_by_notification_type_role
@roleRef='{{ roleRef }}' --required,
@notificationType='{{ notificationType }}' --required,
@subdomain='{{ subdomain }}' --required
;