Patch

Updates a device

120 variables
118 variables

Updates a device

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Manage Android devices and apps for your customers

Input

This building block consumes 120 input parameters

  = Parameter name
  = Format

name STRING Required

The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}

updateMask ANY

The field mask indicating the fields to update. If not set, all modifiable fields will be modified

previousDeviceNames[] STRING

lastStatusReportTime ANY

The last time the device sent a status report

policyCompliant BOOLEAN

Whether the device is compliant with its policy

deviceSettings OBJECT

Information about security related device settings on device

deviceSettings.developmentSettingsEnabled BOOLEAN

Whether developer mode is enabled on the device

deviceSettings.adbEnabled BOOLEAN

Whether ADB (https://developer.android.com/studio/command-line/adb.html) is enabled on the device

deviceSettings.isEncrypted BOOLEAN

Whether the storage encryption is enabled

deviceSettings.encryptionStatus ENUMERATION

Encryption status from DevicePolicyManager

deviceSettings.isDeviceSecure BOOLEAN

Whether the device is secured with PIN/password

deviceSettings.unknownSourcesEnabled BOOLEAN

Whether installing apps from unknown sources is enabled

deviceSettings.verifyAppsEnabled BOOLEAN

Whether Verify Apps (Google Play Protect (https://support.google.com/googleplay/answer/2812853)) is enabled on the device

state ENUMERATION

The state to be applied to the device. This field can be modified by a patch request. Note that when calling enterprises.devices.patch, ACTIVE and DISABLED are the only allowable values. To enter the device into a DELETED state, call enterprises.devices.delete

enrollmentTime ANY

The time of device enrollment

hardwareInfo OBJECT

Information about device hardware. The fields related to temperature thresholds are only available if hardwareStatusEnabled is true in the device's policy

hardwareInfo.model STRING

The model of the device. For example, Asus Nexus 7

hardwareInfo.cpuShutdownTemperatures[] FLOAT

hardwareInfo.skinThrottlingTemperatures[] FLOAT

hardwareInfo.hardware STRING

Name of the hardware. For example, Angler

hardwareInfo.cpuThrottlingTemperatures[] FLOAT

hardwareInfo.gpuShutdownTemperatures[] FLOAT

hardwareInfo.gpuThrottlingTemperatures[] FLOAT

hardwareInfo.batteryThrottlingTemperatures[] FLOAT

hardwareInfo.manufacturer STRING

Manufacturer. For example, Motorola

hardwareInfo.serialNumber STRING

The device serial number

hardwareInfo.brand STRING

Brand of the device. For example, Google

hardwareInfo.deviceBasebandVersion STRING

Baseband version. For example, MDM9625_104662.22.05.34p

hardwareInfo.batteryShutdownTemperatures[] FLOAT

hardwareInfo.skinShutdownTemperatures[] FLOAT

softwareInfo OBJECT

Information about device software

softwareInfo.androidDevicePolicyVersionName STRING

The Android Device Policy app version as displayed to the user

softwareInfo.bootloaderVersion STRING

The system bootloader version number, e.g. 0.6.7

softwareInfo.androidDevicePolicyVersionCode INTEGER

The Android Device Policy app version code

softwareInfo.deviceKernelVersion STRING

Kernel version, for example, 2.6.32.9-g103d848

softwareInfo.androidBuildTime ANY

Build time

softwareInfo.securityPatchLevel STRING

Security patch level, e.g. 2016-05-01

softwareInfo.androidBuildNumber STRING

Android build ID string meant for displaying to the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys

softwareInfo.androidVersion STRING

The user-visible Android version string. For example, 6.0.1

softwareInfo.primaryLanguageCode STRING

An IETF BCP 47 language code for the primary locale on the device

softwareInfo.deviceBuildSignature STRING

SHA-256 hash of android.content.pm.Signature (https://developer.android.com/reference/android/content/pm/Signature.html) associated with the system package, which can be used to verify that the system build hasn't been modified

disabledReason OBJECT

Provides a user-facing message with locale info. The maximum message length is 4096 characters

disabledReason.defaultMessage STRING

The default message displayed if no localized message is specified or the user's locale doesn't match with any of the localized messages. A default message must be provided if any localized messages are provided

disabledReason.localizedMessages OBJECT

A map containing <locale, message> pairs, where locale is a well-formed BCP 47 language (https://www.w3.org/International/articles/language-tags/) code, such as en-US, es-ES, or fr

disabledReason.localizedMessages.customKey.value STRING Required

A map containing <locale, message> pairs, where locale is a well-formed BCP 47 language (https://www.w3.org/International/articles/language-tags/) code, such as en-US, es-ES, or fr

appliedPolicyVersion INTEGER

The version of the policy currently applied to the device

displays[] OBJECT

Device display information

displays[].density INTEGER

Display density expressed as dots-per-inch

displays[].height INTEGER

Display height in pixels

displays[].width INTEGER

Display width in pixels

displays[].refreshRate INTEGER

Refresh rate of the display in frames per second

displays[].displayId INTEGER

Unique display id

displays[].state ENUMERATION

State of the display

displays[].name STRING

Name of the display

applicationReports[] OBJECT

Information reported about an installed app

applicationReports[].state ENUMERATION

Application state

applicationReports[].applicationSource ENUMERATION

The source of the package

applicationReports[].keyedAppStates[] OBJECT

Keyed app state reported by the app

applicationReports[].keyedAppStates[].data STRING

Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data < 10”)

applicationReports[].keyedAppStates[].key STRING

The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key

applicationReports[].keyedAppStates[].message STRING

Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message

applicationReports[].keyedAppStates[].createTime ANY

The creation time of the app state on the device

applicationReports[].keyedAppStates[].severity ENUMERATION

The severity of the app state

applicationReports[].keyedAppStates[].lastUpdateTime ANY

The time the app state was most recently updated

applicationReports[].packageName STRING

Package name of the app

applicationReports[].versionName STRING

The app version as displayed to the user

applicationReports[].versionCode INTEGER

The app version code, which can be used to determine whether one version is more recent than another

applicationReports[].packageSha256Hash STRING

The SHA-256 hash of the app's APK file, which can be used to verify the app hasn't been modified. Each byte of the hash value is represented as a two-digit hexadecimal number

applicationReports[].events[] OBJECT

An app-related event

applicationReports[].events[].eventType ENUMERATION

App event type

applicationReports[].events[].createTime ANY

The creation time of the event

applicationReports[].displayName STRING

The display name of the app

applicationReports[].installerPackageName STRING

The package name of the app that installed this app

applicationReports[].signingKeyCertFingerprints[] STRING

apiLevel INTEGER

The API level of the Android platform version running on the device

userName STRING

The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}

networkInfo OBJECT

Device network info

networkInfo.networkOperatorName STRING

Alphabetic name of current registered operator. For example, Vodafone

networkInfo.imei STRING

IMEI number of the GSM device. For example, A1000031212

networkInfo.meid STRING

MEID number of the CDMA device. For example, A00000292788E1

networkInfo.wifiMacAddress STRING

Wi-Fi MAC address of the device. For example, 7c:11:11:11:11:11

memoryInfo OBJECT

Information about device memory and storage

memoryInfo.totalRam INTEGER

Total RAM on device in bytes

memoryInfo.totalInternalStorage INTEGER

Total internal storage on device in bytes

memoryEvents[] OBJECT

An event related to memory and storage measurements

memoryEvents[].eventType ENUMERATION

Event type

memoryEvents[].createTime ANY

The creation time of the event

memoryEvents[].byteCount INTEGER

The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium

systemProperties OBJECT

Map of selected system properties name and value related to the device

systemProperties.customKey.value STRING Required

Map of selected system properties name and value related to the device

appliedState ENUMERATION

The state currently applied to the device

hardwareStatusSamples[] OBJECT

Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health

hardwareStatusSamples[].createTime ANY

The time the measurements were taken

hardwareStatusSamples[].fanSpeeds[] FLOAT

hardwareStatusSamples[].cpuUsages[] FLOAT

hardwareStatusSamples[].skinTemperatures[] FLOAT

hardwareStatusSamples[].batteryTemperatures[] FLOAT

hardwareStatusSamples[].cpuTemperatures[] FLOAT

hardwareStatusSamples[].gpuTemperatures[] FLOAT

appliedPolicyName STRING

The name of the policy currently applied to the device

lastPolicySyncTime ANY

The last time the device fetched its policy

policyName STRING

The name of the policy applied to the device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy_name for the device's user is applied. This field can be modified by a patch request. You can specify only the policyId when calling enterprises.devices.patch, as long as the policyId doesn’t contain any slashes. The rest of the policy name is inferred

powerManagementEvents[] OBJECT

A power management event

powerManagementEvents[].batteryLevel FLOAT

For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage

powerManagementEvents[].eventType ENUMERATION

Event type

powerManagementEvents[].createTime ANY

The creation time of the event

name STRING

The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}

enrollmentTokenName STRING

If the device was enrolled with an enrollment token, this field contains the name of the token

lastPolicyComplianceReportTime ANY

Deprecated

enrollmentTokenData STRING

If the device was enrolled with an enrollment token with additional data provided, this field contains that data

managementMode ENUMERATION

The type of management mode Android Device Policy takes on the device. This influences which policy settings are supported

nonComplianceDetails[] OBJECT

Provides detail about non-compliance with a policy setting

nonComplianceDetails[].installationFailureReason ENUMERATION

If package_name is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app can't be installed or updated

nonComplianceDetails[].packageName STRING

The package name indicating which app is out of compliance, if applicable

nonComplianceDetails[].fieldPath STRING

For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url

nonComplianceDetails[].currentValue ANY

If the policy setting could not be applied, the current value of the setting on the device

nonComplianceDetails[].settingName STRING

The name of the policy setting. This is the JSON field name of a top-level Policy field

nonComplianceDetails[].nonComplianceReason ENUMERATION

The reason the device is not in compliance with the setting

user OBJECT

A user belonging to an enterprise

user.accountIdentifier STRING

A unique identifier you create for this user, such as user342 or asset#44418. This field must be set when the user is created and can't be updated. This field must not contain personally identifiable information (PII). This identifier must be 1024 characters or less; otherwise, the update policy request will fail

Output

This building block provides 118 output parameters

  = Parameter name
  = Format

previousDeviceNames[] STRING

lastStatusReportTime ANY

The last time the device sent a status report

policyCompliant BOOLEAN

Whether the device is compliant with its policy

deviceSettings OBJECT

Information about security related device settings on device

deviceSettings.developmentSettingsEnabled BOOLEAN

Whether developer mode is enabled on the device

deviceSettings.adbEnabled BOOLEAN

Whether ADB (https://developer.android.com/studio/command-line/adb.html) is enabled on the device

deviceSettings.isEncrypted BOOLEAN

Whether the storage encryption is enabled

deviceSettings.encryptionStatus ENUMERATION

Encryption status from DevicePolicyManager

deviceSettings.isDeviceSecure BOOLEAN

Whether the device is secured with PIN/password

deviceSettings.unknownSourcesEnabled BOOLEAN

Whether installing apps from unknown sources is enabled

deviceSettings.verifyAppsEnabled BOOLEAN

Whether Verify Apps (Google Play Protect (https://support.google.com/googleplay/answer/2812853)) is enabled on the device

state ENUMERATION

The state to be applied to the device. This field can be modified by a patch request. Note that when calling enterprises.devices.patch, ACTIVE and DISABLED are the only allowable values. To enter the device into a DELETED state, call enterprises.devices.delete

enrollmentTime ANY

The time of device enrollment

hardwareInfo OBJECT

Information about device hardware. The fields related to temperature thresholds are only available if hardwareStatusEnabled is true in the device's policy

hardwareInfo.model STRING

The model of the device. For example, Asus Nexus 7

hardwareInfo.cpuShutdownTemperatures[] FLOAT

hardwareInfo.skinThrottlingTemperatures[] FLOAT

hardwareInfo.hardware STRING

Name of the hardware. For example, Angler

hardwareInfo.cpuThrottlingTemperatures[] FLOAT

hardwareInfo.gpuShutdownTemperatures[] FLOAT

hardwareInfo.gpuThrottlingTemperatures[] FLOAT

hardwareInfo.batteryThrottlingTemperatures[] FLOAT

hardwareInfo.manufacturer STRING

Manufacturer. For example, Motorola

hardwareInfo.serialNumber STRING

The device serial number

hardwareInfo.brand STRING

Brand of the device. For example, Google

hardwareInfo.deviceBasebandVersion STRING

Baseband version. For example, MDM9625_104662.22.05.34p

hardwareInfo.batteryShutdownTemperatures[] FLOAT

hardwareInfo.skinShutdownTemperatures[] FLOAT

softwareInfo OBJECT

Information about device software

softwareInfo.androidDevicePolicyVersionName STRING

The Android Device Policy app version as displayed to the user

softwareInfo.bootloaderVersion STRING

The system bootloader version number, e.g. 0.6.7

softwareInfo.androidDevicePolicyVersionCode INTEGER

The Android Device Policy app version code

softwareInfo.deviceKernelVersion STRING

Kernel version, for example, 2.6.32.9-g103d848

softwareInfo.androidBuildTime ANY

Build time

softwareInfo.securityPatchLevel STRING

Security patch level, e.g. 2016-05-01

softwareInfo.androidBuildNumber STRING

Android build ID string meant for displaying to the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys

softwareInfo.androidVersion STRING

The user-visible Android version string. For example, 6.0.1

softwareInfo.primaryLanguageCode STRING

An IETF BCP 47 language code for the primary locale on the device

softwareInfo.deviceBuildSignature STRING

SHA-256 hash of android.content.pm.Signature (https://developer.android.com/reference/android/content/pm/Signature.html) associated with the system package, which can be used to verify that the system build hasn't been modified

disabledReason OBJECT

Provides a user-facing message with locale info. The maximum message length is 4096 characters

disabledReason.defaultMessage STRING

The default message displayed if no localized message is specified or the user's locale doesn't match with any of the localized messages. A default message must be provided if any localized messages are provided

disabledReason.localizedMessages OBJECT

A map containing <locale, message> pairs, where locale is a well-formed BCP 47 language (https://www.w3.org/International/articles/language-tags/) code, such as en-US, es-ES, or fr

disabledReason.localizedMessages.customKey.value STRING

A map containing <locale, message> pairs, where locale is a well-formed BCP 47 language (https://www.w3.org/International/articles/language-tags/) code, such as en-US, es-ES, or fr

appliedPolicyVersion INTEGER

The version of the policy currently applied to the device

displays[] OBJECT

Device display information

displays[].density INTEGER

Display density expressed as dots-per-inch

displays[].height INTEGER

Display height in pixels

displays[].width INTEGER

Display width in pixels

displays[].refreshRate INTEGER

Refresh rate of the display in frames per second

displays[].displayId INTEGER

Unique display id

displays[].state ENUMERATION

State of the display

displays[].name STRING

Name of the display

applicationReports[] OBJECT

Information reported about an installed app

applicationReports[].state ENUMERATION

Application state

applicationReports[].applicationSource ENUMERATION

The source of the package

applicationReports[].keyedAppStates[] OBJECT

Keyed app state reported by the app

applicationReports[].keyedAppStates[].data STRING

Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data < 10”)

applicationReports[].keyedAppStates[].key STRING

The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key

applicationReports[].keyedAppStates[].message STRING

Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message

applicationReports[].keyedAppStates[].createTime ANY

The creation time of the app state on the device

applicationReports[].keyedAppStates[].severity ENUMERATION

The severity of the app state

applicationReports[].keyedAppStates[].lastUpdateTime ANY

The time the app state was most recently updated

applicationReports[].packageName STRING

Package name of the app

applicationReports[].versionName STRING

The app version as displayed to the user

applicationReports[].versionCode INTEGER

The app version code, which can be used to determine whether one version is more recent than another

applicationReports[].packageSha256Hash STRING

The SHA-256 hash of the app's APK file, which can be used to verify the app hasn't been modified. Each byte of the hash value is represented as a two-digit hexadecimal number

applicationReports[].events[] OBJECT

An app-related event

applicationReports[].events[].eventType ENUMERATION

App event type

applicationReports[].events[].createTime ANY

The creation time of the event

applicationReports[].displayName STRING

The display name of the app

applicationReports[].installerPackageName STRING

The package name of the app that installed this app

applicationReports[].signingKeyCertFingerprints[] STRING

apiLevel INTEGER

The API level of the Android platform version running on the device

userName STRING

The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}

networkInfo OBJECT

Device network info

networkInfo.networkOperatorName STRING

Alphabetic name of current registered operator. For example, Vodafone

networkInfo.imei STRING

IMEI number of the GSM device. For example, A1000031212

networkInfo.meid STRING

MEID number of the CDMA device. For example, A00000292788E1

networkInfo.wifiMacAddress STRING

Wi-Fi MAC address of the device. For example, 7c:11:11:11:11:11

memoryInfo OBJECT

Information about device memory and storage

memoryInfo.totalRam INTEGER

Total RAM on device in bytes

memoryInfo.totalInternalStorage INTEGER

Total internal storage on device in bytes

memoryEvents[] OBJECT

An event related to memory and storage measurements

memoryEvents[].eventType ENUMERATION

Event type

memoryEvents[].createTime ANY

The creation time of the event

memoryEvents[].byteCount INTEGER

The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium

systemProperties OBJECT

Map of selected system properties name and value related to the device

systemProperties.customKey.value STRING

Map of selected system properties name and value related to the device

appliedState ENUMERATION

The state currently applied to the device

hardwareStatusSamples[] OBJECT

Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health

hardwareStatusSamples[].createTime ANY

The time the measurements were taken

hardwareStatusSamples[].fanSpeeds[] FLOAT

hardwareStatusSamples[].cpuUsages[] FLOAT

hardwareStatusSamples[].skinTemperatures[] FLOAT

hardwareStatusSamples[].batteryTemperatures[] FLOAT

hardwareStatusSamples[].cpuTemperatures[] FLOAT

hardwareStatusSamples[].gpuTemperatures[] FLOAT

appliedPolicyName STRING

The name of the policy currently applied to the device

lastPolicySyncTime ANY

The last time the device fetched its policy

policyName STRING

The name of the policy applied to the device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy_name for the device's user is applied. This field can be modified by a patch request. You can specify only the policyId when calling enterprises.devices.patch, as long as the policyId doesn’t contain any slashes. The rest of the policy name is inferred

powerManagementEvents[] OBJECT

A power management event

powerManagementEvents[].batteryLevel FLOAT

For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage

powerManagementEvents[].eventType ENUMERATION

Event type

powerManagementEvents[].createTime ANY

The creation time of the event

name STRING

The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}

enrollmentTokenName STRING

If the device was enrolled with an enrollment token, this field contains the name of the token

lastPolicyComplianceReportTime ANY

Deprecated

enrollmentTokenData STRING

If the device was enrolled with an enrollment token with additional data provided, this field contains that data

managementMode ENUMERATION

The type of management mode Android Device Policy takes on the device. This influences which policy settings are supported

nonComplianceDetails[] OBJECT

Provides detail about non-compliance with a policy setting

nonComplianceDetails[].installationFailureReason ENUMERATION

If package_name is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app can't be installed or updated

nonComplianceDetails[].packageName STRING

The package name indicating which app is out of compliance, if applicable

nonComplianceDetails[].fieldPath STRING

For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url

nonComplianceDetails[].currentValue ANY

If the policy setting could not be applied, the current value of the setting on the device

nonComplianceDetails[].settingName STRING

The name of the policy setting. This is the JSON field name of a top-level Policy field

nonComplianceDetails[].nonComplianceReason ENUMERATION

The reason the device is not in compliance with the setting

user OBJECT

A user belonging to an enterprise

user.accountIdentifier STRING

A unique identifier you create for this user, such as user342 or asset#44418. This field must be set when the user is created and can't be updated. This field must not contain personally identifiable information (PII). This identifier must be 1024 characters or less; otherwise, the update policy request will fail