All URIs are relative to https://<sub_domain>.api.kandji.io
| Method | HTTP request | Description |
|---|---|---|
| cancel_lost_mode | DELETE /api/v1/devices/{device_id}/details/lostmode | Cancel Lost Mode |
| get_device | GET /api/v1/devices/{device_id} | Get Device |
| get_device_activity | GET /api/v1/devices/{device_id}/activity | Get Device Activity |
| get_device_apps | GET /api/v1/devices/{device_id}/apps | Get Device Apps |
| get_device_details | GET /api/v1/devices/{device_id}/details | Get Device Details |
| get_device_library_items | GET /api/v1/devices/{device_id}/library-items | Get Device Library Items |
| get_device_lost_mode_details | GET /api/v1/devices/{device_id}/details/lostmode | Get Device Lost Mode details |
| get_device_parameters | GET /api/v1/devices/{device_id}/parameters | Get Device Parameters |
| get_device_status | GET /api/v1/devices/{device_id}/status | Get Device Status |
| list_devices | GET /api/v1/devices | List Devices |
| update_device | PATCH /api/v1/devices/{device_id} | Update Device |
cancel_lost_mode(device_id)
Cancel Lost Mode
This endpoint can be used to send a cancelation request if Lost Mode is in an error state for a given iOS or iPadOS device.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Cancel Lost Mode
api_instance.cancel_lost_mode(device_id)
except Exception as e:
print("Exception when calling DeviceInformationApi->cancel_lost_mode: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDevice200Response get_device(device_id)
Get Device
This request returns the high-level information for a specified Device ID.
This is a polymorphic endpoint. If Windows or Android management is turned on, additional fields will be returned in the response. All visible fields based on platform enablement status will be present for all device types, but values will be blank for non-applicable devices. For example, lost_mode_status only applies to iOS and iPadOS devices and will be blank for other platforms.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device200_response import DeviceInformationGetDevice200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device
api_response = api_instance.get_device(device_id)
print("The response of DeviceInformationApi->get_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDevice200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceActivity200Response get_device_activity(device_id, limit, offset=offset)
Get Device Activity
This request returns the device activity for a specified Device ID.
If Windows or Android management is turned on, additonal keys may be present in activity entries.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_activity200_response import DeviceInformationGetDeviceActivity200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
limit = '300' # str | A hard upper <code>limit</code> is set at 300 device records returned per request. If more device records are expected, pagination should be used using the <code>limit</code> and <code>offset</code> parameters. Additionally, parameter queries can be added to a request to limit the results.
offset = '0' # str | Specify the starting record to return (optional)
try:
# Get Device Activity
api_response = api_instance.get_device_activity(device_id, limit, offset=offset)
print("The response of DeviceInformationApi->get_device_activity:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_activity: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str | ||
| limit | str | A hard upper <code>limit</code> is set at 300 device records returned per request. If more device records are expected, pagination should be used using the <code>limit</code> and <code>offset</code> parameters. Additionally, parameter queries can be added to a request to limit the results. | |
| offset | str | Specify the starting record to return | [optional] |
DeviceInformationGetDeviceActivity200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceApps200Response get_device_apps(device_id)
Get Device Apps
This request returns a list of all installed apps for a specified Device ID.
For iPhone and iPad, the preinstalled Apple apps are not reported.
This is a polymorphic endpoint. If Windows or Android management is turned on, the response will be tailored to the specific device family.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_apps200_response import DeviceInformationGetDeviceApps200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device Apps
api_response = api_instance.get_device_apps(device_id)
print("The response of DeviceInformationApi->get_device_apps:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_apps: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDeviceApps200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Link - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-Total-Count - * X-Total-Pages - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceDetails200Response get_device_details(device_id)
Get Device Details
This request returns the device details for a specified Device ID.
This is a polymorphic endpoint. If Windows or Android management is turned on, the response will be tailored to the specific device family.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_details200_response import DeviceInformationGetDeviceDetails200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device Details
api_response = api_instance.get_device_details(device_id)
print("The response of DeviceInformationApi->get_device_details:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_details: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDeviceDetails200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceLibraryItems200Response get_device_library_items(device_id)
Get Device Library Items
This request gets all library items and their statuses for a specified Device ID
| Value | Type | Additional Info |
|---|---|---|
| AVAILABLE | string | Library item available in Self Service |
| CACHED | string | Library item downloaded for install but not yet installed |
| CHANGE_PENDING | string | Recovery Password library item has changes that have not yet been applied |
| DOWNLOADING | string | Library item downloading |
| ERROR | string | Audit failure |
| EXCLUDED | string | Not in scope for assignment rule |
| INCOMPATIBLE | string | Not compatible with device or OS version |
| INSTALLING | string | Library item installing |
| PASS | string | Device meets requirements |
| PENDING | string | Waiting on device, not yet installed (All library items except for config profiles) |
| failed | string | Configuration profile failed to install |
| pending | string | Waiting on device, Configuration profile not yet installed |
| success | string | Configuration profile installed |
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_library_items200_response import DeviceInformationGetDeviceLibraryItems200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device Library Items
api_response = api_instance.get_device_library_items(device_id)
print("The response of DeviceInformationApi->get_device_library_items:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_library_items: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDeviceLibraryItems200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceLostModeDetails200Response get_device_lost_mode_details(device_id)
Get Device Lost Mode details
This request returns the device lost mode details for a specified Device ID.
Note: Lost Mode is is only available for iOS and iPadOS. For more information, please see this Kandji support artilcle.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_lost_mode_details200_response import DeviceInformationGetDeviceLostModeDetails200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device Lost Mode details
api_response = api_instance.get_device_lost_mode_details(device_id)
print("The response of DeviceInformationApi->get_device_lost_mode_details:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_lost_mode_details: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDeviceLostModeDetails200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Content-Type - |
| 400 | Bad Request | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceParameters200Response get_device_parameters(device_id)
Get Device Parameters
This request returns the parameters and their statuses for a specified Device ID, and is only applicable to Mac.
The parameters will be returned as a list of IDs. These IDs can be correlated with the parameter names available here: https://github.com/kandji-inc/support/wiki/Devices-API---Parameter-Correlations
Possible parameter status values
| Value | Type | Additional Info |
|---|---|---|
| ERROR | string | Audit failure |
| INCOMPATIBLE | string | Not compatible with device or OS version |
| PASS | string | Device meets requirements |
| PENDING | string | Waiting on device. Not yet run. |
| REMEDIATED | string | Parameter remediated |
| WARNING | string | Muted alert |
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_parameters200_response import DeviceInformationGetDeviceParameters200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device Parameters
api_response = api_instance.get_device_parameters(device_id)
print("The response of DeviceInformationApi->get_device_parameters:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_parameters: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDeviceParameters200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationGetDeviceStatus200Response get_device_status(device_id)
Get Device Status
This request returns the full status (parameters and library items) for a specified Device ID.
The parameters will be returned as a list of IDs. These IDs can be correlated with the parameter names available here: https://github.com/kandji-inc/support/wiki/Devices-API---Parameter-Correlations
Library items
| Value | Type | Additional Info |
|---|---|---|
| AVAILABLE | string | Library item available in Self Service |
| ERROR | string | Audit failure |
| EXCLUDED | string | Not in scope for assignment rule |
| INCOMPATIBLE | string | Not compatible with device or OS version |
| PASS | string | Device meets requirements |
| PENDING | string | Waiting on device, not yet installed (All library items except for config profiles) |
| failed | string | Configuration profile failed to install |
| pending | string | Waiting on device, Configuration profile not yet installed |
| success | string | Configuration profile installed |
Parameters
| Value | Type | Additional Info |
|---|---|---|
| ERROR | string | Audit failure |
| INCOMPATIBLE | string | Not compatible with device or OS version |
| PASS | string | Device meets requirements |
| PENDING | string | Waiting on device. Not yet run. |
| REMEDIATED | string | Parameter remediated |
| WARNING | string | Muted alert |
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_get_device_status200_response import DeviceInformationGetDeviceStatus200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
try:
# Get Device Status
api_response = api_instance.get_device_status(device_id)
print("The response of DeviceInformationApi->get_device_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->get_device_status: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str |
DeviceInformationGetDeviceStatus200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Allow - * Connection - * Content-Length - * Content-Security-Policy - * Content-Type - * Date - * Feature-Policy - * Referrer-Policy - * Server - * Strict-Transport-Security - * Vary - * X-Content-Type-Options - * X-Frame-Options - * X-XSS-Protection - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object list_devices(limit, asset_tag=asset_tag, blueprint_id=blueprint_id, device_id=device_id, device_name=device_name, filevault_enabled=filevault_enabled, mac_address=mac_address, model=model, ordering=ordering, os_version=os_version, platform=platform, serial_number=serial_number, tag_name=tag_name, tag_name_in=tag_name_in, tag_id=tag_id, tag_id_in=tag_id_in, user=user, user_email=user_email, user_email_exact=user_email_exact, user_id=user_id, user_name=user_name, offset=offset)
List Devices
This request returns a list of devices in an Iru Endpoint Management tenant. Optionally, query parameters can be used to filter results.
There is a hard upper limit of 300 results per request. To return addtional results pagination must be used. Pagination examples can be found in the Iru support GitHub.
This is a polymorphic endpoint. If Windows or Android management is turned on, additional fields will be returned in the response. All visible fields based on platform enablement status will be present for all device types, but values will be blank for non-applicable devices. For example, lost_mode_status only applies to iOS and iPadOS devices and will be blank for other platforms.
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
limit = '300' # str | A hard upper <code>limit</code> is set at 300 device records returned per request. If more device records are expected, pagination should be used using the <code>limit</code> and <code>offset</code> parameters. Additionally, parameter queries can be added to a request to limit the results.
asset_tag = '23245' # str | (optional)
blueprint_id = '91f97957-2353-4f86-a1ab-64d2b044a596' # str | Return results "containing" the specified blueprint id (optional)
device_id = '2cfeb3ac-3b5d-423e-bcff-e2676a3a32da' # str | (optional)
device_name = 'Johnny\'s MacBook Pro' # str | (optional)
filevault_enabled = 'true' # str | <p>Query for devices that either have FileVault on (true) or off (false). This parameter only applies to macOS. </p> <p>An empty list <code>[]</code> will be returned if no devices are found with the given parameter value.</p> (optional)
mac_address = '00:0c:29:05:43:b6' # str | Search for a specific device by MAC address (optional)
model = 'MacBook Air (M1, 2020)' # str | Return model results "containing" the specified model string. (optional)
ordering = 'device_id' # str | <p>The <code>ordering</code> parameter can be used to define how the device records are ordered in the response. Prepending a dash (-) to the parameter value will reverse the order of the returned results.</p> <p><code>?ordering=-serial_number</code> will order the response by serial_number in descending order.</p> <p><strong>Possible values</strong></p> <ul> <li><code>asset_tag</code></li> <li><code>blueprint_id</code></li> <li><code>device_id</code></li> <li><code>device_name</code></li> <li><code>last_check_in</code> - agent checkin</li> <li><code>model</code></li> <li><code>platform</code></li> <li><code>os_version</code></li> <li><code>serial_number</code></li> <li><code>user</code></li> </ul> <p>Additionally, multiple values can be combined in a comma separated list to further customize the ordering of the response.</p> <p><code>?ordering=serial_number,platform</code></p> (optional)
os_version = '13.2.3' # str | Return all device records containing the specified OS version (optional)
platform = 'iPad' # str | Return all records matching a specific platform. Possible values:<code>Mac</code>, <code>iPad</code>, <code>iPhone</code>, <code>AppleTV</code>, <code>Android</code>, <code>Windows</code> (optional)
serial_number = 'VMC5qeJ5pDkp' # str | Search for a specific device by Serial Number. If partial serial number is provided in the query, all device containing the partial string will be returned. (optional)
tag_name = 'accuhive_01' # str | Return results for given tag name. Case sensitive. (optional)
tag_name_in = 'accuhive_01, accuhive_02' # str | Return results for given tag names separate by commas. Case sensitive. (optional)
tag_id = '' # str | Search for a tag by its ID. Case sensitive. (optional)
tag_id_in = '' # str | Return results for given tag IDs separated by commas. Case sensitive. (optional)
user = 'Art Vandelay' # str | Return results "containing" the user name (optional)
user_email = 'someUser@Kandji.io' # str | Return results "containing" search on email address (optional)
user_email_exact = 'someUser@Kandji.io' # str | Return results "matching" the specified email address (optional)
user_id = '5344c996-8823-4b37-8d6e-8515fc7c3a0a' # str | "exact" match on user ID (example: 5344c996-8823-4b37-8d6e-8515fc7c3a0a) (optional)
user_name = 'Vandelay' # str | Return results "containing" the assigned user Display Name (optional)
offset = '0' # str | Specify the starting record to return (optional)
try:
# List Devices
api_response = api_instance.list_devices(limit, asset_tag=asset_tag, blueprint_id=blueprint_id, device_id=device_id, device_name=device_name, filevault_enabled=filevault_enabled, mac_address=mac_address, model=model, ordering=ordering, os_version=os_version, platform=platform, serial_number=serial_number, tag_name=tag_name, tag_name_in=tag_name_in, tag_id=tag_id, tag_id_in=tag_id_in, user=user, user_email=user_email, user_email_exact=user_email_exact, user_id=user_id, user_name=user_name, offset=offset)
print("The response of DeviceInformationApi->list_devices:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->list_devices: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | str | A hard upper <code>limit</code> is set at 300 device records returned per request. If more device records are expected, pagination should be used using the <code>limit</code> and <code>offset</code> parameters. Additionally, parameter queries can be added to a request to limit the results. | |
| asset_tag | str | [optional] | |
| blueprint_id | str | Return results "containing" the specified blueprint id | [optional] |
| device_id | str | [optional] | |
| device_name | str | [optional] | |
| filevault_enabled | str | <p>Query for devices that either have FileVault on (true) or off (false). This parameter only applies to macOS. </p> <p>An empty list <code>[]</code> will be returned if no devices are found with the given parameter value.</p> | [optional] |
| mac_address | str | Search for a specific device by MAC address | [optional] |
| model | str | Return model results "containing" the specified model string. | [optional] |
| ordering | str | <p>The <code>ordering</code> parameter can be used to define how the device records are ordered in the response. Prepending a dash (-) to the parameter value will reverse the order of the returned results.</p> <p><code>?ordering=-serial_number</code> will order the response by serial_number in descending order.</p> <p><strong>Possible values</strong></p> <ul> <li><code>asset_tag</code></li> <li><code>blueprint_id</code></li> <li><code>device_id</code></li> <li><code>device_name</code></li> <li><code>last_check_in</code> - agent checkin</li> <li><code>model</code></li> <li><code>platform</code></li> <li><code>os_version</code></li> <li><code>serial_number</code></li> <li><code>user</code></li> </ul> <p>Additionally, multiple values can be combined in a comma separated list to further customize the ordering of the response.</p> <p><code>?ordering=serial_number,platform</code></p> | [optional] |
| os_version | str | Return all device records containing the specified OS version | [optional] |
| platform | str | Return all records matching a specific platform. Possible values:<code>Mac</code>, <code>iPad</code>, <code>iPhone</code>, <code>AppleTV</code>, <code>Android</code>, <code>Windows</code> | [optional] |
| serial_number | str | Search for a specific device by Serial Number. If partial serial number is provided in the query, all device containing the partial string will be returned. | [optional] |
| tag_name | str | Return results for given tag name. Case sensitive. | [optional] |
| tag_name_in | str | Return results for given tag names separate by commas. Case sensitive. | [optional] |
| tag_id | str | Search for a tag by its ID. Case sensitive. | [optional] |
| tag_id_in | str | Return results for given tag IDs separated by commas. Case sensitive. | [optional] |
| user | str | Return results "containing" the user name | [optional] |
| user_email | str | Return results "containing" search on email address | [optional] |
| user_email_exact | str | Return results "matching" the specified email address | [optional] |
| user_id | str | "exact" match on user ID (example: 5344c996-8823-4b37-8d6e-8515fc7c3a0a) | [optional] |
| user_name | str | Return results "containing" the assigned user Display Name | [optional] |
| offset | str | Specify the starting record to return | [optional] |
object
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Content-Type - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceInformationUpdateDevice200Response update_device(device_id, body=body)
Update Device
This request allows you to update device information, such as the assigned blueprint, user, Asset Tag, and Tags. It is not required to use all attributes in a given request. For example if you only want to update the assigned blueprint, you only need to pass the blueprint_id in the request payload.
NOTE: With the introduction of a UUID value for user ID in the Users API, the Device PATCH endpoint will support both the depricated user ID integer value and the new user ID UUID value when updating the user assignment for a device. The ability to update user assignment via the integer ID value will be removed starting January 2025.
device_id (path parameter): The unique identifier of the device.
User ID can be found using the list users API
A Blueprint ID can be found using the list blueprints API or in the URL path while on a Blueprint overview page.
For example, for this URL https://subdomain.kandji.io/blueprints/6391086e-85a1-4820-813c-f9c75025fff4
The Blueprint ID would be 6391086e-85a1-4820-813c-f9c75025fff4
An example script that leverages this API can be found in the Kandji Support GitHub
To clear a device asset tag, set the asset_tag value to null in the JSON payload.
{ "asset_tag": null }
To clear the assigned user for a given device, set the user value to null in the JSON payload.
{ "user": null }
To clear the assigned tags for a given device, set the tags value to an empty list [] in the JSON payload.
{ "tags": [] }
- Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.device_information_update_device200_response import DeviceInformationUpdateDevice200Response
from kandji.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
host = "https://<sub_domain>.api.kandji.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kandji.DeviceInformationApi(api_client)
device_id = 'device_id_example' # str |
body = {"asset_tag":"1040","blueprint_id":"be1a4d67-91d8-4d19-a927-c8be6e77b6b2","tags":["tag1","tag2","tag3","tag4","tag5"],"user":"5344c996-8823-4b37-8d6e-8515fc7c3a0a"} # str | (optional)
try:
# Update Device
api_response = api_instance.update_device(device_id, body=body)
print("The response of DeviceInformationApi->update_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceInformationApi->update_device: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| device_id | str | ||
| body | str | [optional] |
DeviceInformationUpdateDevice200Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | * Content-Type - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]