Devices: setState

Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.

Request

HTTP request

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

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.

Authorization

This request requires authorization with the following scope:

Scope
https://www.googleapis.com/auth/androidenterprise

For more information, see the authentication and authorization page.

Request body

In the request body, supply data with the following structure:

{
  "kind": "androidenterprise#deviceState",
  "accountState": string
}
Property name Value Description Notes
accountState string The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state.

Acceptable values are:
  • "disabled"
  • "enabled"
kind string

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "androidenterprise#deviceState",
  "accountState": string
}
Property name Value Description Notes
accountState string The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state.

Acceptable values are:
  • "disabled"
  • "enabled"
kind string