Agent Commands Api List

Agent Commands Api List
List the latest command state of an agent

Latest state per command type for the agent. Requires the ADMIN role.

Request
URI
GET
https://{api_host}/api/v1/agents/{agentPk}/commands
COPY
Path Parameters
integer
agentPk
Required  

Agent primary key

agentPk example
2

Authentication
This operation uses the following authentication methods.
Responses
200

200 OK successful response envelope. The latest state per command type

Returns AgentCommandStatusListResponse of type(s) application/json
{
    "items": [
        {
            "agentPk": 2,
            "type": "ActionConfigSync",
            "status": "TIMED_OUT",
            "commandId": 5,
            "requestedBy": "bob.example",
            "requestedAt": "2026-01-15T09:00:00Z",
            "sentAt": "2026-01-15T09:00:01Z",
            "completedAt": "2026-01-15T09:05:30Z",
            "resultMessage": "No result received from the agent before the timeout"
        },
        {
            "agentPk": 2,
            "type": "ActionSetHeartbeatInterval",
            "status": "SENT",
            "commandId": 7,
            "numericValue": 60,
            "requestedBy": "bob.example",
            "requestedAt": "2026-01-15T09:30:00Z",
            "sentAt": "2026-01-15T09:30:01Z"
        }
    ]
}
array of object
items
Required  

The latest command of each command type for the agent, ordered by command type; empty when no command was issued


400

400 Bad Request: INVALID_ARGUMENT when the agentPk path variable is not a number

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


403

403 Forbidden: FORBIDDEN

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


404

404 Not Found: AGENT_NOT_FOUND

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/api/v1/agents/{agentPk}/commands