Okta.Sdk.Api.DeviceAssuranceApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| CreateDeviceAssurancePolicy | POST /api/v1/device-assurances | Create a device assurance policy |
| DeleteDeviceAssurancePolicy | DELETE /api/v1/device-assurances/{deviceAssuranceId} | Delete a device assurance policy |
| GetDeviceAssurancePolicy | GET /api/v1/device-assurances/{deviceAssuranceId} | Retrieve a device assurance policy |
| ListDeviceAssurancePolicies | GET /api/v1/device-assurances | List all device assurance policies |
| ReplaceDeviceAssurancePolicy | PUT /api/v1/device-assurances/{deviceAssuranceId} | Replace a device assurance policy |
CreateDeviceAssurancePolicy
DeviceAssurance CreateDeviceAssurancePolicy (DeviceAssurance deviceAssurance)
Create a device assurance policy
Creates a new device assurance 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 CreateDeviceAssurancePolicyExample
{
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 DeviceAssuranceApi(config);
var deviceAssurance = new DeviceAssurance(); // DeviceAssurance |
try
{
// Create a device assurance policy
DeviceAssurance result = apiInstance.CreateDeviceAssurancePolicy(deviceAssurance);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceAssuranceApi.CreateDeviceAssurancePolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceAssurance | DeviceAssurance |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteDeviceAssurancePolicy
void DeleteDeviceAssurancePolicy (string deviceAssuranceId)
Delete a device assurance policy
Deletes a device assurance policy by deviceAssuranceId. If the device assurance policy is currently being used in the org Authentication Policies, the delete will not be allowed.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeleteDeviceAssurancePolicyExample
{
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 DeviceAssuranceApi(config);
var deviceAssuranceId = "deviceAssuranceId_example"; // string | Id of the device assurance policy
try
{
// Delete a device assurance policy
apiInstance.DeleteDeviceAssurancePolicy(deviceAssuranceId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceAssuranceApi.DeleteDeviceAssurancePolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceAssuranceId | string | Id of the device assurance 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 | - |
| 409 | Conflict | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDeviceAssurancePolicy
DeviceAssurance GetDeviceAssurancePolicy (string deviceAssuranceId)
Retrieve a device assurance policy
Retrieves a device assurance policy by deviceAssuranceId
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetDeviceAssurancePolicyExample
{
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 DeviceAssuranceApi(config);
var deviceAssuranceId = "deviceAssuranceId_example"; // string | Id of the device assurance policy
try
{
// Retrieve a device assurance policy
DeviceAssurance result = apiInstance.GetDeviceAssurancePolicy(deviceAssuranceId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceAssuranceApi.GetDeviceAssurancePolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceAssuranceId | string | Id of the device assurance policy |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListDeviceAssurancePolicies
List<DeviceAssurance> ListDeviceAssurancePolicies ()
List all device assurance policies
Lists all device assurance 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 ListDeviceAssurancePoliciesExample
{
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 DeviceAssuranceApi(config);
try
{
// List all device assurance policies
List<DeviceAssurance> result = apiInstance.ListDeviceAssurancePolicies().ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceAssuranceApi.ListDeviceAssurancePolicies: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 403 | Forbidden | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReplaceDeviceAssurancePolicy
DeviceAssurance ReplaceDeviceAssurancePolicy (string deviceAssuranceId, DeviceAssurance deviceAssurance)
Replace a device assurance policy
Replaces a device assurance policy by deviceAssuranceId
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ReplaceDeviceAssurancePolicyExample
{
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 DeviceAssuranceApi(config);
var deviceAssuranceId = "deviceAssuranceId_example"; // string | Id of the device assurance policy
var deviceAssurance = new DeviceAssurance(); // DeviceAssurance |
try
{
// Replace a device assurance policy
DeviceAssurance result = apiInstance.ReplaceDeviceAssurancePolicy(deviceAssuranceId, deviceAssurance);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceAssuranceApi.ReplaceDeviceAssurancePolicy: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceAssuranceId | string | Id of the device assurance policy | |
| deviceAssurance | DeviceAssurance |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 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]