Okta.Sdk.Api.DevicePostureCheckApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| CreateDevicePostureCheck | POST /api/v1/device-posture-checks | Create a device posture check |
| DeleteDevicePostureCheck | DELETE /api/v1/device-posture-checks/{postureCheckId} | Delete a device posture check |
| GetDevicePostureCheck | GET /api/v1/device-posture-checks/{postureCheckId} | Retrieve a device posture check |
| ListDefaultDevicePostureChecks | GET /api/v1/device-posture-checks/default | List all default device posture checks |
| ListDevicePostureChecks | GET /api/v1/device-posture-checks | List all device posture checks |
| ReplaceDevicePostureCheck | PUT /api/v1/device-posture-checks/{postureCheckId} | Replace a device posture check |
CreateDevicePostureCheck
DevicePostureCheck CreateDevicePostureCheck (DevicePostureCheck devicePostureCheck)
Create a device posture check
Creates a device posture check
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class CreateDevicePostureCheckExample
{
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 DevicePostureCheckApi(config);
var devicePostureCheck = new DevicePostureCheck(); // DevicePostureCheck |
try
{
// Create a device posture check
DevicePostureCheck result = apiInstance.CreateDevicePostureCheck(devicePostureCheck);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DevicePostureCheckApi.CreateDevicePostureCheck: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| devicePostureCheck | DevicePostureCheck |
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]
DeleteDevicePostureCheck
void DeleteDevicePostureCheck (string postureCheckId)
Delete a device posture check
Deletes a device posture check by postureCheckId. You can't delete the device posture check if it's used in a 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 DeleteDevicePostureCheckExample
{
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 DevicePostureCheckApi(config);
var postureCheckId = "postureCheckId_example"; // string | ID of the device posture check
try
{
// Delete a device posture check
apiInstance.DeleteDevicePostureCheck(postureCheckId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DevicePostureCheckApi.DeleteDevicePostureCheck: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| postureCheckId | string | ID of the device posture check |
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]
GetDevicePostureCheck
DevicePostureCheck GetDevicePostureCheck (string postureCheckId)
Retrieve a device posture check
Retrieves a device posture check by postureCheckId
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetDevicePostureCheckExample
{
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 DevicePostureCheckApi(config);
var postureCheckId = "postureCheckId_example"; // string | ID of the device posture check
try
{
// Retrieve a device posture check
DevicePostureCheck result = apiInstance.GetDevicePostureCheck(postureCheckId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DevicePostureCheckApi.GetDevicePostureCheck: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| postureCheckId | string | ID of the device posture check |
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]
ListDefaultDevicePostureChecks
List<DevicePostureCheck> ListDefaultDevicePostureChecks ()
List all default device posture checks
Lists all default device posture checks. Default device posture checks are defined by Okta. Their type will always be BUILTIN.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListDefaultDevicePostureChecksExample
{
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 DevicePostureCheckApi(config);
try
{
// List all default device posture checks
List<DevicePostureCheck> result = apiInstance.ListDefaultDevicePostureChecks().ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DevicePostureCheckApi.ListDefaultDevicePostureChecks: " + 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]
ListDevicePostureChecks
List<DevicePostureCheck> ListDevicePostureChecks ()
List all device posture checks
Lists all device posture checks
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListDevicePostureChecksExample
{
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 DevicePostureCheckApi(config);
try
{
// List all device posture checks
List<DevicePostureCheck> result = apiInstance.ListDevicePostureChecks().ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DevicePostureCheckApi.ListDevicePostureChecks: " + 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]
ReplaceDevicePostureCheck
DevicePostureCheck ReplaceDevicePostureCheck (string postureCheckId, DevicePostureCheck devicePostureCheck)
Replace a device posture check
Replaces a device posture check by postureCheckId
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ReplaceDevicePostureCheckExample
{
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 DevicePostureCheckApi(config);
var postureCheckId = "postureCheckId_example"; // string | ID of the device posture check
var devicePostureCheck = new DevicePostureCheck(); // DevicePostureCheck |
try
{
// Replace a device posture check
DevicePostureCheck result = apiInstance.ReplaceDevicePostureCheck(postureCheckId, devicePostureCheck);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DevicePostureCheckApi.ReplaceDevicePostureCheck: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| postureCheckId | string | ID of the device posture check | |
| devicePostureCheck | DevicePostureCheck |
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]