Okta.Sdk.Api.BehaviorApi

October 22, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
ActivateBehaviorDetectionRulePOST /api/v1/behaviors/{behaviorId}/lifecycle/activateActivate a behavior detection rule
CreateBehaviorDetectionRulePOST /api/v1/behaviorsCreate a behavior detection rule
DeactivateBehaviorDetectionRulePOST /api/v1/behaviors/{behaviorId}/lifecycle/deactivateDeactivate a behavior detection rule
DeleteBehaviorDetectionRuleDELETE /api/v1/behaviors/{behaviorId}Delete a behavior detection rule
GetBehaviorDetectionRuleGET /api/v1/behaviors/{behaviorId}Retrieve a behavior detection rule
ListBehaviorDetectionRulesGET /api/v1/behaviorsList all behavior detection rules
ReplaceBehaviorDetectionRulePUT /api/v1/behaviors/{behaviorId}Replace a behavior detection rule

ActivateBehaviorDetectionRule

BehaviorRule ActivateBehaviorDetectionRule (string behaviorId)

Activate a behavior detection rule

Activates a behavior detection rule

Example

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

namespace Example
{
    public class ActivateBehaviorDetectionRuleExample
    {
        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 BehaviorApi(config);
            var behaviorId = abcd1234;  // string | ID of the Behavior Detection Rule

            try
            {
                // Activate a behavior detection rule
                BehaviorRule result = apiInstance.ActivateBehaviorDetectionRule(behaviorId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.ActivateBehaviorDetectionRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
behaviorIdstringID of the Behavior Detection Rule

Return type

BehaviorRule

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]

CreateBehaviorDetectionRule

BehaviorRule CreateBehaviorDetectionRule (BehaviorRule rule)

Create a behavior detection rule

Creates a new behavior detection rule

Example

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

namespace Example
{
    public class CreateBehaviorDetectionRuleExample
    {
        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 BehaviorApi(config);
            var rule = new BehaviorRule(); // BehaviorRule | 

            try
            {
                // Create a behavior detection rule
                BehaviorRule result = apiInstance.CreateBehaviorDetectionRule(rule);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.CreateBehaviorDetectionRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
ruleBehaviorRule

Return type

BehaviorRule

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Created-
400Bad Request-
403Forbidden-
429Too Many Requests-

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

DeactivateBehaviorDetectionRule

BehaviorRule DeactivateBehaviorDetectionRule (string behaviorId)

Deactivate a behavior detection rule

Deactivates a behavior detection rule

Example

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

namespace Example
{
    public class DeactivateBehaviorDetectionRuleExample
    {
        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 BehaviorApi(config);
            var behaviorId = abcd1234;  // string | ID of the Behavior Detection Rule

            try
            {
                // Deactivate a behavior detection rule
                BehaviorRule result = apiInstance.DeactivateBehaviorDetectionRule(behaviorId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.DeactivateBehaviorDetectionRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
behaviorIdstringID of the Behavior Detection Rule

Return type

BehaviorRule

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]

DeleteBehaviorDetectionRule

void DeleteBehaviorDetectionRule (string behaviorId)

Delete a behavior detection rule

Deletes a Behavior Detection Rule by behaviorId

Example

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

namespace Example
{
    public class DeleteBehaviorDetectionRuleExample
    {
        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 BehaviorApi(config);
            var behaviorId = abcd1234;  // string | ID of the Behavior Detection Rule

            try
            {
                // Delete a behavior detection rule
                apiInstance.DeleteBehaviorDetectionRule(behaviorId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.DeleteBehaviorDetectionRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
behaviorIdstringID of the Behavior Detection Rule

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
204No Content-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetBehaviorDetectionRule

BehaviorRule GetBehaviorDetectionRule (string behaviorId)

Retrieve a behavior detection rule

Retrieves a Behavior Detection Rule by behaviorId

Example

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

namespace Example
{
    public class GetBehaviorDetectionRuleExample
    {
        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 BehaviorApi(config);
            var behaviorId = abcd1234;  // string | ID of the Behavior Detection Rule

            try
            {
                // Retrieve a behavior detection rule
                BehaviorRule result = apiInstance.GetBehaviorDetectionRule(behaviorId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.GetBehaviorDetectionRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
behaviorIdstringID of the Behavior Detection Rule

Return type

BehaviorRule

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

ListBehaviorDetectionRules

List<BehaviorRule> ListBehaviorDetectionRules ()

List all behavior detection rules

Lists all behavior detection rules with pagination support

Example

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

namespace Example
{
    public class ListBehaviorDetectionRulesExample
    {
        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 BehaviorApi(config);

            try
            {
                // List all behavior detection rules
                List<BehaviorRule> result = apiInstance.ListBehaviorDetectionRules().ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.ListBehaviorDetectionRules: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<BehaviorRule>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
429Too Many Requests-

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

ReplaceBehaviorDetectionRule

BehaviorRule ReplaceBehaviorDetectionRule (string behaviorId, BehaviorRule rule)

Replace a behavior detection rule

Replaces a Behavior Detection Rule by behaviorId

Example

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

namespace Example
{
    public class ReplaceBehaviorDetectionRuleExample
    {
        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 BehaviorApi(config);
            var behaviorId = abcd1234;  // string | ID of the Behavior Detection Rule
            var rule = new BehaviorRule(); // BehaviorRule | 

            try
            {
                // Replace a behavior detection rule
                BehaviorRule result = apiInstance.ReplaceBehaviorDetectionRule(behaviorId, rule);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BehaviorApi.ReplaceBehaviorDetectionRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
behaviorIdstringID of the Behavior Detection Rule
ruleBehaviorRule

Return type

BehaviorRule

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Created-
400Bad Request-
403Forbidden-
404Not Found-
429Too Many Requests-

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