Kandji
The Kandji Integration imports the Apple devices managed in Kandji into xAssets as asset records. It also creates a custodian for each device user and, when you turn it on, imports the applications on each Mac.
The integration reads the Kandji API with an API token.
Prerequisites
Before you start, check that you have the following:
- A Kandji tenant and a Kandji administrator who can open Settings > Access and create API tokens.
- A Kandji API token with permission to list devices (
GET /api/v1/devices). To import Mac applications, the token also needs the Prism permission for applications (GET /api/v1/prism/apps). - Your Kandji API URL. Kandji shows it on the Access page, in the form
yourcompany.api.kandji.io(US tenants) oryourcompany.api.eu.kandji.io(EU tenants). - Outbound HTTPS (port 443) from the xAssets application server to your Kandji API host. The calls run on the application server.
- The xAssets Batch Service must be running (the integration runs as a batch job).
- Permission in xAssets to create credential packs.
Kandji API Calls
| Purpose | Request |
|---|---|
| Devices | GET https://<Domain Name>/devices |
| Mac applications (only when Kandji integration - collect software for Mac computers is on) | GET https://<Domain Name>/prism/apps?device_families=Mac&limit=300&offset=<n>, one request for each 300 applications |
Every request sends the API token in the header Authorization: Bearer <token>.
Setup
Step 1: Create an API Token in Kandji
- Sign in to Kandji as an administrator.
- Open Settings > Access.
- Copy the API URL shown on the page. You need it in Step 2.
- Under API Token, click Add Token. Give it a name, for example
xAssets, and create it. - Copy the token. Kandji shows it only once.
- Manage the token's API permissions. Select the permission to list devices.
- To import Mac applications, also select the Prism permission for applications.
- Save the permissions.
Warning: Anyone with the token can read every device the token can see. Store it only in the xAssets credential pack.
Step 2: Create a Credential Pack in xAssets
- Click the Settings gear icon (top right) > Credentials.
- Click New.
- Fill in the pack:
| Field | Value |
|---|---|
| Credential Type | Named Credentials |
| Collection Server | Application Server |
| Pack Name | Kandji (the name the Integrations page recommends) |
| Domain Name | Your API URL host followed by /api/v1, for example yourcompany.api.kandji.io/api/v1. The https:// prefix is optional |
| Username | Any value, for example Kandji. The form needs a value. The integration does not read it |
| Password | The API token from Step 1 |
- Click OK to save the pack.
The integration adds /devices to the Domain Name. Include the /api/v1 path, or every request returns 404.
When the Domain Name is blank or ., the integration uses the value of the KANDJIBASEURL setting, when your database has one.
Step 3: Review the Settings
These settings are in Admin > Settings, under the Integrations class. The Settings tab of the integration's Setup dialog lists them too.
| Setting | Code | Shipped Value | Effect |
|---|---|---|---|
| Kandji integration - collect software for Mac computers | KandjiMacSoftware |
0 |
Set it to 1 to import the applications on each Mac from Kandji Prism. The token needs the Prism permission |
| Kandji integration - leave out virtual machines | KandjiExcludeVMs |
0 |
Set it to 1 to skip virtual machines. A device counts as virtual when its model starts VirtualMac or Apple Virtual Machine, or matches a virtual machine rule in Computer Type Recognition |
| Custodian Authority - Kandji | CustodianMatch_Kandji |
AddEdit |
Whether the integration can add and edit custodians. See Custodian Matching and Integration Authority |
Step 4: Run the Integration
- Click the Settings gear icon (top right) > Integrations.
- Select Kandji Integration by clicking its row.
- Click Queue at the top of the screen. Alternatively, click the Start icon in the row to run it at once.
- In the Integration Credentials dialog, select your pack in Credentials and click OK. Select Schedule this Integration to add a schedule as well.
- Watch the status in the batch job area. The integration reports these stages. The second appears only when Mac software is on.
Getting data from kandji
Getting Mac applications from Kandji
Transferring Kandji data
Loading Kandji holding area
Kandji Synchronise Completed. X asset records loaded.
Step 5: Check the Results
- Open the Asset List and filter by Source =
KANDJI. - Open one asset and check the computer name, serial number, model, operating system and asset tag.
- Check the custodian on a device that has a user assigned in Kandji.
- When Mac software is on, check the Software tab of a Mac.
Imported Data
| Kandji Field | xAssets Field |
|---|---|
device_name |
Computer Name |
model |
Model |
serial_number |
Serial Number, used to match existing assets |
platform |
Manufacturer is set to Apple for Macs |
os_version |
Operating System (for example MacOS 14) and Windows Version (the full version) |
last_check_in |
Last Boot Up Time and the discovery run date |
asset_tag |
Hardware Asset Tag |
user.name, user.email |
Custodian |
The asset description is built as Apple <model> - <device name>.
Custodians
Kandji gives a name and an email address for each device user. The integration creates or matches a custodian for each user, using the email address as the identity. Each custodian is marked with the source Kandji. A device is linked to a custodian only when both the name and the email address match. A device with no user is still imported.
Mac Software
With Kandji integration - collect software for Mac computers on, each Mac gets its applications from Kandji Prism. The application name (without .app), bundle ID, version and developer name are imported. They go through software recognition like discovered software. Applications are matched to devices on serial number.
Limitations
- Software is imported for Macs only, and only from Kandji Prism.
- Hardware detail is limited to what the Kandji devices list returns. For memory, disks and BIOS, combine Kandji with xAssets discovery.
Troubleshooting
The credential pack has no domain name
The full message starts: "The credential pack "Kandji" has no domain name and no fallback has been set". Enter the API URL and /api/v1 in the pack's Domain Name.
401 Unauthorized
The token in the pack's Password is wrong, or it was deleted in Kandji. Create a new token and save it in the pack.
404 Not Found
The Domain Name is missing the /api/v1 path, or the host is for the wrong region. Copy the API URL from Settings > Access in Kandji again.
Kandji applications request failed
The message starts "Kandji applications request failed:" and gives the HTTP status. Add the Prism applications permission to the token, or set Kandji integration - collect software for Mac computers to 0.
Scheduling
Schedule the Kandji Integration to run daily. See Schedules.
Related Articles
- Integration with JAMF -- another Apple device management integration
- Microsoft Intune -- importing Intune-managed devices
- Custodian Matching and Integration Authority -- which integrations can add and edit custodians
- Schedules -- automating integration runs