All URIs are relative to https://<sub_domain>.api.kandji.io
Method | HTTP request | Description |
---|---|---|
clearPasscode | POST /api/v1/devices/{device_id}/action/clearpasscode | Clear Passcode |
deleteDevice | DELETE /api/v1/devices/{device_id} | Delete Device |
deleteUser | POST /api/v1/devices/{device_id}/action/deleteuser | Delete User |
eraseDevice | POST /api/v1/devices/{device_id}/action/erase | Erase Device |
getDeviceCommands | GET /api/v1/devices/{device_id}/commands | Get Device Commands |
lockDevice | POST /api/v1/devices/{device_id}/action/lock | Lock Device |
reinstallAgent | POST /api/v1/devices/{device_id}/action/reinstallagent | Reinstall Agent |
remoteDesktop | POST /api/v1/devices/{device_id}/action/remotedesktop | Remote Desktop |
renewMdmProfile | POST /api/v1/devices/{device_id}/action/renewmdmprofile | Renew MDM Profile |
restartDevice | POST /api/v1/devices/{device_id}/action/restart | Restart Device |
sendBlankpush | POST /api/v1/devices/{device_id}/action/blankpush | Send Blankpush |
setName | POST /api/v1/devices/{device_id}/action/setname | Set Name |
shutdown | POST /api/v1/devices/{device_id}/action/shutdown | Shutdown |
unlockAccount | POST /api/v1/devices/{device_id}/action/unlockaccount | Unlock Account |
updateInventory | POST /api/v1/devices/{device_id}/action/updateinventory | Update Inventory |
open class func clearPasscode(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Clear Passcode
This endpoint sends an MDM command to clear a device passcode. Available for iPhone and iPad.
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Clear Passcode
DeviceActionsAPI.clearPasscode(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func deleteDevice(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Delete Device
This endpoint sends an MDM command to delete a device. This will remove the device record from Kandji and send a Remove Management command. For macOS devices, it will also send an uninstall command to the Kandji Agent at the next agent checkin.
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Delete Device
DeviceActionsAPI.deleteDevice(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func deleteUser(deviceId: String, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Delete User
This endpoint sends an MDM command to delete a local user account on macOS and Shared iPad (Device Supervision via Automated Device Enrollment is required).
Request Body Parameters: application/json
DeleteAllUsers
- boolean
ForceDeletion
- boolean
UserName
- string
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Delete User
DeviceActionsAPI.deleteUser(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
Void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func eraseDevice(deviceId: String, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Erase Device
This endpoint sends an MDM command to erase the device.
iOS 4.0+, iPadOS 4.0+, macOS 10.7+, tvOS 10.2+
Request Body Parameters: application/json
Key | Type | Description |
---|---|---|
PIN | string | The six-character PIN for Find My. This value is available in macOS 10.8 and later. Note: This value will be ignored for iOS, iPadOS, and tvOS devices. |
PreserveDataPlan | boolean | If true, preserve the data plan on an iPhone or iPad with eSIM functionality, if one exists. This value is available in iOS 11 and later. Default: true |
DisallowProximitySetup | boolean | If true, disable Proximity Setup on the next reboot and skip the pane in Setup Assistant. This value is available in iOS 11 and later. Prior to iOS 14, don’t use this option with any other option. Default: false |
ReturnToService | object | (iOS 17 and later and iPadOS 17 and later and with Shared iPad ) When sending the erase device command to mobile devices, use this key to enable Return to Service. Include an optional Wi-Fi payload ProfileId to allow the device to connect to a Wi-Fi network automatically after being erased. If a Wi-Fi ProfileId is not provided and the mobile device is not tethered to a Mac to share the network connection, the end-user will be required to select a Wi-Fi network to complete the setup. If sent to any macOS computer or to mobile devices on iOS 16 or iPadOS 16 and below, the RTS keys will be ignored, and only the erase device command will be issued to the device. |
- Enabled | boolean | (Required) If true, the device tries to re-enroll itself automatically after erasure. The user needs to deactivate all activation locks for this feature to work correctly. |
- ProfileId | string | Profile ID value associated with a Wi-Fi profile payload. This is required when the device doesn’t have ethernet access. |
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Erase Device
DeviceActionsAPI.eraseDevice(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
Void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func getDeviceCommands(deviceId: String, limit: String, offset: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Get Device Commands
This endpoint sends a request to get information about the commands sent to a given device ID.
- 1 : Command is Pending
- 2 : Command is running
- 3 : Command completed
- 4 : Command failed
- 5 : Command received "Not Now" response
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let limit = "limit_example" // String | 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.
let offset = "offset_example" // String | Specify the starting record to return (optional)
// Get Device Commands
DeviceActionsAPI.getDeviceCommands(deviceId: deviceId, limit: limit, offset: offset) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
limit | String | 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 | String | Specify the starting record to return | [optional] |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func lockDevice(deviceId: String, body: String? = nil, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)
Lock Device
This endpoint sends an MDM command to remotely lock a device.
For macOS clients, an unlock PIN will be created, and returned in the response.
Caution !!!
For a Mac with Apple silicon running a version of macOS before 11.5 will deactivate the Mac. To reactivate, the Mac requires a network connection and authentication by a Secure Token enabled local administrator.
Optionally, a JSON payload can be sent in the request to set a lock message and phone number on the target device.
Note: For macOS, although the lock message is displayed on all types of Mac computers, the phone number is displayed only on a Mac with Apple silicon.
Property | Description | Type |
---|---|---|
PIN | Six digit pin code used to unlock a Mac. | String |
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Lock Device
DeviceActionsAPI.lockDevice(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
AnyCodable
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func reinstallAgent(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Reinstall Agent
This endpoint sends an MDM command reinstall the Kandji Agent. Available for macOS devices.
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Reinstall Agent
DeviceActionsAPI.reinstallAgent(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func remoteDesktop(deviceId: String, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Remote Desktop
This endpoint sends an MDM command to control the Remote Management status on a Mac. This MDM command turns on (or turns off) Remote Management with Observe and Control permissions given to all users*.*
Request Body Parameters: application/json
EnableRemoteDesktop
- boolean
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Remote Desktop
DeviceActionsAPI.remoteDesktop(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
Void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func renewMdmProfile(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Renew MDM Profile
This endpoint sends an MDM command to re-install the existing root MDM profile for a given device ID. This command will not impact any existing configurations, apps, or profiles.
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Renew MDM Profile
DeviceActionsAPI.renewMdmProfile(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func restartDevice(deviceId: String, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Restart Device
This endpoint sends an MDM command to remotely restart a device.
RebuildKernelCache
- Iftrue
, the system rebuilds the kernel cache during a device restart. IfBootstrapTokenAllowedForAuthentication
istrue
inSecurityInfoResponse.SecurityInfo, the device requests the bootstrap token from MDM before executing this command. This value is available in macOS 11 and later. Default: falseNotifyUser
- Iftrue
, notifies the user to restart the device at their convenience. Forced restart if the device is atloginwindow
with no logged-in users. The user can dismiss the notification and ignore the request. No further notifications display unless you resend the command. This value is available in macOS 11.3 and later. Default: false
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Restart Device
DeviceActionsAPI.restartDevice(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
Void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func sendBlankpush(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Send Blankpush
This endpoint sends an MDM command to initiate a blank push.
Using the Blank Push command
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Send Blankpush
DeviceActionsAPI.sendBlankpush(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func setName(deviceId: String, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Set Name
This endpoint sends an MDM command to set the device name.
Request Body Parameters: application/json
DeviceName
- string
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Set Name
DeviceActionsAPI.setName(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
Void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func shutdown(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Shutdown
This endpoint sends an MDM command to shutdown a device.
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Shutdown
DeviceActionsAPI.shutdown(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func unlockAccount(deviceId: String, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Unlock Account
This endpoint sends an MDM command to unlock a user account that locked by the system because of too many failed password attempts. Available for macOS.
Request Body Parameters: application/json
UserName
- string
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
let body = "body_example" // String | (optional)
// Unlock Account
DeviceActionsAPI.unlockAccount(deviceId: deviceId, body: body) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String | ||
body | String | [optional] |
Void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func updateInventory(deviceId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Update Inventory
This endpoint sends an MDM command to start a check-in for a device, initiating the daily MDM commands and MDM logic.
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk
let deviceId = "deviceId_example" // String |
// Update Inventory
DeviceActionsAPI.updateInventory(deviceId: deviceId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]