Okta.Sdk.Api.SubscriptionApi

October 22, 2025 ยท View on GitHub

All URIs are relative to https://subdomain.okta.com

MethodHTTP requestDescription
GetSubscriptionsNotificationTypeRoleGET /api/v1/roles/{roleRef}/subscriptions/{notificationType}Retrieve a subscription for a role
GetSubscriptionsNotificationTypeUserGET /api/v1/users/{userId}/subscriptions/{notificationType}Retrieve a subscription for a user
ListSubscriptionsRoleGET /api/v1/roles/{roleRef}/subscriptionsList all subscriptions for a role
ListSubscriptionsUserGET /api/v1/users/{userId}/subscriptionsList all subscriptions for a user
SubscribeByNotificationTypeRolePOST /api/v1/roles/{roleRef}/subscriptions/{notificationType}/subscribeSubscribe a role to a specific notification type
SubscribeByNotificationTypeUserPOST /api/v1/users/{userId}/subscriptions/{notificationType}/subscribeSubscribe a user to a specific notification type
UnsubscribeByNotificationTypeRolePOST /api/v1/roles/{roleRef}/subscriptions/{notificationType}/unsubscribeUnsubscribe a role from a specific notification type
UnsubscribeByNotificationTypeUserPOST /api/v1/users/{userId}/subscriptions/{notificationType}/unsubscribeUnsubscribe a user from a specific notification type

GetSubscriptionsNotificationTypeRole

Subscription GetSubscriptionsNotificationTypeRole (ListSubscriptionsRoleRoleRefParameter roleRef, NotificationType notificationType)

Retrieve a subscription for a role

Retrieves a subscription by notificationType for a specified Role

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class GetSubscriptionsNotificationTypeRoleExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var roleRef = new ListSubscriptionsRoleRoleRefParameter(); // ListSubscriptionsRoleRoleRefParameter | A reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See [Standard Roles](/openapi/okta-management/guides/roles/#standard-roles).
            var notificationType = (NotificationType) "AD_AGENT";  // NotificationType | 

            try
            {
                // Retrieve a subscription for a role
                Subscription result = apiInstance.GetSubscriptionsNotificationTypeRole(roleRef, notificationType);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.GetSubscriptionsNotificationTypeRole: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
roleRefListSubscriptionsRoleRoleRefParameterA reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See Standard Roles.
notificationTypeNotificationType

Return type

Subscription

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSubscriptionsNotificationTypeUser

Subscription GetSubscriptionsNotificationTypeUser (NotificationType notificationType, string userId)

Retrieve a subscription for a user

Retrieves a subscription by notificationType for a specified user. Returns an AccessDeniedException message if requests are made for another user.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class GetSubscriptionsNotificationTypeUserExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var notificationType = (NotificationType) "AD_AGENT";  // NotificationType | 
            var userId = 00ub0oNGTSWTBKOLGLNR;  // string | ID of an existing Okta user

            try
            {
                // Retrieve a subscription for a user
                Subscription result = apiInstance.GetSubscriptionsNotificationTypeUser(notificationType, userId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.GetSubscriptionsNotificationTypeUser: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
notificationTypeNotificationType
userIdstringID of an existing Okta user

Return type

Subscription

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListSubscriptionsRole

List<Subscription> ListSubscriptionsRole (ListSubscriptionsRoleRoleRefParameter roleRef)

List all subscriptions for a role

Lists all subscriptions available to a specified Role

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListSubscriptionsRoleExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var roleRef = new ListSubscriptionsRoleRoleRefParameter(); // ListSubscriptionsRoleRoleRefParameter | A reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See [Standard Roles](/openapi/okta-management/guides/roles/#standard-roles).

            try
            {
                // List all subscriptions for a role
                List<Subscription> result = apiInstance.ListSubscriptionsRole(roleRef).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.ListSubscriptionsRole: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
roleRefListSubscriptionsRoleRoleRefParameterA reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See Standard Roles.

Return type

List<Subscription>

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListSubscriptionsUser

List<Subscription> ListSubscriptionsUser (string userId)

List all subscriptions for a user

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListSubscriptionsUserExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var userId = 00ub0oNGTSWTBKOLGLNR;  // string | ID of an existing Okta user

            try
            {
                // List all subscriptions for a user
                List<Subscription> result = apiInstance.ListSubscriptionsUser(userId).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.ListSubscriptionsUser: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
userIdstringID of an existing Okta user

Return type

List<Subscription>

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SubscribeByNotificationTypeRole

void SubscribeByNotificationTypeRole (ListSubscriptionsRoleRoleRefParameter roleRef, NotificationType notificationType)

Subscribe a role to a specific notification type

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class SubscribeByNotificationTypeRoleExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var roleRef = new ListSubscriptionsRoleRoleRefParameter(); // ListSubscriptionsRoleRoleRefParameter | A reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See [Standard Roles](/openapi/okta-management/guides/roles/#standard-roles).
            var notificationType = (NotificationType) "AD_AGENT";  // NotificationType | 

            try
            {
                // Subscribe a role to a specific notification type
                apiInstance.SubscribeByNotificationTypeRole(roleRef, notificationType);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.SubscribeByNotificationTypeRole: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
roleRefListSubscriptionsRoleRoleRefParameterA reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See Standard Roles.
notificationTypeNotificationType

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200No Content-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SubscribeByNotificationTypeUser

void SubscribeByNotificationTypeUser (NotificationType notificationType, string userId)

Subscribe a user to a specific notification type

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class SubscribeByNotificationTypeUserExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var notificationType = (NotificationType) "AD_AGENT";  // NotificationType | 
            var userId = 00ub0oNGTSWTBKOLGLNR;  // string | ID of an existing Okta user

            try
            {
                // Subscribe a user to a specific notification type
                apiInstance.SubscribeByNotificationTypeUser(notificationType, userId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.SubscribeByNotificationTypeUser: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
notificationTypeNotificationType
userIdstringID of an existing Okta user

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200No Content-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UnsubscribeByNotificationTypeRole

void UnsubscribeByNotificationTypeRole (ListSubscriptionsRoleRoleRefParameter roleRef, NotificationType notificationType)

Unsubscribe a role from a specific notification type

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class UnsubscribeByNotificationTypeRoleExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var roleRef = new ListSubscriptionsRoleRoleRefParameter(); // ListSubscriptionsRoleRoleRefParameter | A reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See [Standard Roles](/openapi/okta-management/guides/roles/#standard-roles).
            var notificationType = (NotificationType) "AD_AGENT";  // NotificationType | 

            try
            {
                // Unsubscribe a role from a specific notification type
                apiInstance.UnsubscribeByNotificationTypeRole(roleRef, notificationType);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.UnsubscribeByNotificationTypeRole: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
roleRefListSubscriptionsRoleRoleRefParameterA reference to an existing role. Standard roles require a `roleType`, while Custom Roles require a `roleId`. See Standard Roles.
notificationTypeNotificationType

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200No Content-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UnsubscribeByNotificationTypeUser

void UnsubscribeByNotificationTypeUser (NotificationType notificationType, string userId)

Unsubscribe a user from a specific notification type

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class UnsubscribeByNotificationTypeUserExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SubscriptionApi(config);
            var notificationType = (NotificationType) "AD_AGENT";  // NotificationType | 
            var userId = 00ub0oNGTSWTBKOLGLNR;  // string | ID of an existing Okta user

            try
            {
                // Unsubscribe a user from a specific notification type
                apiInstance.UnsubscribeByNotificationTypeUser(notificationType, userId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SubscriptionApi.UnsubscribeByNotificationTypeUser: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
notificationTypeNotificationType
userIdstringID of an existing Okta user

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200No Content-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]