Skip to content
All recipes

Get an Activation Lock bypass code for a reassigned device

Retrieve the Activation Lock bypass code for a supervised Apple device after you approve it, then enter it on the device.

Open in Claude Open in ChatGPT
Product
Endpoint Management
Platforms
macOS, iOS, iPadOS, visionOS
Effect
Shows a secret
Agent access
Iru MCP or the Iru API

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

  1. 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_enabled and bypass_code_failed.

    GET/api/v1/devices
    GET/api/v1/devices/{device_id}/details

    Source: Iru API: Get Device Details

  2. Retrieve the code after you approve

    The response holds two codes. user_based_albc is for Activation Lock turned on with a personal Apple Account and Find My. device_based_albc is 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/bypasscode

    Approval requiredThe agent shows you the device and waits. Approve only when you are ready to enter the code on the device.

    Source: Activation Lock

  3. 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.

Next steps

Sources

Stay up to date

Iru's bi-weekly collection of articles, videos, and research to keep IT & Security teams ahead of the curve.