Okta.Sdk.Api.AuthorizationServerPoliciesApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| ActivateAuthorizationServerPolicy | POST /api/v1/authorizationServers/{authServerId}/policies/{policyId}/lifecycle/activate | Activate a policy |
| CreateAuthorizationServerPolicy | POST /api/v1/authorizationServers/{authServerId}/policies | Create a policy |
| DeactivateAuthorizationServerPolicy | POST /api/v1/authorizationServers/{authServerId}/policies/{policyId}/lifecycle/deactivate | Deactivate a policy |
| DeleteAuthorizationServerPolicy | DELETE /api/v1/authorizationServers/{authServerId}/policies/{policyId} | Delete a policy |
| GetAuthorizationServerPolicy | GET /api/v1/authorizationServers/{authServerId}/policies/{policyId} | Retrieve a policy |
| ListAuthorizationServerPolicies | GET /api/v1/authorizationServers/{authServerId}/policies | List all policies |
| ReplaceAuthorizationServerPolicy | PUT /api/v1/authorizationServers/{authServerId}/policies/{policyId} | Replace a policy |
ActivateAuthorizationServerPolicy
void ActivateAuthorizationServerPolicy (string authServerId, string policyId)
Activate a policy
Activates an authorization server 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 ActivateAuthorizationServerPolicyExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
var policyId = 00plrilJ7jZ66Gn0X0g3; // string | `id` of the Policy
try
{
// Activate a policy
apiInstance.ActivateAuthorizationServerPolicy(authServerId, policyId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.ActivateAuthorizationServerPolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server | |
| policyId | string | `id` of the Policy |
Return type
void (empty response body)
Authorization
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]
CreateAuthorizationServerPolicy
AuthorizationServerPolicy CreateAuthorizationServerPolicy (string authServerId, AuthorizationServerPolicy policy)
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 CreateAuthorizationServerPolicyExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
var policy = new AuthorizationServerPolicy(); // AuthorizationServerPolicy |
try
{
// Create a policy
AuthorizationServerPolicy result = apiInstance.CreateAuthorizationServerPolicy(authServerId, policy);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.CreateAuthorizationServerPolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server | |
| policy | AuthorizationServerPolicy |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
| 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]
DeactivateAuthorizationServerPolicy
void DeactivateAuthorizationServerPolicy (string authServerId, string policyId)
Deactivate a policy
Deactivates an authorization server 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 DeactivateAuthorizationServerPolicyExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
var policyId = 00plrilJ7jZ66Gn0X0g3; // string | `id` of the Policy
try
{
// Deactivate a policy
apiInstance.DeactivateAuthorizationServerPolicy(authServerId, policyId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.DeactivateAuthorizationServerPolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server | |
| policyId | string | `id` of the Policy |
Return type
void (empty response body)
Authorization
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]
DeleteAuthorizationServerPolicy
void DeleteAuthorizationServerPolicy (string authServerId, 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 DeleteAuthorizationServerPolicyExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
var policyId = 00plrilJ7jZ66Gn0X0g3; // string | `id` of the Policy
try
{
// Delete a policy
apiInstance.DeleteAuthorizationServerPolicy(authServerId, policyId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.DeleteAuthorizationServerPolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server | |
| policyId | string | `id` of the Policy |
Return type
void (empty response body)
Authorization
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]
GetAuthorizationServerPolicy
AuthorizationServerPolicy GetAuthorizationServerPolicy (string authServerId, string policyId)
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 GetAuthorizationServerPolicyExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
var policyId = 00plrilJ7jZ66Gn0X0g3; // string | `id` of the Policy
try
{
// Retrieve a policy
AuthorizationServerPolicy result = apiInstance.GetAuthorizationServerPolicy(authServerId, policyId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.GetAuthorizationServerPolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server | |
| policyId | string | `id` of the Policy |
Return type
Authorization
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]
ListAuthorizationServerPolicies
List<AuthorizationServerPolicy> ListAuthorizationServerPolicies (string authServerId)
List all policies
Lists all 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 ListAuthorizationServerPoliciesExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
try
{
// List all policies
List<AuthorizationServerPolicy> result = apiInstance.ListAuthorizationServerPolicies(authServerId).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.ListAuthorizationServerPolicies: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server |
Return type
List<AuthorizationServerPolicy>
Authorization
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]
ReplaceAuthorizationServerPolicy
AuthorizationServerPolicy ReplaceAuthorizationServerPolicy (string authServerId, string policyId, AuthorizationServerPolicy policy)
Replace a policy
Replaces 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 ReplaceAuthorizationServerPolicyExample
{
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 AuthorizationServerPoliciesApi(config);
var authServerId = GeGRTEr7f3yu2n7grw22; // string | `id` of the Authorization Server
var policyId = 00plrilJ7jZ66Gn0X0g3; // string | `id` of the Policy
var policy = new AuthorizationServerPolicy(); // AuthorizationServerPolicy |
try
{
// Replace a policy
AuthorizationServerPolicy result = apiInstance.ReplaceAuthorizationServerPolicy(authServerId, policyId, policy);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AuthorizationServerPoliciesApi.ReplaceAuthorizationServerPolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authServerId | string | `id` of the Authorization Server | |
| policyId | string | `id` of the Policy | |
| policy | AuthorizationServerPolicy |
Return type
Authorization
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]