v1

latestOpenAPI 3.0.1Apache 2.02026-08-063494581.6 MB
esper_cloud_api_Commands V2

get command history for device

⚠️ Android only. This endpoint applies exclusively to Android-managed devices enrolled in Esper.

Alternative Available

Use https://api.esper.io/openapi/command-status/getcommandinbox for a device's queued commands.

Returns the full command history for a specific device, filterable by execution state.

Returns a paginated list of V0CommandStatus records scoped to the specified device, each including the command name, arguments, issuing user, current state, reason, requeue count, and timestamps.

This provides richer detail than the per-request status endpoint, making it the preferred choice for device-level command audit and troubleshooting.

About Device Command History

While GET .../command/{request_id}/status/ surfaces status for a specific command request across its target devices, the command-history endpoint inverts the view — returning all commands ever issued to a single device, regardless of which request they originated from. Each record includes the full command name, the command_args used, the issued_by user object, a requeue_value tracking how many times the command was retried, and the reason for the current state. This makes it the authoritative source for per-device command forensics.

Key Query Parameters / Fields

state — optional filter; narrows results to a specific execution state (e.g. Command Failure, Command Success)

command — the name of the operation that was issued (e.g. INSTALL, REBOOT)

command_args — the arguments passed with the command

issued_by — object containing id and username of the user who issued the command

requeue_value — number of times the command was requeued for this device

reason — plain-language detail on why the command is in its current state

Common Use Cases

Review the full command history for a device during a support or compliance investigation.

Identify repeatedly failing commands and the arguments that were used. Audit which users issued which commands to a device over its lifecycle.

Best Practices

Filter by state=Command Failure or state=Command TimeOut to surface problem commands without reviewing the entire history.

Use requeue_value to identify commands that were retried the maximum number of times — these are likely permanent failures requiring manual intervention.

Pair this endpoint with the event feed (GET .../report/eventfeed/) for a complete device activity picture: command history shows operational commands; the event feed shows broader device state transitions.

Workflow

Obtain the device_id from a device list call or stored reference.

Call this endpoint, optionally filtering by state, to retrieve the command history.

Investigate failures using the command, command_args, reason, and requeue_value fields.

get/v0/enterprise/{enterprise_id}/device/{device_id}/command-history/

Path parameters

enterprise_idstring uuid required

Id of the enterprise

device_idstring uuid required

Id for the command request

Query parameters

statestring

Filter by command state

Response

on successful request

countinteger
nextstring url
previousstring url