Skip to content
Start here

List account commands

client.zeroTrust.dex.commands.list(CommandListParams { account_id, page, per_page, 6 more } params, RequestOptionsoptions?): V4PagePagination<CommandListResponse { commands } >
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
params: CommandListParams { account_id, page, per_page, 6 more }
account_id: string

Path param: Unique identifier linked to an account.

maxLength32
page: number

Query param: Page number of paginated results.

minimum1
per_page: number

Query param: Number of results per page.

maximum50
minimum1
command_type?: "pcap" | "speed-test" | "warp-diag"

Query param: Optionally filter executed commands by command type.

One of the following:
"pcap"
"speed-test"
"warp-diag"
device_id?: string

Query param: Unique identifier for a device.

from?: string

Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format.

formatdate-time
status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"

Query param: Optionally filter executed commands by status.

One of the following:
"PENDING_EXEC"
"PENDING_UPLOAD"
"SUCCESS"
"FAILED"
to?: string

Query param: End time for the query in ISO (RFC3339 - ISO 8601) format.

formatdate-time
user_email?: string

Query param: Email tied to the device.

ReturnsExpand Collapse
CommandListResponse { commands }
commands?: Array<Command>
id?: string
completed_date?: string | null
formatdate-time
created_date?: string
formatdate-time
device_id?: string
filename?: string | null
registration_id?: string

Unique identifier for the device registration

status?: string
type?: string
user_email?: string

List account commands

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const commandListResponse of client.zeroTrust.dex.commands.list({
  account_id: '01a7362d577a6c3019a474fd6f485823',
  page: 1,
  per_page: 10,
})) {
  console.log(commandListResponse.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
  }
}