Before you start
- An Iru API token with MCP turned on and permissions that cover the calls below (recipe 1).
- A user directory integration (Google Workspace, Microsoft Entra ID or SCIM) that imports your users (User Directory Integration).
Prompt for your agent
List my directory users in Iru with GET /api/v1/users, and page through every result with the cursor. Keep users where archived is false and device_count is 0. Show me each one's name, email and integration name. Then list my devices with GET /api/v1/devices?limit=300, and page through every result. Show me the devices that have no assigned user. First show me how the user field looks on one device that has no user, and tell me what value you matched on. Don't assign or change anything.
Steps
List the directory users
The call returns users from your user directory integrations, up to 300 per request. Use the
nextURL to read every page. Thearchivedfilter returns archived or active users only.GET/api/v1/usersSource: Iru API: List Users
Keep users with no device
Each user record carries a
device_count. Keep the active records wheredevice_countis 0, and leave out archived users unless you want them.Source: Iru API: List Users
List the devices
Each device record has a
userobject withemail,name,idandis_archived. The docs don't show what an unassigned device returns there, so have the agent show you one such device and the value it matched on.If Windows or Android management is on, the list includes those devices too, with fields that don't apply left blank.
GET/api/v1/devices?limit=300Source: Iru API: List Devices
Assign a user in the web app
To fix a device with no user, select Devices, select the device, then Edit device details and Edit user. Type the name, then select Assign.
Check it worked
- Open one listed user in Users and confirm it shows no devices.
Common pitfalls
- Iru imports directory users every 4 hours, so a new hire can appear a few hours after you add them to the directory.
- Device users in Iru can only be created and assigned through a directory integration.
- Removing a directory integration removes the users who aren't assigned to devices.
FAQ
Which call tells me how many devices a user has?
GET /api/v1/users returns a device_count for each user. A value of 0 means no device is assigned.
How often does Iru import directory users?
Every 4 hours once a Google Workspace, Microsoft Entra ID or SCIM integration is set up.
Does it cover Windows and Android devices?
GET /api/v1/devices includes them when Windows or Android management is on.
How do I assign a user to a device?
Select Devices, select the device, then Edit device details and Edit user. Type the name and select Assign.