> [!NOTE]
> **Note:** Requires [authorization](https://developers.google.com/android/work/play/emm-api/v1/devices/update#auth).

Updates the device policy.

<br />


To ensure the policy is properly enforced, you need to prevent unmanaged
accounts from accessing Google Play by setting the
`allowed_accounts` in the managed configuration for the Google
Play package. See [restrict
accounts in Google Play](https://developer.android.com/work/dpc/security#google-play-accounts).

## Request

### HTTP request

```
PUT https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/users/userId/devices/deviceId
```

### Parameters

| Parameter name | Value | Description |
|---|---|---|
| **Path parameters** |||
| `deviceId` | `string` | The ID of the device. |
| `enterpriseId` | `string` | The ID of the enterprise. |
| `userId` | `string` | The ID of the user. |
| **Optional query parameters** |||
| `updateMask` | `string` | Mask that identifies which fields to update. If not set, all modifiable fields will be modified. <br /> When set in a query parameter, this field should be specified as `updateMask=<field1>,<field2>,...` |

### Authorization

This request requires authorization with the following scope:

| Scope |
|---|
| `https://www.googleapis.com/auth/androidenterprise` |

For more information, see the [authentication and authorization](https://developers.google.com/android/work/play/emm-api/v1/how-tos/authorizing) page.

### Request body

In the request body, supply a [Devices resource](https://developers.google.com/android/work/play/emm-api/v1/devices#resource).

## Response

If successful, this method returns a [Devices resource](https://developers.google.com/android/work/play/emm-api/v1/devices#resource) in the response body.