Skip to content

List a device's commands

GET
/api/tenants/{tenant}/devices/{endpoint}/{device}/commands
curl --request GET \
--url http://127.0.0.1:9090/api/tenants/acme/devices/office/CG0001/commands \
--header 'Authorization: Basic <credentials>' \
--header 'X-Request-Id: 4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'

A device’s commands, the latest 500, in the order they were queued: the steps of its actions, each with its payload, status and result. Queue commands as actions (POST /api/tenants/{tenant}/devices/{endpoint}/{device}/actions). A device that is not known has no commands: the answer is an empty list.

tenant
required
string

The tenant’s id.

Example
acme
endpoint
required
string

The device’s endpoint.

Example
office
device
required
string

The device’s id.

Example
CG0001
X-Request-Id
string
<= 128 characters /^[A-Za-z0-9._:-]+$/

An id to follow the request by: answered back in X-Request-Id, and in the log, the audit trail and the events the request causes. 1 to 128 letters, digits, -, _, . or :; anything else is replaced by a new id.

Example
4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f

The device’s latest 500 commands, oldest first.

Media typeapplication/json
Array<object>

A command: one message the package builds for a device, queued, handed out and answered. Parameters the package marks sensitive are shown as <redacted N bytes>, and so is the payload that carries them.

object
action
required

The package command it is (its key among the package’s commands).

string
action_id

The action it is a step of, if it is one.

integer | null format: int64
completed_at

When it finished (answered, cancelled or skipped); null until then.

string | null format: date-time
created_at
required

When it was queued.

string format: date-time
expires_at

Not handed out by then, it never is.

string | null format: date-time
gate

A gate of its action: handed out on its own, and the steps after it wait for it to succeed.

boolean
id
required

The command’s id, unique across the gateway.

integer format: int64
lane
required

The lane it queues in.

string
Allowed values: urgent interactive sync bulk
params
required

Its parameters, by name, sensitive values redacted.

object
payload
required

What the device is handed, as text (“” when it is not text).

string
payload_base64

What the device is handed, base64-encoded, when it is not text.

string | null
result

What the device answered, as text; null until it answers.

string | null
result_base64

The result, base64-encoded, when the device returned something that is not text.

string | null
result_code

The code the device answered with, as the package reads it; null until it answers.

integer | null format: int64
retry_at

Parked until then: the device answered “not yet, ask again”.

string | null format: date-time
sent_at

When it was handed to the device; null until then.

string | null format: date-time
status
required

Where a command stands: queued (waiting to be handed to the device), offered (written into a reply to the device, no result yet), succeeded, failed, unanswered (offered, then lost: the device answered a command handed out after it, and it had been handed out twice; a result that comes later still completes it), cancelled (taken back before it was handed out: its action was cancelled or expired), skipped (an earlier step of its action failed before it was handed out) or parked (waiting behind a gate of its action that has not passed, or asked to be sent again later: retry_at).

string
Allowed values: queued offered succeeded failed unanswered cancelled skipped parked
tries

How many times it has been handed to the device (more than once when the device answered “not yet, ask again”).

integer format: int32
Example
[
{
"action": "open_door",
"action_id": 512,
"completed_at": "2026-01-15T08:00:04Z",
"created_at": "2026-01-15T08:00:00Z",
"id": 9001,
"lane": "interactive",
"params": {
"seconds": 5
},
"payload": "CONTROL DEVICE 01 05",
"result": "OK",
"result_code": 0,
"sent_at": "2026-01-15T08:00:02Z",
"status": "succeeded",
"tries": 1
}
]

A login is configured and the request carries neither it nor an API token, or it carries a wrong login (WWW-Authenticate: Basic realm="Hour Advantage", no body). Or the request carries an API token that is not one (revoked, or never made), login or not (WWW-Authenticate: Bearer realm="Hour Advantage", error="invalid_token", the body the API token was refused).

Media typetext/plain
string
Example
the API token was refused
WWW-Authenticate
string

The scheme to answer with: Basic realm="Hour Advantage", or for a refused token Bearer realm="Hour Advantage", error="invalid_token".

The Host header does not name a loopback address while one is required (no login configured, or the API listens on loopback), or the Origin header does not match the Host: {"error": ...} says which. Or no login is configured and the request carries Forwarded, X-Forwarded-For or X-Real-IP (a proxy forwarded it): the plain text body says so. Or an API token asks for a route its scope does not reach: the plain text body says so.

A refusal, and why.

object
error
required

Why the request was refused, in a sentence.

string
fields

For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.

Array<object>

What is wrong with one field of a request.

object
field
required

The parameter, as the request names it (values.volume for a setting inside values).

string
message
required

What is wrong with it.

string
request_id

The request’s id, as its X-Request-Id header gives it: what to quote when asking what happened to it.

string | null
Example
{
"error": "the Host must name this machine (localhost or a loopback address); an API reached by other names needs the admin login"
}

More than 2 admin logins are being checked at once: send the request again after the Retry-After seconds. A request carrying the login that checked out last, or an API token, is not held up.

Media typetext/plain
string
Example
too many logins at once; try again
Retry-After
integer

Seconds to wait: 1.

Something went wrong in the gateway that asking again will not put right by itself; error says what.

Media typeapplication/json

A refusal, and why.

object
error
required

Why the request was refused, in a sentence.

string
fields

For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.

Array<object>

What is wrong with one field of a request.

object
field
required

The parameter, as the request names it (values.volume for a setting inside values).

string
message
required

What is wrong with it.

string
request_id

The request’s id, as its X-Request-Id header gives it: what to quote when asking what happened to it.

string | null
Example
{
"error": "db error: ERROR: permission denied for table settings"
}

The database cannot be used right now (not reachable, too busy, no connection free in time), or the instance is still starting: send the same request again shortly. An API token that cannot be checked for the same reason is answered 503 in plain text (the API token cannot be checked right now; try again shortly).

Media typeapplication/json

A refusal, and why.

object
error
required

Why the request was refused, in a sentence.

string
fields

For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.

Array<object>

What is wrong with one field of a request.

object
field
required

The parameter, as the request names it (values.volume for a setting inside values).

string
message
required

What is wrong with it.

string
request_id

The request’s id, as its X-Request-Id header gives it: what to quote when asking what happened to it.

string | null
Example
{
"error": "the gateway is starting; try again shortly"
}