Before you start
- An Iru API token with MCP turned on and permissions that cover the calls below (recipe 1).
- Back up anything you need to keep. Erasing permanently deletes all data and can't be undone.
- Lock works on macOS, iOS, iPadOS, visionOS and Android. Erase works on macOS, iOS, iPadOS, tvOS and visionOS. Neither needs supervision.
- Apple silicon Macs and Intel Macs with the T2 chip erase with Erase All Content and Settings (EACS), which fails unless a bootstrap token is escrowed.
Prompt for your agent
List every device in Iru assigned to [employee name or email], with each device's name, platform and serial number. Then stop. I'll tell you which devices to lock and which to erase. Before each action, show me the device and the action, and wait for my explicit approval. If you lock a Mac, show me the unlock PIN from the response.
Steps
List the employee's devices
Have the agent list every device assigned to the employee, with each one's name, platform and serial number.
GET/api/v1/devicesSource: Iru API: List Devices
Choose lock or erase for each device
A locked device can't receive an Erase Device command, so decide which action each device gets before you send anything.
Source: Lock a device
Lock a device after you approve
Add an optional Message and PhoneNumber for the lock screen. A Mac restarts and locks with a six-digit PIN, which the response returns. Keep that PIN.
POST/api/v1/devices/{device_id}/action/lockApproval requiredThe agent names the device and the action, then waits for your go on each one.
Source: Lock a device
Erase a device after you approve
Intel Macs without the T2 chip erase by obliteration with a 6-digit PIN. On iPhone and iPad,
ReturnToServicere-enrolls the device after the erase. An offline device runs the command when it next connects.POST/api/v1/devices/{device_id}/action/eraseApproval requiredErasing can't be undone. The agent names the device and waits for your go on each one.
Source: Erase a device
Check it worked
- After a Mac locks, its six-digit PIN is on the device record.
Common pitfalls
- Locking an Apple silicon Mac running a macOS version before 11.5 deactivates it. Reactivating it needs a network connection and a local administrator with a Secure Token.
- Apple silicon Macs don't take an erase PIN.
- A Mac that still has a legacy firmware password erases completely and needs a macOS reinstall instead of EACS.
- Mac and visionOS don't offer Return to Service.
FAQ
Which devices can I lock or erase?
Lock works on macOS, iOS, iPadOS, visionOS and Android. Erase works on macOS, iOS, iPadOS, tvOS and visionOS. Neither needs supervision.
How do I unlock a Mac after a remote lock?
The lock response returns a 6-digit PIN, which also shows on the device record. GET /api/v1/devices/{device_id}/secrets/unlockpin returns it later.
Can I erase a device that's already locked?
No. A locked device can't receive an Erase command, so choose one action per device.
What if the device is offline?
The command runs when the device next connects. An erase can't be undone once it runs.