Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idokta.users.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
statusstringThe status of the subscription

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_subscriptions_userselectuserId, subdomainLists all subscriptions available to a specified user. Returns an AccessDeniedException message if requests are made for another user.
get_subscriptions_notification_type_userselectuserId, notificationType, subdomainRetrieves a subscription by notificationType for a specified user. Returns an AccessDeniedException message if requests are made for another user.
subscribe_by_notification_type_userexecuserId, notificationType, subdomainSubscribes the current user to a specified notification type. Returns an AccessDeniedException message if requests are made for another user.
unsubscribe_by_notification_type_userexecuserId, notificationType, subdomainUnsubscribes the current user from a specified notification type. Returns an AccessDeniedException message if requests are made for another user.

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
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)
userIdstring

SELECT examples

Lists all subscriptions available to a specified user. Returns an AccessDeniedException message if requests are made for another user.

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

Lifecycle Methods

Subscribes the current user to a specified notification type. Returns an AccessDeniedException message if requests are made for another user.

EXEC okta.users.subscriptions.subscribe_by_notification_type_user 
@userId='{{ userId }}' --required,
@notificationType='{{ notificationType }}' --required,
@subdomain='{{ subdomain }}' --required;