Use Cloudflare CLI (cf) cf zero-trust dex commands to manage DEX tests and rules, run remote captures and speed tests, and query fleet and test data from the command line. To get started, install cf and sign in with cf auth login, or set CLOUDFLARE_API_TOKEN to an API token with Cloudflare DEX Read permission (or Cloudflare DEX Write to make changes).
Create and manage synthetic tests that run from devices in your fleet. tests update replaces the whole test, so pass the test's current name, data, interval, and enabled values along with your changes. If you omit --target-policies, the test keeps its existing rules.
zero-trust dex tests create
Create a DEX test.
cf zero-trust dex tests create [options]--data-hoststringrequiredThe desired endpoint to test.
--data-kind"http" | "traceroute"requiredThe type of test.
--data-method"GET"The HTTP request method type.
--descriptionstringAdditional details about the test.
--enabledbooleanrequiredDetermines whether or not the test is active.
--intervalstringrequiredHow often the test will run.
--namestringrequiredThe name of the DEX test. Must be unique.
--target-policiesstringDEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"id": string, "default"?: boolean, "name"?: string}]. ? marks optional keys.
--targetedbooleanThe targeted field
--dry-runbooleandefault: falseValidate and show what would happen without executing
--bodystringRaw JSON request body (bypasses individual flags)
zero-trust dex tests delete
Delete a Device DEX test. Returns the remaining device dex tests for the account.
cf zero-trust dex tests delete <dex-test-id><DEX-TEST-ID>stringrequiredUnique identifier for a DEX test.
--dry-runbooleandefault: falseValidate and show what would happen without executing
--forcebooleandefault: falseSkip confirmation (useful in scripts and CI)
zero-trust dex tests get
Fetch a single DEX test.
cf zero-trust dex tests get <dex-test-id><DEX-TEST-ID>stringrequiredUnique identifier for a DEX test.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex tests list
Fetch all DEX tests.
cf zero-trust dex tests list [options]--pagenumberPage number of paginated results.
--per-pagenumberNumber of results per page.
--test-namestringFilter by test name.
--kind"http" | "traceroute"Filter by test type.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex tests network-path get
Get a breakdown of metrics by hop for individual traceroute test runs.
cf zero-trust dex tests network-path get <test-id> [options]<TEST-ID>stringrequiredUnique identifier for a specific test.
--device-idstringrequiredDevice to filter traceroute result runs to.
--fromstringrequiredStart time for aggregate metrics in ISO ms.
--tostringrequiredEnd time for aggregate metrics in ISO ms.
--interval"minute" | "hour"requiredTime interval for aggregate time slots.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex tests update
Update a DEX test.
cf zero-trust dex tests update <dex-test-id> [options]<DEX-TEST-ID>stringrequiredUnique identifier for a DEX test.
--data-hoststringrequiredThe desired endpoint to test.
--data-kind"http" | "traceroute"requiredThe type of test.
--data-method"GET"The HTTP request method type.
--descriptionstringAdditional details about the test.
--enabledbooleanrequiredDetermines whether or not the test is active.
--intervalstringrequiredHow often the test will run.
--namestringrequiredThe name of the DEX test. Must be unique.
--target-policiesstringDEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"id": string, "default"?: boolean, "name"?: string}]. ? marks optional keys.
--targetedbooleanThe targeted field
--dry-runbooleandefault: falseValidate and show what would happen without executing
--bodystringRaw JSON request body (bypasses individual flags)
Create and manage DEX rules that scope tests to groups of users and devices. rules get returns targeted_tests, the tests that use the rule.
zero-trust dex rules create
Create a DEX Rule.
cf zero-trust dex rules create [options]--descriptionstringThe description field
--matchstringrequiredThe wirefilter expression to match.
--namestringrequiredThe name of the Rule.
--dry-runbooleandefault: falseValidate and show what would happen without executing
--bodystringRaw JSON request body (bypasses individual flags)
zero-trust dex rules delete
Delete a DEX Rule.
cf zero-trust dex rules delete <rule-id><RULE-ID>stringrequiredUnique identifier of the rule.
--dry-runbooleandefault: falseValidate and show what would happen without executing
--forcebooleandefault: falseSkip confirmation (useful in scripts and CI)
zero-trust dex rules get
Get details for a DEX Rule.
cf zero-trust dex rules get <rule-id><RULE-ID>stringrequiredUnique identifier of the rule.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex rules list
List DEX Rules.
cf zero-trust dex rules list [options]--pagenumberrequiredPage number of paginated results.
--per-pagenumberrequiredNumber of results per page.
--sort-order"ASC" | "DESC"Sort direction for sort_by property.
--sort-by"name" | "created_at" | "updated_at"Which property to sort results by.
--namestringFilter results by rule name.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex rules update
Update a DEX Rule.
cf zero-trust dex rules update <rule-id> [options]<RULE-ID>stringrequiredUnique identifier of the rule.
--descriptionstringThe description field
--matchstringThe wirefilter expression to match.
--namestringThe name of the Rule.
--dry-runbooleandefault: falseValidate and show what would happen without executing
--bodystringRaw JSON request body (bypasses individual flags)
Run remote captures and speed tests on devices, and check their status and quota.
zero-trust dex commands create
Initiate commands for up to 10 devices per account.
cf zero-trust dex commands create [options]--commandsstringrequiredList of device-level commands to execute. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"device_id": string, "type": "pcap" | "speed-test" | "warp-diag", "user_email": string, "args"?: {...}, "registration_id"?: string}]. ? marks optional keys.
--dry-runbooleandefault: falseValidate and show what would happen without executing
--bodystringRaw JSON request body (bypasses individual flags)
zero-trust dex commands eligible-devices list
List devices with WARP client support for remote captures which have been connected in the last 1 hour.
cf zero-trust dex commands eligible-devices list [options]--pagenumberrequiredPage number of paginated results.
--per-pagenumberrequiredNumber of results per page.
--searchstringFilter devices by name or email.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex commands list
Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters
cf zero-trust dex commands list [options]--pagenumberrequiredPage number of paginated results.
--per-pagenumberrequiredNumber of results per page.
--fromstringStart time for the query in ISO (RFC3339 - ISO 8601) format.
--tostringEnd time for the query in ISO (RFC3339 - ISO 8601) format.
--device-idstringUnique identifier for a device.
--user-emailstringEmail tied to the device.
--command-type"pcap" | "speed-test" | "warp-diag"Optionally filter executed commands by command type.
--status"PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"Optionally filter executed commands by status.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex commands quota get
Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset
cf zero-trust dex commands quota get--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex commands results get
Downloads artifacts for an executed command. Bulk downloads are not supported
cf zero-trust dex commands results get <filename> [options]<FILENAME>stringrequiredThe name of the file to be downloaded, including the
.zipextension.--command-idstringrequiredUnique identifier for command.
--dry-runbooleandefault: falseValidate and show what would happen without executing
--textbooleandefault: falseDecode the response body as UTF-8 text instead of writing raw bytes
Get detailed results, percentiles, and network paths for individual tests.
zero-trust dex test-results http get
Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days.
cf zero-trust dex test-results http get <test-id> [options]<TEST-ID>stringrequiredUnique identifier for a specific test.
--device-idstringOptionally filter result stats to a specific device(s). Cannot be used in combination with colo param.
--fromstringrequiredStart time for aggregate metrics in ISO ms.
--tostringrequiredEnd time for aggregate metrics in ISO ms.
--interval"minute" | "hour"requiredTime interval for aggregate time slots.
--colostringOptionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex test-results http percentiles get
Get percentiles for an http test for a given time period between 1 hour and 7 days.
cf zero-trust dex test-results http percentiles get <test-id> [options]<TEST-ID>stringrequiredUnique identifier for a specific test.
--device-idstringOptionally filter result stats to a specific device(s). Cannot be used in combination with colo param.
--fromstringrequiredStart time for the query in ISO (RFC3339 - ISO 8601) format.
--tostringrequiredEnd time for the query in ISO (RFC3339 - ISO 8601) format.
--colostringOptionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex test-results traceroute get
Get test details and aggregate performance metrics for a traceroute test for a given time period between 1 hour and 7 days.
cf zero-trust dex test-results traceroute get <test-id> [options]<TEST-ID>stringrequiredUnique identifier for a specific test.
--device-idstringOptionally filter result stats to a specific device(s). Cannot be used in combination with colo param.
--fromstringrequiredStart time for aggregate metrics in ISO ms.
--tostringrequiredEnd time for aggregate metrics in ISO ms.
--interval"minute" | "hour"requiredTime interval for aggregate time slots.
--colostringOptionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex test-results traceroute network-path get
Get a breakdown of hops and performance metrics for a specific traceroute test run
cf zero-trust dex test-results traceroute network-path get <test-result-id><TEST-RESULT-ID>stringrequiredUnique identifier for a specific traceroute test.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex test-results traceroute percentiles get
Get percentiles for a traceroute test for a given time period between 1 hour and 7 days.
cf zero-trust dex test-results traceroute percentiles get <test-id> [options]<TEST-ID>stringrequiredUnique identifier for a specific test.
--device-idstringOptionally filter result stats to a specific device(s). Cannot be used in combination with colo param.
--fromstringrequiredStart time for the query in ISO (RFC3339 - ISO 8601) format.
--tostringrequiredEnd time for the query in ISO (RFC3339 - ISO 8601) format.
--colostringOptionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.
--dry-runbooleandefault: falseValidate and show what would happen without executing
Get availability and response time summaries across all tests.
zero-trust dex overview tests list
List DEX tests with overview metrics.
cf zero-trust dex overview tests list [options]--colostringOptionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.
--test-namestringOptionally filter results by test name.
--device-idstringOptionally filter result stats to a specific device(s). Cannot be used in combination with colo param.
--registration-idstringOptionally filter results to a specific device registration. Must be used in combination with a single deviceId.
--pagenumberPage number of paginated results
--per-pagenumberNumber of items per page
--kind"http" | "traceroute"Filter by test type.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex overview tests unique-devices get
Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days.
cf zero-trust dex overview tests unique-devices get [options]--test-namestringOptionally filter results by test name.
--device-idstringOptionally filter result stats to a specific device(s). Cannot be used in combination with colo param.
--dry-runbooleandefault: falseValidate and show what would happen without executing
Get fleet status and device monitoring data for your fleet or for individual devices.
zero-trust dex devices aggregates live get
Get details for live (up to 60 minutes) devices using WARP.
cf zero-trust dex devices aggregates live get [options]--since-minutesnumberrequiredNumber of minutes before current time.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex devices aggregates over-time get
Get aggregate details for devices using WARP, up to 7 days.
cf zero-trust dex devices aggregates over-time get [options]--tostringrequiredEnd of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.
--fromstringrequiredStart of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.
--colostringCloudflare colo airport code.
--device-idstringDevice-specific ID, given as UUID.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex devices get
Get the latest status of a device given device_id from the device_state table.
cf zero-trust dex devices get <device-id> [options]<DEVICE-ID>stringrequiredDevice-specific ID, given as UUID.
--since-minutesnumberrequiredNumber of minutes before current time.
--time-nowstringCurrent time in ISO format.
--colostringList of data centers to filter results.
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex devices list
List details of devices using WARP.
cf zero-trust dex devices list [options]--tostringrequiredEnd of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.
--fromstringrequiredStart of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.
--pagenumberrequiredPage number of paginated results.
--per-pagenumberrequiredNumber of results per page.
--sort-by"colo" | "device_id" | "mode" | "platform" | "status" | "timestamp" | "version"Dimension to sort results by.
--colostringCloudflare colo airport code.
--device-idstringDevice-specific ID, given as UUID.
--device-modestringThe mode under which the WARP client is run.
--statusstringNetwork status.
--platformstringOperating system.
--warp-versionstringWARP client version.
--source"last_seen" | "hourly" | "raw"Source:
hourly- device details aggregated hourly, up to 7 days priorlast_seen- device details, up to 60 minutes prior. Time windows exceeding 60 minutes will be rejected from June 1st, 2026. Please use 'hourly' or 'raw' instead for longer time ranges.raw- device details, up to 7 days prior
--dry-runbooleandefault: falseValidate and show what would happen without executing
zero-trust dex devices over-time get
Get time-bucketed status metrics for a specific device.
cf zero-trust dex devices over-time get <device-id> [options]<DEVICE-ID>stringrequiredDevice-specific ID, given as UUID.
--fromstringrequiredStart of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.
--tostringrequiredEnd of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.
--interval"minute" | "hour"requiredTime interval for aggregate time slots.
--colostringList of data centers to filter results.
--dry-runbooleandefault: falseValidate and show what would happen without executing
List the ISPs a device has connected through, for IP visibility.
zero-trust dex isps list
List ISP information observed for a specific device during traceroute tests.
cf zero-trust dex isps list [options]--device-idstringrequiredDevice-specific ID, given as UUID.
--pagenumberPage number of paginated results. Mutually exclusive with cursor.
--per-pagenumberrequiredNumber of items per page
--cursorstringCursor for cursor-based pagination. Mutually exclusive with page.
--sort-by"time_start"The field to sort results by.
--sort-order"ASC" | "DESC"The order to sort results.
--fromstringStart time for the query in ISO 8601 format.
--tostringEnd time for the query in ISO 8601 format.
--dry-runbooleandefault: falseValidate and show what would happen without executing
List Cloudflare One Client configuration changes and on/off toggle events by device.
zero-trust dex warp-change-events list
List WARP configuration and enablement toggle change events by device.
cf zero-trust dex warp-change-events list [options]--pagenumberrequiredPage number of paginated results.
--per-pagenumberrequiredNumber of results per page.
--fromstringrequiredStart time for the query in ISO (RFC3339 - ISO 8601) format.
--tostringrequiredEnd time for the query in ISO (RFC3339 - ISO 8601) format.
--type"config" | "toggle"Filter events by type 'config' or 'toggle'.
--toggle"on" | "off"Filter events by type toggle value. Applicable to type='toggle' events only.
--config-namestringFilter events by WARP configuration name changed from or to. Applicable to type='config' events only.
--account-namestringFilter events by account name.
--sort-order"ASC" | "DESC"Sort response by event timestamp.
--dry-runbooleandefault: falseValidate and show what would happen without executing
List Cloudflare data centers, sorted by how many of your devices connected to each during a time period. Data centers without traffic are listed after them alphabetically.
zero-trust dex colos list
List Cloudflare colos that account's devices were connected to during a time period, sorted by usage starting from the most used colo. Colos without traffic are also returned and sorted alphabetically.
cf zero-trust dex colos list [options]--fromstringrequiredStart time for connection period in ISO (RFC3339 - ISO 8601) format.
--tostringrequiredEnd time for connection period in ISO (RFC3339 - ISO 8601) format.
--sort-by"fleet-status-usage" | "application-tests-usage"Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically.
--dry-runbooleandefault: falseValidate and show what would happen without executing