Before you start
- An Iru API token with MCP turned on and permissions that cover the calls below (recipe 1).
- The device is supervised. Bypass codes are available for supervised iOS, iPadOS, visionOS and macOS devices, and on Mac only for computers with T2 or Apple silicon.
- Your API token's role can read Activation Lock secrets. The docs name Secrets Auditor as an example.
Prompt for your agent
Find the device used by [user name or serial number] in Iru with GET /api/v1/devices. Then call GET /api/v1/devices/{device_id}/details and show me its name, serial number, platform and its Activation Lock fields. Stop and wait for my approval. After I approve, retrieve its bypass codes with GET /api/v1/devices/{device_id}/secrets/bypasscode and show them to me once. Say which code is user-based and which is device-based, and don't repeat them afterward.
Steps
Find the device and check Activation Lock
Have the agent find the device and show you its record. The device details include an Activation Lock section with the fields
user_activation_lock_enabled,device_activation_lock_enabledandbypass_code_failed.GET/api/v1/devicesGET/api/v1/devices/{device_id}/detailsSource: Iru API: Get Device Details
Retrieve the code after you approve
The response holds two codes.
user_based_albcis for Activation Lock turned on with a personal Apple Account and Find My.device_based_albcis for Activation Lock turned on by the MDM server.To do the same in the web app, open the device record, select the Device Action Menu and choose the option to view the Activation Lock bypass code.
GET/api/v1/devices/{device_id}/secrets/bypasscodeApproval requiredThe agent shows you the device and waits. Approve only when you are ready to enter the code on the device.
Source: Activation Lock
Enter the code on the device
On an iPhone, iPad or Apple Vision Pro at the Activation Lock screen in Setup Assistant, leave the Apple Account field blank and enter the code in the password field. In Finder, the same applies to an iPhone or iPad connected to a Mac.
On a Mac at the Activation Lock screen, open Recovery Assistant in the menu bar, select Activate with MDM Key... and enter the user-based code.
Source: Activation Lock
Check it worked
- The device passes the Activation Lock screen without the Apple Account password.
Common pitfalls
- Retrieve the code before you erase or restore the device.
- A user-based code can't retroactively disable an existing user-based Activation Lock on a Mac that wasn't previously supervised by an MDM. The user must turn Find My off and back on.
- For a Mac that moved from another MDM, Iru can retrieve a bypass code only within 30 days after the device is supervised. Retrieve it from the previous MDM before you migrate.
- Device-based Activation Lock applies to iOS, iPadOS and visionOS only.
FAQ
Which API call returns an Activation Lock bypass code?
GET /api/v1/devices/{device_id}/secrets/bypasscode returns user_based_albc and device_based_albc for one Apple device.
Which devices have a bypass code?
Supervised iOS, iPadOS, visionOS and macOS devices, and on Mac only computers with T2 or Apple silicon.
Is access to the bypass code logged?
The sources I checked don't say. The audit log documents access to sensitive data such as FileVault keys, so look for the event in GET /api/v1/audit/events before you rely on it.
What if the bypass code is unavailable?
Try removing Activation Lock from Apple Business or Apple School Manager. If that fails too, contact AppleCare Enterprise Support.