Okta.Sdk.Api.DeviceApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| ActivateDevice | POST /api/v1/devices/{deviceId}/lifecycle/activate | Activate a device |
| DeactivateDevice | POST /api/v1/devices/{deviceId}/lifecycle/deactivate | Deactivate a device |
| DeleteDevice | DELETE /api/v1/devices/{deviceId} | Delete a device |
| GetDevice | GET /api/v1/devices/{deviceId} | Retrieve a device |
| ListDeviceUsers | GET /api/v1/devices/{deviceId}/users | List all users for a device |
| ListDevices | GET /api/v1/devices | List all devices |
| SuspendDevice | POST /api/v1/devices/{deviceId}/lifecycle/suspend | Suspend a Device |
| UnsuspendDevice | POST /api/v1/devices/{deviceId}/lifecycle/unsuspend | Unsuspend a Device |
ActivateDevice
void ActivateDevice (string deviceId)
Activate a device
Activates a device by setting its status to ACTIVE by deviceId. Activated devices are used to create and delete device user links.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ActivateDeviceExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// Activate a device
apiInstance.ActivateDevice(deviceId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.ActivateDevice: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]
DeactivateDevice
void DeactivateDevice (string deviceId)
Deactivate a device
Deactivates a device by setting its status to DEACTIVATED by deviceId. Deactivation causes a device to lose all device user links. Set the device status to DEACTIVATED before deleting it. > Note: When deactivating a Device, keep in mind the following: - Device deactivation is a destructive operation for device factors and client certificates. Device reenrollment using Okta Verify allows end users to set up new factors on the device. - Device deletion removes the device record from Okta. Reenrollment creates a new device record.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeactivateDeviceExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// Deactivate a device
apiInstance.DeactivateDevice(deviceId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.DeactivateDevice: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]
DeleteDevice
void DeleteDevice (string deviceId)
Delete a device
Deletes (permanently) a device by deviceId if it has a status of DEACTIVATED. You can transition the device to DEACTIVATED status using the Deactivate a Device endpoint. This request is destructive and deletes all of the profile data related to the device. Once deleted, device data can't be recovered. However, reenrollment creates a new device record. > Note: Attempts to delete a device that isn't in a DEACTIVATED state raise an error.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeleteDeviceExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// Delete a device
apiInstance.DeleteDevice(deviceId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.DeleteDevice: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]
GetDevice
Device GetDevice (string deviceId)
Retrieve a device
Retrieves a device by deviceId
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetDeviceExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// Retrieve a device
Device result = apiInstance.GetDevice(deviceId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.GetDevice: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]
ListDeviceUsers
List<DeviceUser> ListDeviceUsers (string deviceId)
List all users for a device
Lists all Users for a device by deviceId
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListDeviceUsersExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// List all users for a device
List<DeviceUser> result = apiInstance.ListDeviceUsers(deviceId).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.ListDeviceUsers: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]
ListDevices
List<DeviceList> ListDevices (string after = null, int? limit = null, string search = null, DeviceExpandParameter? expand = null)
List all devices
Lists all devices with pagination support. >Note: To list all devices enrolled by a user, use the List all devices endpoint in the User Resources API. You can return a subset of devices that match a supported search criteria using the search query parameter. Searches for devices based on the properties specified in the search parameter conforming SCIM filter specifications (case-insensitive). This data is eventually consistent. The API returns different results depending on specified queries in the request. Empty list is returned if no objects match search request. > Note: Listing devices with search should not be used as a part of any critical flow, such as authentication or updates, to prevent potential data loss. search results may not reflect the latest information, as this endpoint uses a search index which may not be up-to-date with recent updates to the object. Don't use search results directly for record updates, as the data might be stale and therefore overwrite newer data, resulting in data loss. Use an id lookup for records that you update to ensure your results contain the latest data. This operation requires URL encoding. For example, search=profile.displayName eq \"Bob\" is encoded as search=profile.displayName%20eq%20%22Bob%22.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListDevicesExample
{
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 DeviceApi(config);
var after = 200u3des4afA47rYJu1d7; // string | (optional)
var limit = 20; // int? | A limit on the number of objects to return (recommend `20`) (optional) (default to 200)
var search = status%20eq%20%22ACTIVE%22; // string | A SCIM filter expression that filters the results. Searches include all device `profile` properties and the device `id`, `status`, and `lastUpdated` properties. Searches for devices can be filtered by the contains (`co`) operator. You can only use `co` with these select device profile attributes: `profile.displayName`, `profile.serialNumber`, `profile.imei`, `profile.meid`, `profile.udid`, and `profile.sid`. See [Operators](https://developer.okta.com/docs/api/#operators). (optional)
var expand = user; // DeviceExpandParameter? | Includes associated user details and management status for the device in the `_embedded` attribute (optional)
try
{
// List all devices
List<DeviceList> result = apiInstance.ListDevices(after, limit, search, expand).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.ListDevices: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| after | string | [optional] | |
| limit | int? | A limit on the number of objects to return (recommend `20`) | [optional] [default to 200] |
| search | string | A SCIM filter expression that filters the results. Searches include all device `profile` properties and the device `id`, `status`, and `lastUpdated` properties. Searches for devices can be filtered by the contains (`co`) operator. You can only use `co` with these select device profile attributes: `profile.displayName`, `profile.serialNumber`, `profile.imei`, `profile.meid`, `profile.udid`, and `profile.sid`. See Operators. | [optional] |
| expand | DeviceExpandParameter? | Includes associated user details and management status for the device in the `_embedded` attribute | [optional] |
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]
SuspendDevice
void SuspendDevice (string deviceId)
Suspend a Device
Suspends a device by setting its status to SUSPENDED. Use suspended devices to create and delete device user links. You can only unsuspend or deactivate suspended devices. > Note: SUSPENDED status is meant to be temporary, so it isn't destructive.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class SuspendDeviceExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// Suspend a Device
apiInstance.SuspendDevice(deviceId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.SuspendDevice: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]
UnsuspendDevice
void UnsuspendDevice (string deviceId)
Unsuspend a Device
Unsuspends a device by returning its status to ACTIVE. >Note: Only devices with a SUSPENDED status can be unsuspended.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class UnsuspendDeviceExample
{
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 DeviceApi(config);
var deviceId = guo4a5u7JHHhjXrMK0g4; // string | `id` of the device
try
{
// Unsuspend a Device
apiInstance.UnsuspendDevice(deviceId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DeviceApi.UnsuspendDevice: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | string | `id` of the device |
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]