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 |
void ActivatePolicy (string policyId)
Activate a Policy
Activates a policy
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
void ActivatePolicyRule (string policyId, string ruleId)
Activate a Policy Rule
Activates a Policy Rule identified by policyId
and ruleId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
ruleId | string | `id` of the Policy Rule |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
Policy ClonePolicy (string policyId)
Clone an existing Policy
Clones an existing policy
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
- Content-Type: Not defined
- Accept: application/json
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]
Policy CreatePolicy (Policy policy, bool? activate = null)
Create a Policy
Creates a policy
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policy | Policy | ||
activate | bool? | This query parameter is only valid for Classic Engine orgs. | [optional] [default to true] |
- Content-Type: application/json
- Accept: application/json
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]
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.
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);
}
}
}
}
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] |
- Content-Type: application/json
- Accept: application/json
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]
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.
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);
}
}
}
}
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] |
List<SimulatePolicyEvaluations>
- Content-Type: application/json
- Accept: application/json
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]
void DeactivatePolicy (string policyId)
Deactivate a Policy
Deactivates a policy
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
void DeactivatePolicyRule (string policyId, string ruleId)
Deactivate a Policy Rule
Deactivates a Policy Rule identified by policyId
and ruleId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
ruleId | string | `id` of the Policy Rule |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
void DeletePolicy (string policyId)
Delete a Policy
Deletes a policy
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
void DeletePolicyResourceMapping (string policyId, string mappingId)
Delete a policy resource Mapping
Deletes the resource Mapping for a Policy identified by policyId
and mappingId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
mappingId | string | `id` of the policy resource Mapping |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
void DeletePolicyRule (string policyId, string ruleId)
Delete a Policy Rule
Deletes a Policy Rule identified by policyId
and ruleId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
ruleId | string | `id` of the Policy Rule |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
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]
Policy GetPolicy (string policyId, string expand = null)
Retrieve a Policy
Retrieves a policy
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
expand | string | [optional] [default to ""] |
- Content-Type: Not defined
- Accept: application/json
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]
PolicyMapping GetPolicyMapping (string policyId, string mappingId)
Retrieve a policy resource Mapping
Retrieves a resource Mapping for a Policy identified by policyId
and mappingId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
mappingId | string | `id` of the policy resource Mapping |
- Content-Type: Not defined
- Accept: application/json
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]
PolicyRule GetPolicyRule (string policyId, string ruleId)
Retrieve a Policy Rule
Retrieves a policy rule
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
ruleId | string | `id` of the Policy Rule |
- Content-Type: Not defined
- Accept: application/json
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]
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
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);
}
}
}
}
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] |
- Content-Type: Not defined
- Accept: application/json
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]
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.
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
- Content-Type: Not defined
- Accept: application/json
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]
List<PolicyMapping> ListPolicyMappings (string policyId)
List all resources mapped to a Policy
Lists all resources mapped to a Policy identified by policyId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
- Content-Type: Not defined
- Accept: application/json
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]
List<PolicyRule> ListPolicyRules (string policyId)
List all Policy Rules
Lists all policy rules
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy |
- Content-Type: Not defined
- Accept: application/json
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]
PolicyMapping MapResourceToPolicy (string policyId, PolicyMappingRequest policyMappingRequest)
Map a resource to a Policy
Maps a resource to a Policy identified by policyId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
policyMappingRequest | PolicyMappingRequest |
- Content-Type: application/json
- Accept: application/json
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]
Policy ReplacePolicy (string policyId, Policy policy)
Replace a Policy
Replaces the properties of a Policy identified by policyId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
policy | Policy |
- Content-Type: application/json
- Accept: application/json
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]
PolicyRule ReplacePolicyRule (string policyId, string ruleId, PolicyRule policyRule)
Replace a Policy Rule
Replaces the properties for a Policy Rule identified by policyId
and ruleId
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
policyId | string | `id` of the Policy | |
ruleId | string | `id` of the Policy Rule | |
policyRule | PolicyRule |
- Content-Type: application/json
- Accept: application/json
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]