Skip to content

Latest commit

 

History

History
1725 lines (1343 loc) · 54.4 KB

PolicyApi.md

File metadata and controls

1725 lines (1343 loc) · 54.4 KB

Okta.Sdk.Api.PolicyApi

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

Method HTTP request Description
ActivatePolicy POST /api/v1/policies/{policyId}/lifecycle/activate Activate a Policy
ActivatePolicyRule POST /api/v1/policies/{policyId}/rules/{ruleId}/lifecycle/activate Activate a Policy Rule
ClonePolicy POST /api/v1/policies/{policyId}/clone Clone an existing Policy
CreatePolicy POST /api/v1/policies Create a Policy
CreatePolicyRule POST /api/v1/policies/{policyId}/rules Create a Policy Rule
CreatePolicySimulation POST /api/v1/policies/simulate Create a Policy Simulation
DeactivatePolicy POST /api/v1/policies/{policyId}/lifecycle/deactivate Deactivate a Policy
DeactivatePolicyRule POST /api/v1/policies/{policyId}/rules/{ruleId}/lifecycle/deactivate Deactivate a Policy Rule
DeletePolicy DELETE /api/v1/policies/{policyId} Delete a Policy
DeletePolicyResourceMapping DELETE /api/v1/policies/{policyId}/mappings/{mappingId} Delete a policy resource Mapping
DeletePolicyRule DELETE /api/v1/policies/{policyId}/rules/{ruleId} Delete a Policy Rule
GetPolicy GET /api/v1/policies/{policyId} Retrieve a Policy
GetPolicyMapping GET /api/v1/policies/{policyId}/mappings/{mappingId} Retrieve a policy resource Mapping
GetPolicyRule GET /api/v1/policies/{policyId}/rules/{ruleId} Retrieve a Policy Rule
ListPolicies GET /api/v1/policies List all Policies
ListPolicyApps GET /api/v1/policies/{policyId}/app List all Applications mapped to a Policy
ListPolicyMappings GET /api/v1/policies/{policyId}/mappings List all resources mapped to a Policy
ListPolicyRules GET /api/v1/policies/{policyId}/rules List all Policy Rules
MapResourceToPolicy POST /api/v1/policies/{policyId}/mappings Map a resource to a Policy
ReplacePolicy PUT /api/v1/policies/{policyId} Replace a Policy
ReplacePolicyRule PUT /api/v1/policies/{policyId}/rules/{ruleId} Replace a Policy Rule

ActivatePolicy

void ActivatePolicy (string policyId)

Activate a Policy

Activates a policy

Example

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

namespace Example
{
    public class ActivatePolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // Activate a Policy
                apiInstance.ActivatePolicy(policyId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ActivatePolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ActivatePolicyRule

void ActivatePolicyRule (string policyId, string ruleId)

Activate a Policy Rule

Activates a Policy Rule identified by policyId and ruleId

Example

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

namespace Example
{
    public class ActivatePolicyRuleExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var ruleId = ruld3hJ7jZh4fn0st0g3;  // string | `id` of the Policy Rule

            try
            {
                // Activate a Policy Rule
                apiInstance.ActivatePolicyRule(policyId, ruleId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ActivatePolicyRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ClonePolicy

Policy ClonePolicy (string policyId)

Clone an existing Policy

Clones an existing policy

Example

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

namespace Example
{
    public class ClonePolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // Clone an existing Policy
                Policy result = apiInstance.ClonePolicy(policyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ClonePolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

Policy

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

CreatePolicy

Policy CreatePolicy (Policy policy, bool? activate = null)

Create a Policy

Creates a policy

Example

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

namespace Example
{
    public class CreatePolicyExample
    {
        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 PolicyApi(config);
            var policy = new Policy(); // Policy | 
            var activate = true;  // bool? | This query parameter is only valid for Classic Engine orgs. (optional)  (default to true)

            try
            {
                // Create a Policy
                Policy result = apiInstance.CreatePolicy(policy, activate);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.CreatePolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policy Policy
activate bool? This query parameter is only valid for Classic Engine orgs. [optional] [default to true]

Return type

Policy

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
429 Too Many Requests -

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

CreatePolicyRule

PolicyRule CreatePolicyRule (string policyId, PolicyRule policyRule, bool? activate = null)

Create a Policy Rule

Creates a policy rule. Note: You can't create additional rules for the PROFILE_ENROLLMENT or CONTINUOUS_ACCESS policies.

Example

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

namespace Example
{
    public class CreatePolicyRuleExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var policyRule = new PolicyRule(); // PolicyRule | 
            var activate = true;  // bool? | Set this parameter to `false` to create an `INACTIVE` rule. (optional)  (default to true)

            try
            {
                // Create a Policy Rule
                PolicyRule result = apiInstance.CreatePolicyRule(policyId, policyRule, activate);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.CreatePolicyRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
policyRule PolicyRule
activate bool? Set this parameter to `false` to create an `INACTIVE` rule. [optional] [default to true]

Return type

PolicyRule

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

CreatePolicySimulation

List<SimulatePolicyEvaluations> CreatePolicySimulation (List simulatePolicy, string expand = null)

Create a Policy Simulation

Creates a policy or policy rule simulation. The access simulation evaluates policy and policy rules based on the existing policy rule configuration. The evaluation result simulates what the real-world authentication flow is and what policy rules have been applied or matched to the authentication flow.

Example

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

namespace Example
{
    public class CreatePolicySimulationExample
    {
        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 PolicyApi(config);
            var simulatePolicy = new List<SimulatePolicyBody>(); // List<SimulatePolicyBody> | 
            var expand = expand=EVALUATED&expand=RULE;  // string | Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition was (not) matched. (optional) 

            try
            {
                // Create a Policy Simulation
                List<SimulatePolicyEvaluations> result = apiInstance.CreatePolicySimulation(simulatePolicy, expand).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.CreatePolicySimulation: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
simulatePolicy List<SimulatePolicyBody>
expand string Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition was (not) matched. [optional]

Return type

List<SimulatePolicyEvaluations>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeactivatePolicy

void DeactivatePolicy (string policyId)

Deactivate a Policy

Deactivates a policy

Example

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

namespace Example
{
    public class DeactivatePolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // Deactivate a Policy
                apiInstance.DeactivatePolicy(policyId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.DeactivatePolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeactivatePolicyRule

void DeactivatePolicyRule (string policyId, string ruleId)

Deactivate a Policy Rule

Deactivates a Policy Rule identified by policyId and ruleId

Example

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

namespace Example
{
    public class DeactivatePolicyRuleExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var ruleId = ruld3hJ7jZh4fn0st0g3;  // string | `id` of the Policy Rule

            try
            {
                // Deactivate a Policy Rule
                apiInstance.DeactivatePolicyRule(policyId, ruleId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.DeactivatePolicyRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeletePolicy

void DeletePolicy (string policyId)

Delete a Policy

Deletes a policy

Example

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

namespace Example
{
    public class DeletePolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // Delete a Policy
                apiInstance.DeletePolicy(policyId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.DeletePolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeletePolicyResourceMapping

void DeletePolicyResourceMapping (string policyId, string mappingId)

Delete a policy resource Mapping

Deletes the resource Mapping for a Policy identified by policyId and mappingId

Example

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

namespace Example
{
    public class DeletePolicyResourceMappingExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var mappingId = maplr2rLjZ6NsGn1P0g3;  // string | `id` of the policy resource Mapping

            try
            {
                // Delete a policy resource Mapping
                apiInstance.DeletePolicyResourceMapping(policyId, mappingId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.DeletePolicyResourceMapping: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
mappingId string `id` of the policy resource Mapping

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeletePolicyRule

void DeletePolicyRule (string policyId, string ruleId)

Delete a Policy Rule

Deletes a Policy Rule identified by policyId and ruleId

Example

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

namespace Example
{
    public class DeletePolicyRuleExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var ruleId = ruld3hJ7jZh4fn0st0g3;  // string | `id` of the Policy Rule

            try
            {
                // Delete a Policy Rule
                apiInstance.DeletePolicyRule(policyId, ruleId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.DeletePolicyRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

GetPolicy

Policy GetPolicy (string policyId, string expand = null)

Retrieve a Policy

Retrieves a policy

Example

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

namespace Example
{
    public class GetPolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var expand = "\"\"";  // string |  (optional)  (default to "")

            try
            {
                // Retrieve a Policy
                Policy result = apiInstance.GetPolicy(policyId, expand);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.GetPolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
expand string [optional] [default to ""]

Return type

Policy

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

GetPolicyMapping

PolicyMapping GetPolicyMapping (string policyId, string mappingId)

Retrieve a policy resource Mapping

Retrieves a resource Mapping for a Policy identified by policyId and mappingId

Example

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

namespace Example
{
    public class GetPolicyMappingExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var mappingId = maplr2rLjZ6NsGn1P0g3;  // string | `id` of the policy resource Mapping

            try
            {
                // Retrieve a policy resource Mapping
                PolicyMapping result = apiInstance.GetPolicyMapping(policyId, mappingId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.GetPolicyMapping: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
mappingId string `id` of the policy resource Mapping

Return type

PolicyMapping

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

GetPolicyRule

PolicyRule GetPolicyRule (string policyId, string ruleId)

Retrieve a Policy Rule

Retrieves a policy 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 GetPolicyRuleExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var ruleId = ruld3hJ7jZh4fn0st0g3;  // string | `id` of the Policy Rule

            try
            {
                // Retrieve a Policy Rule
                PolicyRule result = apiInstance.GetPolicyRule(policyId, ruleId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.GetPolicyRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule

Return type

PolicyRule

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ListPolicies

List<Policy> ListPolicies (PolicyType type, string status = null, string expand = null, string sortBy = null, string limit = null, string after = null)

List all Policies

Lists all policies with the specified type

Example

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

namespace Example
{
    public class ListPoliciesExample
    {
        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 PolicyApi(config);
            var type = "OKTA_SIGN_ON";  // PolicyType | Specifies the type of policy to return. The following policy types are available only with the Okta Identity Engine - `ACCESS_POLICY`, `PROFILE_ENROLLMENT`, `CONTINUOUS_ACCESS`, and `ENTITY_RISK`. The `CONTINUOUS_ACCESS` and `ENTITY_RISK` are in Early Access (EA). Contact your Okta account team to enable these features.
            var status = "status_example";  // string | Refines the query by the `status` of the policy - `ACTIVE` or `INACTIVE` (optional) 
            var expand = "\"\"";  // string |  (optional)  (default to "")
            var sortBy = "sortBy_example";  // string | Refines the query by sorting on the policy `name` in ascending order (optional) 
            var limit = "limit_example";  // string | Defines the number of policies returned, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional) 
            var after = "after_example";  // string | End page cursor for pagination, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional) 

            try
            {
                // List all Policies
                List<Policy> result = apiInstance.ListPolicies(type, status, expand, sortBy, limit, after).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ListPolicies: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
type PolicyType Specifies the type of policy to return. The following policy types are available only with the Okta Identity Engine - `ACCESS_POLICY`, `PROFILE_ENROLLMENT`, `CONTINUOUS_ACCESS`, and `ENTITY_RISK`. The `CONTINUOUS_ACCESS` and `ENTITY_RISK` are in Early Access (EA). Contact your Okta account team to enable these features.
status string Refines the query by the `status` of the policy - `ACTIVE` or `INACTIVE` [optional]
expand string [optional] [default to ""]
sortBy string Refines the query by sorting on the policy `name` in ascending order [optional]
limit string Defines the number of policies returned, see Pagination [optional]
after string End page cursor for pagination, see Pagination [optional]

Return type

List<Policy>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
429 Too Many Requests -

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

ListPolicyApps

List<Application> ListPolicyApps (string policyId)

List all Applications mapped to a Policy

Lists all applications mapped to a policy identified by policyId > Note: Use List all resources mapped to a Policy to list all applications mapped to a policy.

Example

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

namespace Example
{
    public class ListPolicyAppsExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // List all Applications mapped to a Policy
                List<Application> result = apiInstance.ListPolicyApps(policyId).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ListPolicyApps: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

List<Application>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ListPolicyMappings

List<PolicyMapping> ListPolicyMappings (string policyId)

List all resources mapped to a Policy

Lists all resources mapped to a Policy identified by policyId

Example

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

namespace Example
{
    public class ListPolicyMappingsExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // List all resources mapped to a Policy
                List<PolicyMapping> result = apiInstance.ListPolicyMappings(policyId).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ListPolicyMappings: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

List<PolicyMapping>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ListPolicyRules

List<PolicyRule> ListPolicyRules (string policyId)

List all Policy Rules

Lists all policy rules

Example

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

namespace Example
{
    public class ListPolicyRulesExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy

            try
            {
                // List all Policy Rules
                List<PolicyRule> result = apiInstance.ListPolicyRules(policyId).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ListPolicyRules: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy

Return type

List<PolicyRule>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

MapResourceToPolicy

PolicyMapping MapResourceToPolicy (string policyId, PolicyMappingRequest policyMappingRequest)

Map a resource to a Policy

Maps a resource to a Policy identified by policyId

Example

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

namespace Example
{
    public class MapResourceToPolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var policyMappingRequest = new PolicyMappingRequest(); // PolicyMappingRequest | 

            try
            {
                // Map a resource to a Policy
                PolicyMapping result = apiInstance.MapResourceToPolicy(policyId, policyMappingRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.MapResourceToPolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
policyMappingRequest PolicyMappingRequest

Return type

PolicyMapping

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ReplacePolicy

Policy ReplacePolicy (string policyId, Policy policy)

Replace a Policy

Replaces the properties of a Policy identified by policyId

Example

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

namespace Example
{
    public class ReplacePolicyExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var policy = new Policy(); // Policy | 

            try
            {
                // Replace a Policy
                Policy result = apiInstance.ReplacePolicy(policyId, policy);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ReplacePolicy: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
policy Policy

Return type

Policy

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ReplacePolicyRule

PolicyRule ReplacePolicyRule (string policyId, string ruleId, PolicyRule policyRule)

Replace a Policy Rule

Replaces the properties for a Policy Rule identified by policyId and ruleId

Example

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

namespace Example
{
    public class ReplacePolicyRuleExample
    {
        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 PolicyApi(config);
            var policyId = 00plrilJ7jZ66Gn0X0g3;  // string | `id` of the Policy
            var ruleId = ruld3hJ7jZh4fn0st0g3;  // string | `id` of the Policy Rule
            var policyRule = new PolicyRule(); // PolicyRule | 

            try
            {
                // Replace a Policy Rule
                PolicyRule result = apiInstance.ReplacePolicyRule(policyId, ruleId, policyRule);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PolicyApi.ReplacePolicyRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
policyId string `id` of the Policy
ruleId string `id` of the Policy Rule
policyRule PolicyRule

Return type

PolicyRule

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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