Skip to content
Start here

List account commands

zero_trust.dex.commands.list(CommandListParams**kwargs) -> SyncV4PagePagination[Optional[CommandListResponse]]
GET/accounts/{account_id}/dex/commands

Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloudflare DEX WriteCloudflare DEX ReadZero Trust ReportZero Trust Read
ParametersExpand Collapse
account_id: str
maxLength32
page: float

Page number for pagination

per_page: float

Number of results per page

command_type: Optional[str]

Optionally filter executed commands by command type

device_id: Optional[str]

Unique identifier for a device

from_: Optional[Union[str, datetime]]

Start time for the query in ISO (RFC3339 - ISO 8601) format

formatdate-time
status: Optional[Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"]]

Optionally filter executed commands by status

One of the following:
"PENDING_EXEC"
"PENDING_UPLOAD"
"SUCCESS"
"FAILED"
to: Optional[Union[str, datetime]]

End time for the query in ISO (RFC3339 - ISO 8601) format

formatdate-time
user_email: Optional[str]

Email tied to the device

ReturnsExpand Collapse
class CommandListResponse:
commands: Optional[List[Command]]
id: Optional[str]
completed_date: Optional[datetime]
formatdate-time
created_date: Optional[datetime]
formatdate-time
device_id: Optional[str]
filename: Optional[str]
registration_id: Optional[str]

Unique identifier for the device registration

status: Optional[str]
type: Optional[str]
user_email: Optional[str]

List account commands

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.zero_trust.dex.commands.list(
    account_id="01a7362d577a6c3019a474fd6f485823",
    page=1,
    per_page=50,
)
page = page.result.items[0]
print(page.commands)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "commands": [
      {
        "id": "id",
        "completed_date": "2019-12-27T18:11:19.117Z",
        "created_date": "2019-12-27T18:11:19.117Z",
        "device_id": "device_id",
        "filename": "filename",
        "registration_id": "registration_id",
        "status": "status",
        "type": "type",
        "user_email": "user_email"
      }
    ]
  },
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "commands": [
      {
        "id": "id",
        "completed_date": "2019-12-27T18:11:19.117Z",
        "created_date": "2019-12-27T18:11:19.117Z",
        "device_id": "device_id",
        "filename": "filename",
        "registration_id": "registration_id",
        "status": "status",
        "type": "type",
        "user_email": "user_email"
      }
    ]
  },
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}