Skip to content
Start here

List DEX test analytics

client.zeroTrust.dex.tests.list(TestListParams { account_id, colo, deviceId, 4 more } params, RequestOptionsoptions?): V4PagePagination<Tests { overviewMetrics, tests } >
GET/accounts/{account_id}/dex/tests/overview

List DEX tests with overview metrics

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: TestListParams { account_id, colo, deviceId, 4 more }
account_id: string

Path param: unique identifier linked to an account in the API request path.

maxLength32
colo?: string

Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

deviceId?: Array<string>

Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

kind?: "http" | "traceroute"

Query param: Filter by test type

One of the following:
"http"
"traceroute"
page?: number

Query param: Page number of paginated results

minimum1
per_page?: number

Query param: Number of items per page

maximum50
minimum1
testName?: string

Query param: Optionally filter results by test name

ReturnsExpand Collapse
Tests { overviewMetrics, tests }
overviewMetrics: OverviewMetrics { testsTotal, avgHttpAvailabilityPct, avgTracerouteAvailabilityPct }
testsTotal: number

number of tests.

avgHttpAvailabilityPct?: number | null

percentage availability for all HTTP test results in response

formatfloat
avgTracerouteAvailabilityPct?: number | null

percentage availability for all traceroutes results in response

formatfloat
tests: Array<Test>

array of test results objects.

id: string

API Resource UUID tag.

maxLength36
created: string

date the test was created.

description: string

the test description defined during configuration

enabled: boolean

if true, then the test will run on targeted devices. Else, the test will not run.

host: string
interval: string

The interval at which the synthetic application test is set to run.

kind: "http" | "traceroute"

test type, http or traceroute

One of the following:
"http"
"traceroute"
name: string

name given to this test

updated: string
httpResults?: HTTPResults | null
resourceFetchTime: ResourceFetchTime { history, avgMs, overTime }
history: Array<History>
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
avgMs?: number | null
deltaPct?: number | null
formatfloat
avgMs?: number | null
overTime?: OverTime | null
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
values: Array<Value>
avgMs: number
timestamp: string
httpResultsByColo?: Array<HTTPResultsByColo>
colo: string

Cloudflare colo

resourceFetchTime: ResourceFetchTime { history, avgMs, overTime }
history: Array<History>
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
avgMs?: number | null
deltaPct?: number | null
formatfloat
avgMs?: number | null
overTime?: OverTime | null
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
values: Array<Value>
avgMs: number
timestamp: string
method?: string

for HTTP, the method to use when running the test

target_policies?: Array<DigitalExperienceMonitor { id, default, name } > | null
id: string

API Resource UUID tag.

maxLength36
default: boolean

Whether the policy is the default for the account

name: string
targeted?: boolean
tracerouteResults?: TracerouteResults | null
roundTripTime: RoundTripTime { history, avgMs, overTime }
history: Array<History>
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
avgMs?: number | null
deltaPct?: number | null
formatfloat
avgMs?: number | null
overTime?: OverTime | null
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
values: Array<Value>
avgMs: number
timestamp: string
tracerouteResultsByColo?: Array<TracerouteResultsByColo>
colo: string

Cloudflare colo

roundTripTime: RoundTripTime { history, avgMs, overTime }
history: Array<History>
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
avgMs?: number | null
deltaPct?: number | null
formatfloat
avgMs?: number | null
overTime?: OverTime | null
timePeriod: AggregateTimePeriod { units, value }
units: "hours" | "days" | "testRuns"
One of the following:
"hours"
"days"
"testRuns"
value: number
values: Array<Value>
avgMs: number
timestamp: string

List DEX test analytics

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 tests of client.zeroTrust.dex.tests.list({
  account_id: '01a7362d577a6c3019a474fd6f485823',
})) {
  console.log(tests.overviewMetrics);
}
{
  "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": {
    "overviewMetrics": {
      "testsTotal": 0,
      "avgHttpAvailabilityPct": 0,
      "avgTracerouteAvailabilityPct": 0
    },
    "tests": [
      {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "created": "created",
        "description": "description",
        "enabled": true,
        "host": "host",
        "interval": "interval",
        "kind": "http",
        "name": "name",
        "updated": "updated",
        "httpResults": {
          "resourceFetchTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "httpResultsByColo": [
          {
            "colo": "SJC",
            "resourceFetchTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ],
        "method": "method",
        "target_policies": [
          {
            "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
            "default": true,
            "name": "name"
          }
        ],
        "targeted": true,
        "tracerouteResults": {
          "roundTripTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "tracerouteResultsByColo": [
          {
            "colo": "SJC",
            "roundTripTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}
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": {
    "overviewMetrics": {
      "testsTotal": 0,
      "avgHttpAvailabilityPct": 0,
      "avgTracerouteAvailabilityPct": 0
    },
    "tests": [
      {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "created": "created",
        "description": "description",
        "enabled": true,
        "host": "host",
        "interval": "interval",
        "kind": "http",
        "name": "name",
        "updated": "updated",
        "httpResults": {
          "resourceFetchTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "httpResultsByColo": [
          {
            "colo": "SJC",
            "resourceFetchTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ],
        "method": "method",
        "target_policies": [
          {
            "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
            "default": true,
            "name": "name"
          }
        ],
        "targeted": true,
        "tracerouteResults": {
          "roundTripTime": {
            "history": [
              {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "avgMs": 0,
                "deltaPct": 0
              }
            ],
            "avgMs": 0,
            "overTime": {
              "timePeriod": {
                "units": "hours",
                "value": 0
              },
              "values": [
                {
                  "avgMs": 0,
                  "timestamp": "timestamp"
                }
              ]
            }
          }
        },
        "tracerouteResultsByColo": [
          {
            "colo": "SJC",
            "roundTripTime": {
              "history": [
                {
                  "timePeriod": {
                    "units": "hours",
                    "value": 0
                  },
                  "avgMs": 0,
                  "deltaPct": 0
                }
              ],
              "avgMs": 0,
              "overTime": {
                "timePeriod": {
                  "units": "hours",
                  "value": 0
                },
                "values": [
                  {
                    "avgMs": 0,
                    "timestamp": "timestamp"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}