---
title: "POST /v1/{+name}:issueCommand"
method: POST
path: "/v1/{+name}:issueCommand"
tags: ["enterprises"]
---

# POST /v1/{+name}:issueCommand

`POST /v1/{+name}:issueCommand`

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.

## Path parameters

- `name` string, required

## Request body

- Command — A command.
  - `clearAppsDataStatus` ClearAppsDataStatus — Status of the CLEAR_APP_DATA command to clear the data of specified apps from the device.
    - `results` object — The per-app results, a mapping from package names to the respective clearing result.
  - `stopLostModeStatus` StopLostModeStatus — Status of the STOP_LOST_MODE command to take the device out of lost mode.
    - `status` 'STATUS_UNSPECIFIED' | 'SUCCESS' | 'NOT_IN_LOST_MODE' — The status. See StopLostModeStatus.
  - `errorCode` 'COMMAND_ERROR_CODE_UNSPECIFIED' | 'UNKNOWN' | 'API_LEVEL' | 'MANAGEMENT_MODE' | 'INVALID_VALUE' | 'UNSUPPORTED' — 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 clearAppsDataStatus, startLostModeStatus, or similar, if they exist. 2. This field, if set. 3. The generic error field in the Operation that wraps the command.
  - `type` 'COMMAND_TYPE_UNSPECIFIED' | 'LOCK' | 'RESET_PASSWORD' | 'REBOOT' | 'RELINQUISH_OWNERSHIP' | 'CLEAR_APP_DATA' | 'START_LOST_MODE' | 'STOP_LOST_MODE' | 'ADD_ESIM' | 'REMOVE_ESIM' | 'REQUEST_DEVICE_INFO' | 'WIPE' — The type of the command.
  - `clearAppsDataParams` ClearAppsDataParams — Parameters associated with the CLEAR_APP_DATA command to clear the data of specified apps from the device.
    - `packageNames` string[] — The package names of the apps whose data will be cleared when the command is executed.
  - `removeEsimParams` RemoveEsimParams — Parameters associated with the REMOVE_ESIM command to remove an eSIM profile from the device.
    - `iccId` string — Required. ICC ID of the eSIM profile to be deleted.
  - `requestDeviceInfoParams` RequestDeviceInfoParams — Parameters associated with the REQUEST_DEVICE_INFO command to get device related information.
    - `deviceInfo` 'DEVICE_INFO_UNSPECIFIED' | 'EID' — Required. Type of device information to be requested.
  - `createTime` string, google-datetime — The timestamp at which the command was created. The timestamp is automatically generated by the server.
  - `startLostModeParams` StartLostModeParams — Parameters associated with the START_LOST_MODE 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.
    - `lostEmailAddress` string — The email address displayed to the user when the device is in lost mode.
    - `lostMessage` UserFacingMessage — Provides a user-facing message with locale info. The maximum message length is 4096 characters.
      - `localizedMessages` object — A map containing 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.
      - `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.
    - `lostPhoneNumber` UserFacingMessage — Provides a user-facing message with locale info. The maximum message length is 4096 characters.
      - `localizedMessages` object — A map containing 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.
      - `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.
    - `lostOrganization` UserFacingMessage — Provides a user-facing message with locale info. The maximum message length is 4096 characters.
      - `localizedMessages` object — A map containing 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.
      - `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.
    - `lostStreetAddress` UserFacingMessage — Provides a user-facing message with locale info. The maximum message length is 4096 characters.
      - `localizedMessages` object — A map containing 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.
      - `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.
  - `requestDeviceInfoStatus` RequestDeviceInfoStatus — Status of the REQUEST_DEVICE_INFO command.
    - `eidInfo` EidInfo — Information related to the EIDs of the device.
      - `eids` Eid[] — Output only. EID information for each eUICC chip.
        - `eid` string — Output only. The EID
    - `status` 'STATUS_UNSPECIFIED' | 'SUCCEEDED' | 'PENDING_USER_ACTION' | 'USER_DECLINED' | 'UNSUPPORTED' — Output only. Status of a REQUEST_DEVICE_INFO command.
  - `addEsimParams` AddEsimParams — Parameters associated with the ADD_ESIM command to add an eSIM profile to the device.
    - `activationState` 'ACTIVATION_STATE_UNSPECIFIED' | 'ACTIVATED' | 'NOT_ACTIVATED' — Required. The activation state of the eSIM profile once it is downloaded.
    - `activationCode` string — Required. The activation code for the eSIM profile.
  - `wipeParams` WipeParams — Parameters associated with the WIPE command to wipe the device.
    - `wipeDataFlags` string[] — Optional. Flags to determine what data to wipe.
    - `wipeReason` UserFacingMessage — Provides a user-facing message with locale info. The maximum message length is 4096 characters.
      - `localizedMessages` object — A map containing 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.
      - `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.
  - `esimStatus` EsimCommandStatus — Status and error details (if present) of an ADD_ESIM or REMOVE_ESIM command.
    - `internalErrorDetails` InternalErrorDetails — Internal error details if present for the ADD_ESIM or REMOVE_ESIM command.
      - `operationCode` string, int64 — Output only. Integer representation of the operation code as specified here (https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE). See operation_code_detail for more details.
      - `errorCode` string, int64 — Output only. Integer representation of the error code as specified here (https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE). See also, OPERATION_SMDX_SUBJECT_REASON_CODE. See error_code_detail for more details.
      - `operationCodeDetail` 'OPERATION_CODE_DETAIL_UNSPECIFIED' | 'OPERATION_SYSTEM' | 'OPERATION_SIM_SLOT' | 'OPERATION_EUICC_CARD' | 'OPERATION_SMDX' | 'OPERATION_SWITCH' | 'OPERATION_DOWNLOAD' | 'OPERATION_METADATA' | 'OPERATION_EUICC_GSMA' | 'OPERATION_APDU' | 'OPERATION_SMDX_SUBJECT_REASON_CODE' | 'OPERATION_HTTP' — Output only. The operation code detail corresponding to the operation_code.
      - `errorCodeDetail` 'ERROR_CODE_DETAIL_UNSPECIFIED' | 'ERROR_TIME_OUT' | 'ERROR_EUICC_MISSING' | 'ERROR_UNSUPPORTED_VERSION' | 'ERROR_ADDRESS_MISSING' | 'ERROR_INVALID_CONFIRMATION_CODE' | 'ERROR_CERTIFICATE_ERROR' | 'ERROR_NO_PROFILES_AVAILABLE' | 'ERROR_CONNECTION_ERROR' | 'ERROR_INVALID_RESPONSE' | 'ERROR_CARRIER_LOCKED' | 'ERROR_DISALLOWED_BY_PPR' | 'ERROR_INVALID_ACTIVATION_CODE' | 'ERROR_INCOMPATIBLE_CARRIER' | 'ERROR_OPERATION_BUSY' | 'ERROR_INSTALL_PROFILE' | 'ERROR_EUICC_INSUFFICIENT_MEMORY' | 'ERROR_INVALID_PORT' | 'ERROR_SIM_MISSING' — Output only. The error code detail corresponding to the error_code.
    - `esimInfo` EsimInfo — Details of the eSIM added or removed.
      - `iccId` string — Output only. ICC ID of the eSIM.
    - `status` 'STATUS_UNSPECIFIED' | 'SUCCESS' | 'IN_PROGRESS' | 'PENDING_USER_ACTION' | 'ERROR_SETUP_IN_PROGRESS' | 'ERROR_USER_DENIED' | 'INTERNAL_ERROR' | 'ERROR_ICC_ID_NOT_FOUND' | 'ERROR_MULTIPLE_ACTIVE_ESIMS_NO_AVAILABLE_SLOT' — Output only. Status of an ADD_ESIM or REMOVE_ESIM command.
  - `stopLostModeParams` StopLostModeParams — Parameters associated with the STOP_LOST_MODE command to take the device out of lost mode.
  - `startLostModeStatus` StartLostModeStatus — Status of the START_LOST_MODE command to put the device into lost mode.
    - `status` 'STATUS_UNSPECIFIED' | 'SUCCESS' | 'RESET_PASSWORD_RECENTLY' | 'USER_EXIT_LOST_MODE_RECENTLY' | 'ALREADY_IN_LOST_MODE' — The status. See StartLostModeStatus.
  - `duration` string, google-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.
  - `resetPasswordFlags` string[] — For commands of type RESET_PASSWORD, optionally specifies flags.
  - `newPassword` string — For commands of type RESET_PASSWORD, optionally specifies the new password. Note: The new password must be at least 6 characters long if it is numeric in case of Android 14 devices. Else the command will fail with INVALID_VALUE.
  - `userName` string — The resource name of the user that owns the device in the form enterprises/{enterpriseId}/users/{userId}. This is automatically generated by the server based on the device the command is sent to.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/androidmanagement.md) · [All operations](https://skmtc.net/google/apis/androidmanagement/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/androidmanagement/versions/956638790236/schema)
