Skip to content
Start here

Get details and aggregate metrics for an http test

GET/accounts/{account_id}/dex/http-tests/{test_id}

Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days.

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
Path ParametersExpand Collapse
account_id: optional string
maxLength32
test_id: string

API Resource UUID tag.

maxLength36
Query ParametersExpand Collapse
from: string

Start time for aggregate metrics in ISO ms

interval: "minute" or "hour"

Time interval for aggregate time slots.

One of the following:
"minute"
"hour"
to: string

End time for aggregate metrics in ISO ms

colo: optional string

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

deviceId: optional array of string

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

ReturnsExpand Collapse
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
success: true

Whether the API call was successful.

result: optional HTTPDetails { host, httpStats, httpStatsByColo, 6 more }
host: optional string

The url of the HTTP synthetic application test

httpStats: optional object { availabilityPct, dnsResponseTimeMs, httpStatusCode, 3 more }
availabilityPct: object { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
formatfloat
avg: optional number

average observed in the time period

formatfloat
max: optional number

highest observed in the time period

formatfloat
min: optional number

lowest observed in the time period

formatfloat
dnsResponseTimeMs: TestStatOverTime { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
avg: optional number

average observed in the time period

max: optional number

highest observed in the time period

min: optional number

lowest observed in the time period

httpStatusCode: array of object { status200, status300, status400, 2 more }
status200: number
status300: number
status400: number
status500: number
timestamp: string
resourceFetchTimeMs: TestStatOverTime { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
avg: optional number

average observed in the time period

max: optional number

highest observed in the time period

min: optional number

lowest observed in the time period

serverResponseTimeMs: TestStatOverTime { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
avg: optional number

average observed in the time period

max: optional number

highest observed in the time period

min: optional number

lowest observed in the time period

uniqueDevicesTotal: number

Count of unique devices that have run this test in the given time period

httpStatsByColo: optional array of object { availabilityPct, colo, dnsResponseTimeMs, 4 more }
availabilityPct: object { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
formatfloat
avg: optional number

average observed in the time period

formatfloat
max: optional number

highest observed in the time period

formatfloat
min: optional number

lowest observed in the time period

formatfloat
colo: string
dnsResponseTimeMs: TestStatOverTime { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
avg: optional number

average observed in the time period

max: optional number

highest observed in the time period

min: optional number

lowest observed in the time period

httpStatusCode: array of object { status200, status300, status400, 2 more }
status200: number
status300: number
status400: number
status500: number
timestamp: string
resourceFetchTimeMs: TestStatOverTime { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
avg: optional number

average observed in the time period

max: optional number

highest observed in the time period

min: optional number

lowest observed in the time period

serverResponseTimeMs: TestStatOverTime { slots, avg, max, min }
slots: array of object { timestamp, value }
timestamp: string
value: number
avg: optional number

average observed in the time period

max: optional number

highest observed in the time period

min: optional number

lowest observed in the time period

uniqueDevicesTotal: number

Count of unique devices that have run this test in the given time period

interval: optional string

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

kind: optional "http"
method: optional string

The HTTP method to use when running the test

name: optional string

The name of the HTTP synthetic application test

target_policies: optional array of DigitalExperienceMonitor { id, default, name }
id: string

API Resource UUID tag.

maxLength36
default: boolean

Whether the policy is the default for the account

name: string
targeted: optional boolean

Get details and aggregate metrics for an http test

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dex/http-tests/$TEST_ID \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "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": {
    "host": "http://example.com",
    "httpStats": {
      "availabilityPct": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "dnsResponseTimeMs": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "httpStatusCode": [
        {
          "status200": 0,
          "status300": 0,
          "status400": 0,
          "status500": 0,
          "timestamp": "2023-07-16 15:00:00+00"
        }
      ],
      "resourceFetchTimeMs": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "serverResponseTimeMs": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "uniqueDevicesTotal": 57
    },
    "httpStatsByColo": [
      {
        "availabilityPct": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "colo": "DFW",
        "dnsResponseTimeMs": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "httpStatusCode": [
          {
            "status200": 0,
            "status300": 0,
            "status400": 0,
            "status500": 0,
            "timestamp": "2023-07-16 15:00:00+00"
          }
        ],
        "resourceFetchTimeMs": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "serverResponseTimeMs": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "uniqueDevicesTotal": 57
      }
    ],
    "interval": "0h5m0s",
    "kind": "http",
    "method": "GET",
    "name": "Atlassian Sign In Page",
    "target_policies": [
      {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "default": true,
        "name": "name"
      }
    ],
    "targeted": true
  }
}
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": {
    "host": "http://example.com",
    "httpStats": {
      "availabilityPct": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "dnsResponseTimeMs": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "httpStatusCode": [
        {
          "status200": 0,
          "status300": 0,
          "status400": 0,
          "status500": 0,
          "timestamp": "2023-07-16 15:00:00+00"
        }
      ],
      "resourceFetchTimeMs": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "serverResponseTimeMs": {
        "slots": [
          {
            "timestamp": "2023-07-16 15:00:00+00",
            "value": 0
          }
        ],
        "avg": 0,
        "max": 0,
        "min": 0
      },
      "uniqueDevicesTotal": 57
    },
    "httpStatsByColo": [
      {
        "availabilityPct": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "colo": "DFW",
        "dnsResponseTimeMs": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "httpStatusCode": [
          {
            "status200": 0,
            "status300": 0,
            "status400": 0,
            "status500": 0,
            "timestamp": "2023-07-16 15:00:00+00"
          }
        ],
        "resourceFetchTimeMs": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "serverResponseTimeMs": {
          "slots": [
            {
              "timestamp": "2023-07-16 15:00:00+00",
              "value": 0
            }
          ],
          "avg": 0,
          "max": 0,
          "min": 0
        },
        "uniqueDevicesTotal": 57
      }
    ],
    "interval": "0h5m0s",
    "kind": "http",
    "method": "GET",
    "name": "Atlassian Sign In Page",
    "target_policies": [
      {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "default": true,
        "name": "name"
      }
    ],
    "targeted": true
  }
}