Update device


APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.

Update the properties of a device.

Only certain properties of a device can be updated through approved Mobile Device Managment (MDM) apps.


One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Directory.ReadWrite.All, Directory.AccessAsUser.All
Delegated (personal Microsoft account) Not supported.
Application Not supported

HTTP request

PATCH /devices/{id}

Note: The "id" in the request is the "id" property of the device, not the "deviceId" property.

Request headers

Name Type Description
Authorization string Bearer {token}. Required.

Request body

In the request body, supply the values for the device properties that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance you shouldn't include existing values that haven't changed.

Property Type Description
accountEnabled Boolean true if the account is enabled; otherwise, false.
operatingSystem String The type of operating system on the device.
operatingSystemVersion String The version of the operating system on the device
displayName String The display name for the device.
isCompliant Boolean true if the device complies with Mobile Device Management (MDM) policies; otherwise, false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices.
isManaged Boolean true if the device is managed by a Mobile Device Management (MDM) app; otherwise, false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices.

Since the device resource supports extensions, you can use the PATCH operation to add, update, or delete your own app-specific data in custom properties of an extension in an existing device instance.


If successful, this method returns a 204 No Content response code.


PATCH https://graph.microsoft.com/beta/devices/{id}
Content-type: application/json
Content-length: 31

  "accountEnabled": false
HTTP/1.1 204 No Content

SDK sample code

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var device = new Device
	AccountEnabled = false

await graphClient.Devices["{id}"]

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.

See also