Skip to content

Get stats of a command request
Stable

Request

Retrieves an aggregated count of devices in each status for a given command request.

Instead of listing every individual device status, this endpoint rolls the command's execution up into a count per state, for example how many devices are still queued versus how many succeeded or failed.

About Command Request Stats When a command request targets many devices or a group, tracking each device's status individually can be unwieldy. This endpoint returns the CommandRequestStats object, an array of state and total pairs, giving a quick read on how a command is progressing across its full target set without paging through every device status record.

Common Use Cases

Building a progress summary for a command that was issued to a large group

Quickly checking whether a command has finished executing across all targeted devices

Determining whether any devices have failed a command without listing them individually first

Best Practices

Use this endpoint for a high-level progress check, then fall back to GET /commands/v0/status/ with a request filter if you need the specific devices behind a given count

Poll this endpoint rather than the full status list when you only need aggregate numbers, to reduce response size

Workflow

Issue the command with POST /commands/v0/commands/ and capture the returned id

Poll this endpoint to track aggregate progress by state

If failures appear, filter GET /commands/v0/status/ by request and state to identify the specific devices

Security
commands_apiKey
Path
idstringrequired

ID of the command request object

cURL
curl -i -X GET \
  'https://api.esper.io/_mock/openapi/commands/v0/commands/{id}/stats/' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Aggregrated status information for a command request.

Bodyapplication/json
codeinteger
messagestring
contentobject(commands_CommandRequestStats)
Response
{ "code": 0, "message": "string", "content": { "id": "string", "status": [] } }