- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- Command
- CommandType
- CommandErrorCode
- ResetPasswordFlag
- ClearAppsDataParams
- StartLostModeParams
- StopLostModeParams
- AddEsimParams
- ActivationState
- RemoveEsimParams
- RequestDeviceInfoParams
- DeviceInfo
- ClearAppsDataStatus
- PerAppResult
- ClearingResult
- StartLostModeStatus
- Status
- StopLostModeStatus
- Status
- EsimCommandStatus
- Status
- InternalErrorDetails
- OperationCodeDetail
- ErrorCodeDetail
- EsimInfo
- RequestDeviceInfoStatus
- Status
- EidInfo
- Eid
- Try it!
Issues a command to a device. The Operation
resource returned contains a Command
in its metadata
field. Use the get operation method to get the status of the command.
HTTP request
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*}:issueCommand
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
The name of the device in the form |
Request body
The request body contains an instance of Command
.
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/androidmanagement
For more information, see the OAuth 2.0 Overview.
Command
A command.
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
The type of the command. |
createTime |
The timestamp at which the command was created. The timestamp is automatically generated by the server. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
duration |
The duration for which the command is valid. The command will expire if not executed by the device during this time. The default duration if unspecified is ten minutes. There is no maximum duration. A duration in seconds with up to nine fractional digits, ending with ' |
userName |
The resource name of the user that owns the device in the form |
errorCode |
If the command failed, an error code explaining the failure. This is not set when the command is cancelled by the caller. For reasoning about command errors, prefer fields in the following order (most preferred first): 1. Command-specific fields like |
newPassword |
For commands of type |
resetPasswordFlags[] |
For commands of type |
Union field If this is set, then the fields |
|
clearAppsDataParams |
Parameters for the |
startLostModeParams |
Parameters for the |
stopLostModeParams |
Parameters for the |
addEsimParams |
Optional. Parameters for the |
removeEsimParams |
Optional. Parameters for the |
requestDeviceInfoParams |
Optional. Parameters for the |
Union field status . Status specific to the command. Note that some commands do not use this, in particular , , , and . In future these commands may use this as well. status can be only one of the following: |
|
clearAppsDataStatus |
Output only. Status of the |
startLostModeStatus |
Output only. Status of the |
stopLostModeStatus |
Output only. Status of the |
esimStatus |
Output only. Status of an |
requestDeviceInfoStatus |
Output only. Status of the |
CommandType
Types of commands.
Enums | |
---|---|
COMMAND_TYPE_UNSPECIFIED |
This value is disallowed. |
LOCK |
Lock the device, as if the lock screen timeout had expired. |
RESET_PASSWORD |
Reset the user's password. |
REBOOT |
Reboot the device. Only supported on fully managed devices running Android 7.0 (API level 24) or higher. |
RELINQUISH_OWNERSHIP |
Removes the work profile and all policies from a company-owned Android 8.0+ device, relinquishing the device for personal use. Apps and data associated with the personal profile(s) are preserved. The device will be deleted from the server after it acknowledges the command. |
CLEAR_APP_DATA |
Clears the application data of specified apps. This is supported on Android 9 and above. Note that an application can store data outside of its application data, for example in external storage or in a user dictionary. See also . |
START_LOST_MODE |
Puts the device into lost mode. Only supported on fully managed devices or organization-owned devices with a managed profile. See also . |
STOP_LOST_MODE |
Takes the device out of lost mode. Only supported on fully managed devices or organization-owned devices with a managed profile. See also . |
ADD_ESIM |
Adds an eSIM profile to the device. This is supported on Android 15 and above. See also . To remove an eSIM profile, use the command. To determine what happens to the eSIM profile when a device is wiped, set in the policy. Note: To provision multiple eSIMs on a single device, it is recommended to introduce a delay of a few minutes between successive executions of the command. |
REMOVE_ESIM |
Removes an eSIM profile from the device. This is supported on Android 15 and above. See also . |
REQUEST_DEVICE_INFO |
Request information related to the device. |
CommandErrorCode
A command error code. This is a read-only field populated by the server.
Enums | |
---|---|
COMMAND_ERROR_CODE_UNSPECIFIED |
There was no error. |
UNKNOWN |
An unknown error occurred. |
API_LEVEL |
The API level of the device does not support this command. |
MANAGEMENT_MODE |
The management mode (profile owner, device owner, etc.) does not support the command. |
INVALID_VALUE |
The command has an invalid parameter value. |
UNSUPPORTED |
The device doesn't support the command. Updating Android Device Policy to the latest version may resolve the issue. |
ResetPasswordFlag
Flags that can be used for the RESET_PASSWORD
command type.
Enums | |
---|---|
RESET_PASSWORD_FLAG_UNSPECIFIED |
This value is ignored. |
REQUIRE_ENTRY |
Don't allow other admins to change the password again until the user has entered it. |
DO_NOT_ASK_CREDENTIALS_ON_BOOT |
Don't ask for user credentials on device boot. |
LOCK_NOW |
Lock the device after password reset. |
ClearAppsDataParams
Parameters associated with the
command to clear the data of specified apps from the device.CLEAR_APP_DATA
JSON representation |
---|
{ "packageNames": [ string ] } |
Fields | |
---|---|
packageNames[] |
The package names of the apps whose data will be cleared when the command is executed. |
StartLostModeParams
Parameters associated with the
command to put the device into lost mode. At least one of the parameters, not including the organization name, must be provided in order for the device to be put into lost mode.START_LOST_MODE
JSON representation |
---|
{ "lostMessage": { object ( |
Fields | |
---|---|
lostMessage |
The message displayed to the user when the device is in lost mode. |
lostPhoneNumber |
The phone number that will be called when the device is in lost mode and the call owner button is tapped. |
lostEmailAddress |
The email address displayed to the user when the device is in lost mode. |
lostStreetAddress |
The street address displayed to the user when the device is in lost mode. |
lostOrganization |
The organization name displayed to the user when the device is in lost mode. |
StopLostModeParams
This type has no fields.
Parameters associated with the
command to take the device out of lost mode.STOP_LOST_MODE
AddEsimParams
Parameters associated with the
command to add an eSIM profile to the device.ADD_ESIM
JSON representation |
---|
{
"activationCode": string,
"activationState": enum ( |
Fields | |
---|---|
activationCode |
Required. The activation code for the eSIM profile. |
activationState |
Required. The activation state of the eSIM profile once it is downloaded. |
ActivationState
The activation state of the eSIM profile once it is downloaded.
Enums | |
---|---|
ACTIVATION_STATE_UNSPECIFIED |
eSIM activation state is not specified. This defaults to the eSIM profile being on personally-owned devices and on company-owned devices. |
ACTIVATED |
The eSIM is automatically activated after downloading. Setting this as the activation state for personally-owned devices will result in the command being rejected. |
NOT_ACTIVATED |
The eSIM profile is downloaded but not activated. In this case, the user will need to activate the eSIM manually on the device. |
RemoveEsimParams
Parameters associated with the
command to remove an eSIM profile from the device.REMOVE_ESIM
JSON representation |
---|
{ "iccId": string } |
Fields | |
---|---|
iccId |
Required. ICC ID of the eSIM profile to be deleted. |
RequestDeviceInfoParams
Parameters associated with the
command to get device related information.REQUEST_DEVICE_INFO
JSON representation |
---|
{
"deviceInfo": enum ( |
Fields | |
---|---|
deviceInfo |
Required. Type of device information to be requested. |
DeviceInfo
Type of device information to be requested.
Enums | |
---|---|
DEVICE_INFO_UNSPECIFIED |
This value is disallowed. |
EID |
Request the identifier for eSIM. The user will be asked to approve the disclosure of the information before the result can be returned. If the user doesn't approve the disclosure, will be returned. This is supported only for personally owned devices with work profiles and Android versions 13 and above. |
ClearAppsDataStatus
Status of the
command to clear the data of specified apps from the device.CLEAR_APP_DATA
JSON representation |
---|
{
"results": {
string: {
object ( |
Fields | |
---|---|
results |
The per-app results, a mapping from package names to the respective clearing result. An object containing a list of |
PerAppResult
The result of an attempt to clear the data of a single app.
JSON representation |
---|
{
"clearingResult": enum ( |
Fields | |
---|---|
clearingResult |
The result of an attempt to clear the data of a single app. |
ClearingResult
The result of an attempt to clear the data of a single app.
Enums | |
---|---|
CLEARING_RESULT_UNSPECIFIED |
Unspecified result. |
SUCCESS |
This app’s data was successfully cleared. |
APP_NOT_FOUND |
This app’s data could not be cleared because the app was not found. |
APP_PROTECTED |
This app’s data could not be cleared because the app is protected. For example, this may apply to apps critical to the functioning of the device, such as Google Play Store. |
API_LEVEL |
This app’s data could not be cleared because the device API level does not support this command. |
StartLostModeStatus
Status of the
command to put the device into lost mode.START_LOST_MODE
JSON representation |
---|
{
"status": enum ( |
Fields | |
---|---|
status |
The status. See |
Status
The status. See
.StartLostModeStatus
Enums | |
---|---|
STATUS_UNSPECIFIED |
Unspecified. This value is not used. |
SUCCESS |
The device was put into lost mode. |
RESET_PASSWORD_RECENTLY |
The device could not be put into lost mode because the admin reset the device's password recently. |
USER_EXIT_LOST_MODE_RECENTLY |
The device could not be put into lost mode because the user exited lost mode recently. |
ALREADY_IN_LOST_MODE |
The device is already in lost mode. |
StopLostModeStatus
Status of the
command to take the device out of lost mode.STOP_LOST_MODE
JSON representation |
---|
{
"status": enum ( |
Fields | |
---|---|
status |
The status. See |
Status
The status. See
.StopLostModeStatus
Enums | |
---|---|
STATUS_UNSPECIFIED |
Unspecified. This value is not used. |
SUCCESS |
The device was taken out of lost mode. |
NOT_IN_LOST_MODE |
The device is not in lost mode. |
EsimCommandStatus
Status and error details (if present) of an
or ADD_ESIM
command.REMOVE_ESIM
JSON representation |
---|
{ "status": enum ( |
Fields | |
---|---|
status |
Output only. Status of an |
esimInfo |
Output only. Information about the eSIM added or removed. This is populated only when the eSIM operation |
Union field status_details . Details of the status of an or command. status_details can be only one of the following: |
|
internalErrorDetails |
Output only. Details of the error if the |
Status
Status of an
or ADD_ESIM
command.REMOVE_ESIM
Enums | |
---|---|
STATUS_UNSPECIFIED |
Unspecified. This value is not used. |
SUCCESS |
The eSIM operation was successfully performed on the device. |
IN_PROGRESS |
The eSIM operation is in progress. |
PENDING_USER_ACTION |
The user needs to take an action for the eSIM operation to proceed. |
ERROR_SETUP_IN_PROGRESS |
The eSIM operation cannot be executed when setup is in progress. |
ERROR_USER_DENIED |
The user has denied the eSIM operation. |
INTERNAL_ERROR |
An error has occurred while trying to add or remove the eSIM on the device, see . |
ERROR_ICC_ID_NOT_FOUND |
For a command, the of the eSIM to be removed was not found on the device. This could either mean the eSIM does not belong to the enterprise or the eSIM corresponding to the is not present on the device. |
ERROR_MULTIPLE_ACTIVE_ESIMS_NO_AVAILABLE_SLOT |
The command failed when attempting to add a new eSIM with its activation state set to since multiple eSIM slots on the device contain active eSIM profiles and there is no free eSIM slot available. To resolve this, the new eSIM can be added with its activation state as for later manual activation, or the user must first deactivate an existing active eSIM for the operation to proceed. |
InternalErrorDetails
Internal error details if present for the
or ADD_ESIM
command.REMOVE_ESIM
JSON representation |
---|
{ "operationCode": string, "errorCode": string, "operationCodeDetail": enum ( |
Fields | |
---|---|
operationCode |
Output only. Integer representation of the operation code as specified here. See |
errorCode |
Output only. Integer representation of the error code as specified here. See also, |
operationCodeDetail |
Output only. The operation code detail corresponding to the |
errorCodeDetail |
Output only. The error code detail corresponding to the |
OperationCodeDetail
The operation code detail corresponding to the
.operationCode
Enums | |
---|---|
OPERATION_CODE_DETAIL_UNSPECIFIED |
Operation code detail is unspecified. The is not recognized by Android Management API. However, see . |
OPERATION_SYSTEM |
See EuiccManager.OPERATION_SYSTEM for details. |
OPERATION_SIM_SLOT |
See EuiccManager.OPERATION_SIM_SLOT for details. |
OPERATION_EUICC_CARD |
See EuiccManager.OPERATION_EUICC_CARD for details. |
OPERATION_SMDX |
See EuiccManager.OPERATION_SMDX for details. |
OPERATION_SWITCH |
See EuiccManager.OPERATION_SWITCH for details. |
OPERATION_DOWNLOAD |
See EuiccManager.OPERATION_DOWNLOAD for details. |
OPERATION_METADATA |
See EuiccManager.OPERATION_METADATA for details. |
OPERATION_EUICC_GSMA |
See EuiccManager.OPERATION_EUICC_GSMA for details. |
OPERATION_APDU |
See EuiccManager.OPERATION_APDU for details. |
OPERATION_SMDX_SUBJECT_REASON_CODE |
See EuiccManager.OPERATION_SMDX_SUBJECT_REASON_CODE for details. Note that, in this case, is the least significant 3 bytes of the EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE specifying the subject code and the reason code as indicated here. The most significant byte of the integer is zeroed out. For example, a Subject Code of 8.11.1 and a Reason Code of 5.1 is represented in as 0000 0000 1000 1011 0001 0000 0101 0001 in binary, which is 9113681 in decimal. |
OPERATION_HTTP |
See EuiccManager.OPERATION_HTTP for details. |
ErrorCodeDetail
Error code detail corresponding to the
.errorCode
Enums | |
---|---|
ERROR_CODE_DETAIL_UNSPECIFIED |
Error code detail is unspecified. The is not recognized by Android Management API. However, see
|
ERROR_TIME_OUT |
See EuiccManager.ERROR_TIME_OUT for details. |
ERROR_EUICC_MISSING |
See EuiccManager.ERROR_EUICC_MISSING for details. |
ERROR_UNSUPPORTED_VERSION |
See EuiccManager.ERROR_UNSUPPORTED_VERSION for details. |
ERROR_ADDRESS_MISSING |
See EuiccManager.ERROR_ADDRESS_MISSING for details. |
ERROR_INVALID_CONFIRMATION_CODE |
See EuiccManager.ERROR_INVALID_CONFIRMATION_CODE for details. |
ERROR_CERTIFICATE_ERROR |
See EuiccManager.ERROR_CERTIFICATE_ERROR for details. |
ERROR_NO_PROFILES_AVAILABLE |
See EuiccManager.ERROR_NO_PROFILES_AVAILABLE for details. |
ERROR_CONNECTION_ERROR |
See EuiccManager.ERROR_CONNECTION_ERROR for details. |
ERROR_INVALID_RESPONSE |
See EuiccManager.ERROR_INVALID_RESPONSE for details. |
ERROR_CARRIER_LOCKED |
See EuiccManager.ERROR_CARRIER_LOCKED for details. |
ERROR_DISALLOWED_BY_PPR |
See EuiccManager.ERROR_DISALLOWED_BY_PPR for details. |
ERROR_INVALID_ACTIVATION_CODE |
See EuiccManager.ERROR_INVALID_ACTIVATION_CODE for details. |
ERROR_INCOMPATIBLE_CARRIER |
See EuiccManager.ERROR_INCOMPATIBLE_CARRIER for details. |
ERROR_OPERATION_BUSY |
See EuiccManager.ERROR_OPERATION_BUSY for details. |
ERROR_INSTALL_PROFILE |
See EuiccManager.ERROR_INSTALL_PROFILE for details. |
ERROR_EUICC_INSUFFICIENT_MEMORY |
See EuiccManager.ERROR_EUICC_INSUFFICIENT_MEMORY for details. |
ERROR_INVALID_PORT |
See EuiccManager.ERROR_INVALID_PORT for details. |
ERROR_SIM_MISSING |
See EuiccManager.ERROR_SIM_MISSING for details. |
EsimInfo
Details of the eSIM added or removed.
JSON representation |
---|
{ "iccId": string } |
Fields | |
---|---|
iccId |
Output only. ICC ID of the eSIM. |
RequestDeviceInfoStatus
Status of the
command.REQUEST_DEVICE_INFO
JSON representation |
---|
{ "status": enum ( |
Fields | |
---|---|
status |
Output only. Status of a |
Union field device_info . Details of the device information requested by the admin. This is populated only when the is . device_info can be only one of the following: |
|
eidInfo |
Information related to the EIDs of the device. |
Status
Status of a
command.REQUEST_DEVICE_INFO
Enums | |
---|---|
STATUS_UNSPECIFIED |
Unspecified. This value is not used. |
SUCCEEDED |
Device information has been successfully delivered. |
PENDING_USER_ACTION |
The user has not completed the actions required to share device information. |
USER_DECLINED |
The user declined sharing device information. |
UNSUPPORTED |
The requested device info is not supported on this device, e.g. eSIM is not supported on the device. |
EidInfo
Information related to the EIDs of the device.
JSON representation |
---|
{
"eids": [
{
object ( |
Fields | |
---|---|
eids[] |
Output only. EID information for each eUICC chip. |
Eid
EID information for each eUICC chip.
JSON representation |
---|
{ "eid": string } |
Fields | |
---|---|
eid |
Output only. The EID |