Update device

Important: APIs under the /beta version in Microsoft Graph are in preview and 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.

Permissions

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.

Response

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

Example

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

{
  "accountEnabled": false
}
Response
HTTP/1.1 204 No Content

See also