Okta.Sdk.Api.DevicePostureCheckApi

October 22, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
CreateDevicePostureCheckPOST /api/v1/device-posture-checksCreate a device posture check
DeleteDevicePostureCheckDELETE /api/v1/device-posture-checks/{postureCheckId}Delete a device posture check
GetDevicePostureCheckGET /api/v1/device-posture-checks/{postureCheckId}Retrieve a device posture check
ListDefaultDevicePostureChecksGET /api/v1/device-posture-checks/defaultList all default device posture checks
ListDevicePostureChecksGET /api/v1/device-posture-checksList all device posture checks
ReplaceDevicePostureCheckPUT /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

NameTypeDescriptionNotes
devicePostureCheckDevicePostureCheck

Return type

DevicePostureCheck

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
400Bad Request-
403Forbidden-
429Too 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

NameTypeDescriptionNotes
postureCheckIdstringID of the device posture check

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
204No Content-
403Forbidden-
404Not Found-
409Conflict-
429Too 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

NameTypeDescriptionNotes
postureCheckIdstringID of the device posture check

Return type

DevicePostureCheck

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
404Not Found-
429Too 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

List<DevicePostureCheck>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
429Too 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

List<DevicePostureCheck>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
429Too 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

NameTypeDescriptionNotes
postureCheckIdstringID of the device posture check
devicePostureCheckDevicePostureCheck

Return type

DevicePostureCheck

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
400Bad Request-
403Forbidden-
404Not Found-
429Too Many Requests-

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