Class DeviceApi

java.lang.Object
com.okta.sdk.resource.api.DeviceApi

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2026-03-13T17:36:05.533634+05:30[Asia/Kolkata]", comments="Generator version: 7.15.0") public class DeviceApi extends Object
  • Constructor Details

    • DeviceApi

      public DeviceApi()
    • DeviceApi

      public DeviceApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • activateDevice

      public void activateDevice(String deviceId) throws ApiException
      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.
      Parameters:
      deviceId - `id` of the device (required)
      Throws:
      ApiException - if fails to make API call
    • activateDevice

      public void activateDevice(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      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.
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deactivateDevice

      public void deactivateDevice(String deviceId) throws ApiException
      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.
      Parameters:
      deviceId - `id` of the device (required)
      Throws:
      ApiException - if fails to make API call
    • deactivateDevice

      public void deactivateDevice(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      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.
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteDevice

      public void deleteDevice(String deviceId) throws ApiException
      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](/openapi/okta-management/management/tag/Device/#tag/Device/operation/deactivateDevice) 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.
      Parameters:
      deviceId - `id` of the device (required)
      Throws:
      ApiException - if fails to make API call
    • deleteDevice

      public void deleteDevice(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      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](/openapi/okta-management/management/tag/Device/#tag/Device/operation/deactivateDevice) 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.
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getDevice

      public Device getDevice(String deviceId) throws ApiException
      Retrieve a device Retrieves a device by `deviceId`
      Parameters:
      deviceId - `id` of the device (required)
      Returns:
      Device
      Throws:
      ApiException - if fails to make API call
    • getDevice

      public Device getDevice(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve a device Retrieves a device by `deviceId`
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Device
      Throws:
      ApiException - if fails to make API call
    • listDeviceUsers

      public List<DeviceUser> listDeviceUsers(String deviceId) throws ApiException
      List all users for a device Lists all Users for a device by `deviceId`
      Parameters:
      deviceId - `id` of the device (required)
      Returns:
      List<DeviceUser>
      Throws:
      ApiException - if fails to make API call
    • listDeviceUsers

      public List<DeviceUser> listDeviceUsers(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      List all users for a device Lists all Users for a device by `deviceId`
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<DeviceUser>
      Throws:
      ApiException - if fails to make API call
    • listDeviceUsersPaged

      public Iterable<DeviceUser> listDeviceUsersPaged(String deviceId)
      List all users for a device (Paginated) Lists all Users for a device by `deviceId` This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.
      Parameters:
      deviceId - `id` of the device (required)
      Returns:
      Iterable<DeviceUser> lazy iterable over all pages
    • listDeviceUsersPaged

      public Iterable<DeviceUser> listDeviceUsersPaged(String deviceId, Map<String,String> additionalHeaders)
      List all users for a device (Paginated with additional headers) Lists all Users for a device by `deviceId` This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additional headers for this call
      Returns:
      Iterable<DeviceUser> lazy iterable over all pages
    • listDevices

      public List<DeviceList> listDevices(String after, Integer limit, String search, String expand) throws ApiException
      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](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserDevices). 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:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information. 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](https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1). For example, `search=profile.displayName eq \"Bob\"` is encoded as `search=profile.displayName%20eq%20%22Bob%22`.
      Parameters:
      after - (optional)
      limit - A limit on the number of objects to return (recommend `20`) (optional, default to 200)
      search - 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)
      expand - Includes associated user details and management status for the device in the `_embedded` attribute (optional)
      Returns:
      List<DeviceList>
      Throws:
      ApiException - if fails to make API call
    • listDevices

      public List<DeviceList> listDevices(String after, Integer limit, String search, String expand, Map<String,String> additionalHeaders) throws ApiException
      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](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserDevices). 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:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information. 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](https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1). For example, `search=profile.displayName eq \"Bob\"` is encoded as `search=profile.displayName%20eq%20%22Bob%22`.
      Parameters:
      after - (optional)
      limit - A limit on the number of objects to return (recommend `20`) (optional, default to 200)
      search - 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)
      expand - Includes associated user details and management status for the device in the `_embedded` attribute (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<DeviceList>
      Throws:
      ApiException - if fails to make API call
    • listDevicesPaged

      public Iterable<DeviceList> listDevicesPaged(String after, Integer limit, String search, String expand)
      List all devices (Paginated) 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](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserDevices). 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:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information. 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](https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1). For example, `search=profile.displayName eq \"Bob\"` is encoded as `search=profile.displayName%20eq%20%22Bob%22`. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.
      Parameters:
      after - (optional)
      limit - A limit on the number of objects to return (recommend `20`) (optional, default to 200)
      search - 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)
      expand - Includes associated user details and management status for the device in the `_embedded` attribute (optional)
      Returns:
      Iterable<DeviceList> lazy iterable over all pages
    • listDevicesPaged

      public Iterable<DeviceList> listDevicesPaged(String after, Integer limit, String search, String expand, Map<String,String> additionalHeaders)
      List all devices (Paginated with additional headers) 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](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserDevices). 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:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information. 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](https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1). For example, `search=profile.displayName eq \"Bob\"` is encoded as `search=profile.displayName%20eq%20%22Bob%22`. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.
      Parameters:
      after - (optional)
      limit - A limit on the number of objects to return (recommend `20`) (optional, default to 200)
      search - 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)
      expand - Includes associated user details and management status for the device in the `_embedded` attribute (optional)
      additionalHeaders - additional headers for this call
      Returns:
      Iterable<DeviceList> lazy iterable over all pages
    • suspendDevice

      public void suspendDevice(String deviceId) throws ApiException
      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.
      Parameters:
      deviceId - `id` of the device (required)
      Throws:
      ApiException - if fails to make API call
    • suspendDevice

      public void suspendDevice(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      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.
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • unsuspendDevice

      public void unsuspendDevice(String deviceId) throws ApiException
      Unsuspend a Device Unsuspends a device by returning its `status` to `ACTIVE`. >**Note:** Only devices with a `SUSPENDED` status can be unsuspended.
      Parameters:
      deviceId - `id` of the device (required)
      Throws:
      ApiException - if fails to make API call
    • unsuspendDevice

      public void unsuspendDevice(String deviceId, Map<String,String> additionalHeaders) throws ApiException
      Unsuspend a Device Unsuspends a device by returning its `status` to `ACTIVE`. >**Note:** Only devices with a `SUSPENDED` status can be unsuspended.
      Parameters:
      deviceId - `id` of the device (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

      protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()