subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview​
| Name | subscriptions |
| Type | Resource |
| Id | okta.users.subscriptions |
Fields​
The following fields are returned by SELECT queries:
- get_subscriptions_notification_type_user
- list_subscriptions_user
| Name | Datatype | Description |
|---|---|---|
_links | object | Discoverable resources related to the subscription |
channels | array | An array of sources send notifications to users. > Note: Currently, Okta only allows email channels. |
notificationType | string | The 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) |
status | string | The status of the subscription (subscribed, unsubscribed) |
| Name | Datatype | Description |
|---|---|---|
_links | object | Discoverable resources related to the subscription |
channels | array | An array of sources send notifications to users. > Note: Currently, Okta only allows email channels. |
notificationType | string | The 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) |
status | string | The status of the subscription (subscribed, unsubscribed) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_subscriptions_notification_type_user | select | userId, notificationType, subdomain | Retrieves a subscription by notificationType for a specified user. Returns an AccessDeniedException message if requests are made for another user. | |
list_subscriptions_user | select | userId, subdomain | Lists all subscriptions available to a specified user. Returns an AccessDeniedException message if requests are made for another user. | |
subscribe_by_notification_type_user | exec | userId, notificationType, subdomain | Subscribes the current user to a specified notification type. Returns an AccessDeniedException message if requests are made for another user. | |
unsubscribe_by_notification_type_user | exec | userId, notificationType, subdomain | Unsubscribes 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.
| Name | Datatype | Description |
|---|---|---|
notificationType | string | |
subdomain | string | (default: my-org) |
userId | string |
SELECT examples​
- get_subscriptions_notification_type_user
- list_subscriptions_user
Retrieves a subscription by notificationType for 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 notificationType = '{{ notificationType }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
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​
- subscribe_by_notification_type_user
- unsubscribe_by_notification_type_user
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
;
Unsubscribes the current user from a specified notification type. Returns an AccessDeniedException message if requests are made for another user.
EXEC okta.users.subscriptions.unsubscribe_by_notification_type_user
@userId='{{ userId }}' --required,
@notificationType='{{ notificationType }}' --required,
@subdomain='{{ subdomain }}' --required
;