v1

latestOpenAPI 3.0.1Apache 2.02026-08-063494581.6 MB
esper_cloud_api_Commands V2

Create a command request

⚠️ Android only. This endpoint issues commands to Android-managed devices.

Alternative Available

A newer, multi-OS commands API is available and recommended for most use cases https://api.esper.io/openapi/command-request/createcommandrequest

Creates a command request targeting one or more devices or groups, dispatching a managed operation such as an install, reboot, lock, or configuration change. Accepts a V0CommandRequest body specifying the target scope (DEVICE, GROUP, or DYNAMIC), the command type, any required arguments, and an optional schedule. Returns the created command request including its id (request_id), which is used to poll for per-device execution status. Alternative endpoint- https://{foo}-api.esper.cloud/api/commands/v0/commands/

About Create Command Request

Esper's command system dispatches operations to enrolled Android devices asynchronously. A command request defines what to do (command), who to do it to (devices or groups), any parameters the command requires (command_args), and when to do it (schedule and schedule_args). The command_type field determines targeting scope: DEVICE targets up to 1,000 specific devices, GROUP targets up to 500 groups, and DYNAMIC targets a custom cross-group subset. After creation, use the request_id to query per-device execution status at the status endpoint.

Key Fields

command_type — targeting scope: DEVICE, GROUP, or DYNAMIC

devices — list of device UUIDs to target (up to 1,000); used with command_type: DEVICE

groups — list of group UUIDs to target (up to 500); used with command_type: GROUP

command — the operation to perform (e.g. INSTALL, REBOOT, LOCK; see V0DeviceCommandEnum for the full list)

command_args — command-specific parameters (e.g. app_version UUID for INSTALL, package_name for CLEAR_APP_DATA)

schedule — scheduling mode (immediate or deferred)

schedule_args — scheduling parameters when using deferred execution

See https://help.esper.io/hc/en-us/articles/29710806069393-Creating-API-Commands for command examples.

post/v0/enterprise/{enterprise_id}/command/

Path parameters

enterprise_idstring uuid required

ID of the enterprise

Response

command request successfully created

idstring uuid

Unique command request identifier

enterprisestring uuid

Esper account identifier

command_type'DEVICE' | 'GROUP' | 'DYNAMIC'

Identifies the type of command

* DEVICE: command request is meant for devices
* GROUP: command request is meant for groups
* DYNAMIC: command request is meant for dynamic set of devices
  i.e subset of devices from different groups or otherwise.
devicesstring[]

list of devices to run commands

groupsstring[]

list of groups to run commands

command'ADD_TO_WHITELIST' | 'ADD_WIFI_AP' | 'CLEAR_APP_DATA' | 'CLEAR_APP_CACHE' | 'INSTALL' | 'LOCK' | 'REBOOT' | 'REMOVE_FROM_WHITELIST' | 'REMOVE_WIFI_AP' | 'SET_APP_PERMISSION' | 'SET_APP_STATE' | 'SET_BLUETOOTH_STATE' | 'SET_BRIGHTNESS_SCALE' | 'SET_DEVICE_LOCKDOWN_STATE' | 'SET_GPS_STATE' | 'SET_KIOSK_APP' | 'SET_NEW_POLICY' | 'SET_ROTATION_STATE' | 'SET_SCREEN_OFF_TIMEOUT' | 'SET_STREAM_VOLUME' | 'SET_TIMEZONE' | 'SET_WIFI_STATE' | 'UNINSTALL' | 'UPDATE_DEVICE_CONFIG' | 'UPDATE_HEARTBEAT' | 'UPDATE_LATEST_DPC' | 'UPDATE_WIFI_AP' | 'WIPE' | 'RESET_LOCKSCREEN_PASSWORD' | 'UPDATE_BLUEPRINT' | 'CAPTURE_SCREENSHOT' | 'NOTIFY_DEVICE' | 'SET_DEVICE_LANGUAGE' | 'SET_ETHERNET_SETTINGS' | 'SET_STATIC_IP' | 'BEEP_DEVICE' | 'SET_APP_NOTIFICATIONS' | 'USE_ONLY_SAVED_WIFI_AP' | 'CONVERGE' | 'SYNC_CONTENT'

Following commands are supported

* ADD_TO_WHITELIST: Whitelist an installed sytem app. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper
* ADD_WIFI_AP : Add wifi access points for device. Requires `wifi_access_points` in command arguments where `wifi_access_points` is the data with access points
* CLEAR_APP_DATA : Clear data for an installed app. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper
* CLEAR_APP_CACHE : Clear the cache of an installed app without removing its data. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper. Supported on Android 6.0+ devices with the supervisor installed.
* INSTALL: Install an app on a device. Requires `app_version` in command arguments where `app_version` is the version id of app uploaded on Esper
* LOCK: Lock device screen
* REBOOT: Reboot a device
* REMOVE_FROM_WHITELIST : Remove an installed system app from whitelist. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper
* REMOVE_WIFI_AP : Remove Wifi access points for device. Requires `wifi_access_points` in command arguments where `wifi_access_points` is the data with access points
* UPDATE_WIFI_AP : Update Wi-Fi access point configuration on device. Requires `wifi_ssid` and `wifi_security_type` in command arguments. Device must be connected to the target SSID. Supports EAP (enterprise) and personal (WPA2/WPA/WEP) networks. On failure, attempts to restore the previous configuration. Android only.
* SET_APP_PERMISSION : Set permission for an installed app. Requires `package_name`, `grant_state`, `permission` in command arguments where `package_name` is the app package uploaded on Esper, `grant_state` should be "PERMISSION_GRANT_STATE_DEFAULT", "PERMISSION_GRANT_STATE_DENIED", "PERMISSION_GRANT_STATE_GRANTED" and `permission` is a valid permission
* SET_APP_STATE : Set the state of an app - SHOW/HIDE/DISABLE/LAUNCHABLE_BUT_HIDDEN. Requries `app_state` and `package_name` in command arguments where `app_state` is the state of app and `package_name` is the app package uploaded on Esper
* SET_BLUETOOTH_STATE : Set bluetooth state (ON/OFF) for device. Requires `bluetooth_state` in command arguments where `bluetooth_state` is a boolean.
* SET_BRIGHTNESS_SCALE : Set brightness for device. Requires `brightness_value` in command arguments where `brightness_value` is an integer (1-100).
* SET_DEVICE_LOCKDOWN_STATE : Set lockdown state for a device. Requires `state` and `message` in command arguments where `state` is LOCKED/UNLOCKED and `message` is the message to be added with command
* SET_GPS_STATE :Set the GPS state for a device. Requires `gps_state` in command arguments where `gps_state` should be either 0, 1, 2, 3 or 4 (LOCATION_MODE_HIGH_ACCURACY = 0, LOCATION_MODE_SENSORS_ONLY = 1, LOCATION_MODE_BATTERY_SAVING = 2, LOCATION_MODE_OFF = 3, LOCATION_MODE_ON = 4)
* SET_KIOSK_APP : Command to set the Kiosk app for a device. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper
* SET_NEW_POLICY : Apply policy on device. Requires `policy_url` in command arguments where `policy_url` is the URL to the policy
* SET_ROTATION_STATE : Set screen orientation. Requires `rotate_state` in command arguments where `rotate_state` should be either 0, 1 or 2 (0 = AUTO, 1 = PORTRAIT_ONLY, 2 = LANDSCAPE_ONLY)
* SET_SCREEN_OFF_TIMEOUT: Set screen off timeout for a device. Requires `screen_off_timeout` in command arguments where `screen_off_timeout` should be either -1 or between 5000 and 1800000
* SET_STREAM_VOLUME : Set stream volume for a device. Requires `stream` and `volume_level` in command arguments where `stream` should be either 0(Ring), 1(Notification), 2(Alarm) or 3(Music) and `volume_level` should be a value from 0 to 100
* SET_TIMEZONE : Set the timezone for a device. Requires `timezone_string` in command arguments where `timezone_string` is a valid string representing the timezone
* SET_WIFI_STATE : Set the wifi state (ON/OFF) for a device. Requires `wifi_state` in command arguments where `wifi_state` is a boolean.
* UNINSTALL: Uninstall an app from device. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper
* UPDATE_DEVICE_CONFIG: Push additional configurations to the Device
* UPDATE_HEARTBEAT: Ping a device
* UPDATE_LATEST_DPC : Prompt device to update the DPC app to the latest versions.
* WIPE : Wipes the device.
* RESET_LOCKSCREEN_PASSWORD: Change the lockscreen password of the device. Requires `new_lockscreen_password` in command arguments where `new_lockscreen_password` is a valid string.
* CAPTURE_SCREENSHOT: Allows you to take a screenshot of the device's current screen. The "tag" is an optional param that can be set to corresponding screenshot.
* UPDATE_BLUEPRINT: Pushes or reapplies the most current Blueprint version to the device or group.
* NOTIFY_DEVICE: Allows you to  broadcast message to the device. Requires 'title', 'message' and 'url' (optional) as string in command arguments. For scheduled message command requires 'name', 'time_type' as string and 'start_datetime' and 'end_datetime' as date-time.
* SET_DEVICE_LANGUAGE: Set language for a device. Requires locale value in xx[_Zzzz]_yy where xx is language code, Zzzz is script (optional) and yy is country code.
* SET_ETHERNET_SETTINGS: Set ethernet settings on supported Device
* SET_STATIC_IP: Set static ip on the deivce. Requires interface, dhcp_dnabled, static_ip, primary_dns, subnet_mask, gateway, secondary_dns (optional)
* BEEP_DEVICE: Allows you to make the device beep for a specified duration
* SET_APP_NOTIFICATIONS: Enable/disable app notifications. Requries `app_notifications_state` and `package_name` in command arguments where `app_notifications_state` is a string that has the value `ENABLED` or `DISABLED` and `package_name` is the app package uploaded on Esper.
* USE_ONLY_SAVED_WIFI_AP: Allow/disallow device to connect to unregistered WiFi APs. Requires boolean `use_only_saved_ap`.
* CONVERGE: Allows you to converge the device to the latest version of its assigned blueprint.
* SYNC_CONTENT: Allows you to sync content to the device. Requires `content_id` in command arguments where `content_id` is the id of the content to be synced. ```
schedule'IMMEDIATE' | 'WINDOW' | 'RECURRING'

Following Schedule types are supported

* IMMEDIATE: Schedule the command to execcute Immediately
* WINDOW: Schedule the command to execute within the given window
* RECURRING: Schedule the command to execute during the scheduled time until it succeeds or expires. After executing successfully, it will not fire again.
issued_bystring url

command is issued by this user

created_onstring date-time

Timestamp of command request