<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 4.0.0 -",
    "macOS: 10.7.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceManagement",
  "identifier" : "/documentation/DeviceManagement/Device-Lock-Command",
  "metadataVersion" : "0.1.0",
  "role" : "Web Service Endpoint",
  "symbol" : {
    "kind" : "Web Service Endpoint",
    "modules" : [
      "Device Management"
    ],
    "preciseIdentifier" : "rest:put:mdm#DeviceLockCommand"
  },
  "title" : "Device Lock"
}
-->

# Device Lock

Remotely and immediately lock a device.

## Discussion

You can display a message and phone number on the Lock Screen if the user has set a passcode for the device, it isn’t a Shared iPad, and it isn’t in Lost Mode. In macOS, this command uses the Find My framework to lock a device, and fails if there’s no recovery partition on the device.

> Warning:
> Sending this command to a Mac with Apple silicon running a version of macOS before 11.5 deactivates the Mac. To reactivate that Mac, it needs a network connection and authentication by a local administrator with Secure Token enabled.

Refer to the following sections to determine supported channels and requirements, and to see an example request and response.

### Command availability

|||
|--------------------------|------------------------------------------|
|Device channel            |iOS, macOS, Shared iPad, visionOS, watchOS|
|User channel              |N/A                                       |
|Requires supervision      |macOS                                     |
|Allowed in user enrollment|iOS, visionOS                             |
|Required access right     |AllowPasscodeRemovalAndLock               |

### Example request and response

**Request:**

```plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Command</key>
    <dict>
        <key>Message</key>
        <string>Lock Message</string>
        <key>PhoneNumber</key>
        <string>408-555-5555</string>
        <key>RequestType</key>
        <string>DeviceLock</string>
    </dict>
    <key>CommandUUID</key>
    <string>0001_DeviceLock</string>
</dict>
</plist>
```

**Response:**

```plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CommandUUID</key>
    <string>0001_DeviceLock</string>
    <key>MessageResult</key>
    <string>Success</string>
    <key>Status</key>
    <string>Acknowledged</string>
    <key>UDID</key>
    <string>00008020-000915083C80012E</string>
</dict>
</plist>
```

## Topics

### Commands and responses

[`DeviceLockCommand`](/documentation/DeviceManagement/DeviceLockCommand)

The command to remotely and immediately lock a device.

[`DeviceLockResponse`](/documentation/DeviceManagement/DeviceLockResponse)

A response from the device after it processes the command to remotely and immediately lock a device.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)