# DEX ## Domain Types ### Digital Experience Monitor - `DigitalExperienceMonitor` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` ### Network Path - `NetworkPath` - `slots: Array` - `id: string` API Resource UUID tag. - `clientToAppRttMs: number | null` Round trip time in ms of the client to app mile - `clientToCfEgressRttMs: number | null` Round trip time in ms of the client to Cloudflare egress mile - `clientToCfIngressRttMs: number | null` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: string` - `clientToIspRttMs?: number | null` Round trip time in ms of the client to ISP mile - `sampling?: Sampling | null` Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval. - `unit: "hours"` - `"hours"` - `value: number` ### Network Path Response - `NetworkPathResponse` - `id: string` API Resource UUID tag. - `deviceName?: string` Name of the device that ran the test. - `interval?: string` The interval at which the Traceroute synthetic application test is set to run. - `kind?: "traceroute"` - `"traceroute"` - `name?: string` - `networkPath?: NetworkPath | null` - `slots: Array` - `id: string` API Resource UUID tag. - `clientToAppRttMs: number | null` Round trip time in ms of the client to app mile - `clientToCfEgressRttMs: number | null` Round trip time in ms of the client to Cloudflare egress mile - `clientToCfIngressRttMs: number | null` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: string` - `clientToIspRttMs?: number | null` Round trip time in ms of the client to ISP mile - `sampling?: Sampling | null` Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval. - `unit: "hours"` - `"hours"` - `value: number` - `url?: string` The host of the Traceroute synthetic application test. ### Percentiles - `Percentiles` - `p50?: number | null` p50 observed in the time period. - `p90?: number | null` p90 observed in the time period. - `p95?: number | null` p95 observed in the time period. - `p99?: number | null` p99 observed in the time period. # WARP Change Events ## List WARP change events. `client.zeroTrust.dex.warpChangeEvents.get(WARPChangeEventGetParamsparams, RequestOptionsoptions?): WARPChangeEventGetResponse` **get** `/accounts/{account_id}/dex/warp-change-events` List WARP configuration and enablement toggle change events by device. ### Parameters - `params: WARPChangeEventGetParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format. - `page: number` Query param: Page number of paginated results. - `per_page: number` Query param: Number of results per page. - `to: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format. - `account_name?: string` Query param: Filter events by account name. - `config_name?: string` Query param: Filter events by WARP configuration name changed from or to. Applicable to type='config' events only. - `sort_order?: "ASC" | "DESC"` Query param: Sort response by event timestamp. - `"ASC"` - `"DESC"` - `toggle?: "on" | "off"` Query param: Filter events by type toggle value. Applicable to type='toggle' events only. - `"on"` - `"off"` - `type?: "config" | "toggle"` Query param: Filter events by type 'config' or 'toggle'. - `"config"` - `"toggle"` ### Returns - `WARPChangeEventGetResponse = Array` - `DigitalExperienceMonitoringWARPToggleChangeEvent` - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `device_id?: string` The device ID. - `device_registration?: string` Deprecated: use registration_id. The device registration ID. - `hostname?: string` The hostname of the machine the event is from. - `registration_id?: string` The device registration ID. - `serial_number?: string` The serial number of the machine the event is from. - `timestamp?: string` The event time. - `toggle?: "on" | "off"` The state of the WARP toggle. - `"on"` - `"off"` - `user_email?: string` Email tied to the device. - `DigitalExperienceMonitoringWARPConfigChangeEvent` - `device_id?: string` The device ID. - `device_registration?: string` Deprecated: use registration_id. The device registration ID. - `from?: From` The details for the WARP configuration that was switched from. - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `config_name?: string` The name of the WARP configuration. - `hostname?: string` The hostname of the machine the event is from. - `registration_id?: string` The device registration ID. - `serial_number?: string` The serial number of the machine the event is from. - `timestamp?: string` The event time. - `to?: To` The details for the WARP configuration that was switched to. - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `config_name?: string` The name of the WARP configuration. - `user_email?: string` Email tied to the device. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const warpChangeEvents = await client.zeroTrust.dex.warpChangeEvents.get({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-09-20T17:00:00Z', page: 1, per_page: 10, to: '2023-09-20T17:00:00Z', }); console.log(warpChangeEvents); ``` #### Response ```json { "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": [ { "account_name": "account_name", "account_tag": "account_tag", "device_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "device_registration": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "hostname": "hostname", "registration_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "serial_number": "serial_number", "timestamp": "2023-10-11T00:00:00Z", "toggle": "on", "user_email": "user_email" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### WARP Change Event Get Response - `WARPChangeEventGetResponse = Array` - `DigitalExperienceMonitoringWARPToggleChangeEvent` - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `device_id?: string` The device ID. - `device_registration?: string` Deprecated: use registration_id. The device registration ID. - `hostname?: string` The hostname of the machine the event is from. - `registration_id?: string` The device registration ID. - `serial_number?: string` The serial number of the machine the event is from. - `timestamp?: string` The event time. - `toggle?: "on" | "off"` The state of the WARP toggle. - `"on"` - `"off"` - `user_email?: string` Email tied to the device. - `DigitalExperienceMonitoringWARPConfigChangeEvent` - `device_id?: string` The device ID. - `device_registration?: string` Deprecated: use registration_id. The device registration ID. - `from?: From` The details for the WARP configuration that was switched from. - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `config_name?: string` The name of the WARP configuration. - `hostname?: string` The hostname of the machine the event is from. - `registration_id?: string` The device registration ID. - `serial_number?: string` The serial number of the machine the event is from. - `timestamp?: string` The event time. - `to?: To` The details for the WARP configuration that was switched to. - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `config_name?: string` The name of the WARP configuration. - `user_email?: string` Email tied to the device. # Commands ## List account commands `client.zeroTrust.dex.commands.list(CommandListParamsparams, RequestOptionsoptions?): V4PagePagination` **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 ### Parameters - `params: CommandListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `page: number` Query param: Page number of paginated results. - `per_page: number` Query param: Number of results per page. - `command_type?: "pcap" | "speed-test" | "warp-diag"` Query param: Optionally filter executed commands by command type. - `"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. - `status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"` Query param: Optionally filter executed commands by status. - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `to?: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format. - `user_email?: string` Query param: Email tied to the device. ### Returns - `CommandListResponse` - `commands?: Array` - `id?: string` - `completed_date?: string | null` - `created_date?: string` - `device_id?: string` - `filename?: string | null` - `registration_id?: string` Unique identifier for the device registration - `status?: string` - `type?: string` - `user_email?: string` ### Example ```typescript 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); } ``` #### Response ```json { "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 } } ``` ## Create account commands `client.zeroTrust.dex.commands.create(CommandCreateParamsparams, RequestOptionsoptions?): CommandCreateResponse` **post** `/accounts/{account_id}/dex/commands` Initiate commands for up to 10 devices per account. ### Parameters - `params: CommandCreateParams` - `account_id: string` Path param: Unique identifier linked to an account. - `commands: Array` Body param: List of device-level commands to execute - `device_id: string` Unique identifier for the physical device - `type: "pcap" | "speed-test" | "warp-diag"` Type of command to execute on the device - `"pcap"` - `"speed-test"` - `"warp-diag"` - `user_email: string` Email tied to the device - `args?: WARPDiagArgs | PCAPArgs | SpeedTestArgs` Command arguments. Allowed fields depend on `type`. - `WARPDiagArgs` - `"test-all-routes"?: boolean` Test an IP address from all included or excluded ranges. Essentially the same as running 'route get ' and collecting the results. This option may increase the time taken to collect the warp-diag. - `PCAPArgs` - `"max-file-size-mb"?: number` Maximum file size (in MB) for the capture file. If the capture artifact exceeds the specified max file size, it will NOT be uploaded. - `"packet-size-bytes"?: number` Maximum number of bytes to save for each packet - `"time-limit-min"?: number` Limit on capture duration (in minutes) - `SpeedTestArgs` - `interfaces?: Array<"default" | "tunnel">` List of interfaces to run the speed test on - `"default"` - `"tunnel"` - `registration_id?: string` Unique identifier for the device registration. Required for multi-user devices to target the correct user session. ### Returns - `CommandCreateResponse` - `commands?: Array` List of created commands - `id?: string` Unique identifier for the command - `args?: Record` Command arguments - `device_id?: string` Identifier for the device associated with the command - `registration_id?: string` Unique identifier for the device registration - `status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"` Current status of the command - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `type?: string` Type of the command (e.g., "pcap", "speed-test", or "warp-diag") ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const command = await client.zeroTrust.dex.commands.create({ account_id: '01a7362d577a6c3019a474fd6f485823', commands: [ { device_id: 'device_id', type: 'pcap', user_email: 'user_email', }, ], }); console.log(command.commands); ``` #### Response ```json { "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", "args": { "foo": "string" }, "device_id": "device_id", "registration_id": "registration_id", "status": "PENDING_EXEC", "type": "type" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Command List Response - `CommandListResponse` - `commands?: Array` - `id?: string` - `completed_date?: string | null` - `created_date?: string` - `device_id?: string` - `filename?: string | null` - `registration_id?: string` Unique identifier for the device registration - `status?: string` - `type?: string` - `user_email?: string` ### Command Create Response - `CommandCreateResponse` - `commands?: Array` List of created commands - `id?: string` Unique identifier for the command - `args?: Record` Command arguments - `device_id?: string` Identifier for the device associated with the command - `registration_id?: string` Unique identifier for the device registration - `status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"` Current status of the command - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `type?: string` Type of the command (e.g., "pcap", "speed-test", or "warp-diag") # Devices ## List devices eligible for remote captures `client.zeroTrust.dex.commands.devices.list(DeviceListParamsparams, RequestOptionsoptions?): V4PagePagination` **get** `/accounts/{account_id}/dex/commands/devices` List devices with WARP client support for remote captures which have been connected in the last 1 hour. ### Parameters - `params: DeviceListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `page: number` Query param: Page number of paginated results. - `per_page: number` Query param: Number of results per page. - `search?: string` Query param: Filter devices by name or email. ### Returns - `DeviceListResponse` - `devices?: Array` List of eligible devices - `deviceId?: string` Device identifier (UUID v4) - `deviceName?: string` Device identifier (human readable) - `eligible?: boolean` Whether the device is eligible for remote captures - `ineligibleReason?: string` If the device is not eligible, the reason why. - `personEmail?: string` User contact email address - `platform?: string` Operating system. - `registrationId?: string` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `status?: string` Network status. - `timestamp?: string` - `version?: string` WARP client version. ### Example ```typescript 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 deviceListResponse of client.zeroTrust.dex.commands.devices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', page: 1, per_page: 10, })) { console.log(deviceListResponse.devices); } ``` #### Response ```json { "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": { "devices": [ { "deviceId": "deviceId", "deviceName": "deviceName", "eligible": true, "ineligibleReason": "ineligibleReason", "personEmail": "personEmail", "platform": "windows", "registrationId": "registrationId", "status": "connected", "timestamp": "2023-10-11 00:00:00+00", "version": "1.0.0" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Device List Response - `DeviceListResponse` - `devices?: Array` List of eligible devices - `deviceId?: string` Device identifier (UUID v4) - `deviceName?: string` Device identifier (human readable) - `eligible?: boolean` Whether the device is eligible for remote captures - `ineligibleReason?: string` If the device is not eligible, the reason why. - `personEmail?: string` User contact email address - `platform?: string` Operating system. - `registrationId?: string` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `status?: string` Network status. - `timestamp?: string` - `version?: string` WARP client version. # Downloads ## Download command output file `client.zeroTrust.dex.commands.downloads.get(stringfilename, DownloadGetParamsparams, RequestOptionsoptions?): Response` **get** `/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}` Downloads artifacts for an executed command. Bulk downloads are not supported ### Parameters - `filename: string` - `params: DownloadGetParams` - `account_id: string` Unique identifier linked to an account. - `command_id: string` Unique identifier for a command ### Returns - `unnamed_schema_10 = Response` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const download = await client.zeroTrust.dex.commands.downloads.get('filename', { account_id: '01a7362d577a6c3019a474fd6f485823', command_id: '5758fefe-ae7e-4538-a39b-1fef6abcb909', }); console.log(download); const content = await download.blob(); console.log(content); ``` # Quota ## Returns account commands usage, quota, and reset time `client.zeroTrust.dex.commands.quota.get(QuotaGetParamsparams, RequestOptionsoptions?): QuotaGetResponse` **get** `/accounts/{account_id}/dex/commands/quota` Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset ### Parameters - `params: QuotaGetParams` - `account_id: string` Unique identifier linked to an account. ### Returns - `QuotaGetResponse` - `quota: number` The total number of commands that can be initiated for an account. - `quota_usage: number` The number of commands that have been initiated for an account. - `reset_time: string` The time when the quota resets. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const quota = await client.zeroTrust.dex.commands.quota.get({ account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(quota.quota); ``` #### Response ```json { "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": { "quota": 0, "quota_usage": 0, "reset_time": "2019-12-27T18:11:19.117Z" }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Quota Get Response - `QuotaGetResponse` - `quota: number` The total number of commands that can be initiated for an account. - `quota_usage: number` The number of commands that have been initiated for an account. - `reset_time: string` The time when the quota resets. # Colos ## List Cloudflare colos `client.zeroTrust.dex.colos.list(ColoListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/dex/colos` 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. ### Parameters - `params: ColoListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start time for connection period in ISO (RFC3339 - ISO 8601) format. - `to: string` Query param: End time for connection period in ISO (RFC3339 - ISO 8601) format. - `sortBy?: "fleet-status-usage" | "application-tests-usage"` Query param: Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically. - `"fleet-status-usage"` - `"application-tests-usage"` ### Returns - `ColoListResponse` - `airportCode: string` Airport code - `city: string` City - `countryCode: string` Country code ### Example ```typescript 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 coloListResponse of client.zeroTrust.dex.colos.list({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-08-20T20:45:00Z', to: '2023-08-24T20:45:00Z', })) { console.log(coloListResponse.airportCode); } ``` #### Response ```json { "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": [ { "airportCode": "SFO", "city": "San Francisco", "countryCode": "US" } ] } ``` ## Domain Types ### Colo List Response - `ColoListResponse` - `airportCode: string` Airport code - `city: string` City - `countryCode: string` Country code # Fleet Status ## Get live aggregate device details by dimension `client.zeroTrust.dex.fleetStatus.live(FleetStatusLiveParamsparams, RequestOptionsoptions?): FleetStatusLiveResponse` **get** `/accounts/{account_id}/dex/fleet-status/live` Get details for live (up to 60 minutes) devices using WARP. ### Parameters - `params: FleetStatusLiveParams` - `account_id: string` Path param: Unique identifier linked to an account. - `since_minutes: number` Query param: Number of minutes before current time. ### Returns - `FleetStatusLiveResponse` - `deviceStats?: DeviceStats` - `byColo?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byMode?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byPlatform?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byVersion?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.dex.fleetStatus.live({ account_id: '01a7362d577a6c3019a474fd6f485823', since_minutes: 10, }); console.log(response.deviceStats); ``` #### Response ```json { "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": { "deviceStats": { "byColo": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byMode": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byPlatform": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byStatus": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byVersion": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "uniqueDevicesTotal": 0 } } } ``` ## Get over time aggregate details for devices by dimension `client.zeroTrust.dex.fleetStatus.overTime(FleetStatusOverTimeParamsparams, RequestOptionsoptions?): FleetStatusOverTimeResponse` **get** `/accounts/{account_id}/dex/fleet-status/over-time` Get aggregate details for devices using WARP, up to 7 days. ### Parameters - `params: FleetStatusOverTimeParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch. - `to: string` Query param: End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch. - `colo?: string` Query param: Cloudflare colo airport code. - `device_id?: string` Query param: Device-specific ID, given as UUID. ### Returns - `FleetStatusOverTimeResponse` - `deviceStats?: DeviceStats` - `byMode?: Array` - `timestamp?: string` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array` - `timestamp?: string` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.dex.fleetStatus.overTime({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-10-11 00:00:00+00', to: '2023-10-11 00:00:00+00', }); console.log(response.deviceStats); ``` #### Response ```json { "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": { "deviceStats": { "byMode": [ { "timestamp": "2023-10-11 00:00:00+00", "uniqueDevicesTotal": 0, "value": "value" } ], "byStatus": [ { "timestamp": "2023-10-11 00:00:00+00", "uniqueDevicesTotal": 0, "value": "value" } ], "uniqueDevicesTotal": 0 } } } ``` ## Domain Types ### Live Stat - `LiveStat` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` ### Fleet Status Live Response - `FleetStatusLiveResponse` - `deviceStats?: DeviceStats` - `byColo?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byMode?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byPlatform?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byVersion?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices ### Fleet Status Over Time Response - `FleetStatusOverTimeResponse` - `deviceStats?: DeviceStats` - `byMode?: Array` - `timestamp?: string` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array` - `timestamp?: string` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices # Devices ## List details of devices using WARP. `client.zeroTrust.dex.fleetStatus.devices.list(DeviceListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/dex/fleet-status/devices` List details of devices using WARP. ### Parameters - `params: DeviceListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch. - `page: number` Query param: Page number of paginated results. - `per_page: number` Query param: Number of results per page. - `to: string` Query param: End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch. - `colo?: string` Query param: Cloudflare colo airport code. - `device_id?: string` Query param: Device-specific ID, given as UUID. - `mode?: string` Query param: The mode under which the WARP client is run. - `platform?: string` Query param: Operating system. - `sort_by?: "colo" | "device_id" | "mode" | 4 more` Query param: Dimension to sort results by. - `"colo"` - `"device_id"` - `"mode"` - `"platform"` - `"status"` - `"timestamp"` - `"version"` - `source?: "last_seen" | "hourly" | "raw"` Query param: Source: * `hourly` - device details aggregated hourly, up to 7 days prior * `last_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 - `"last_seen"` - `"hourly"` - `"raw"` - `status?: string` Query param: Network status. - `version?: string` Query param: WARP client version. ### Returns - `DeviceListResponse` - `colo: string` Cloudflare colo airport code. - `deviceId: string` Device identifier (UUID v4) - `mode: string` The mode under which the WARP client is run. - `platform: string` Operating system. - `status: string` Network status. - `timestamp: string` - `version: string` WARP client version. - `alwaysOn?: boolean | null` - `batteryCharging?: boolean | null` - `batteryCycles?: number | null` - `batteryPct?: number | null` - `connectionType?: string | null` - `cpuPct?: number | null` - `cpuPctByApp?: Array | null` - `cpu_pct?: number | null` CPU usage percentage, on a scale of 0 to 100. - `name?: string | null` Application name. - `deviceIpv4?: DeviceIPV4 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `deviceIpv6?: DeviceIPV6 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `deviceName?: string` Device identifier (human readable). - `deviceRegistration?: string | null` Deprecated: use registrationId. Device registration identifier (UUID). - `diskReadBps?: number | null` - `diskUsagePct?: number | null` - `diskWriteBps?: number | null` - `dohSubdomain?: string | null` - `estimatedLossPct?: number | null` - `firewallEnabled?: boolean | null` - `gatewayIpv4?: GatewayIPV4 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `gatewayIpv6?: GatewayIPV6 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `handshakeLatencyMs?: number | null` - `ispIpv4?: ISPIPV4 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `ispIpv6?: ISPIPV6 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `metal?: string | null` - `networkRcvdBps?: number | null` - `networkSentBps?: number | null` - `networkSsid?: string | null` - `personEmail?: string` User contact email address - `ramAvailableKb?: number | null` - `ramUsedPct?: number | null` - `ramUsedPctByApp?: Array | null` - `name?: string | null` Application name. - `ram_used_pct?: number | null` RAM usage percentage, on a scale of 0 to 100. - `registrationId?: string | null` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `rtt?: RTT | null` Round-trip time statistics for the WARP tunnel. - `minRttUs?: MinRTTUs | null` Minimum round-trip time in microseconds. - `downstream?: number | null` - `upstream?: number | null` - `rttUs?: RTTUs | null` Round-trip time in microseconds. - `downstream?: number | null` - `upstream?: number | null` - `rttVarUs?: RTTVarUs | null` Round-trip time variance in microseconds. - `downstream?: number | null` - `upstream?: number | null` - `switchLocked?: boolean | null` - `tunnelStats?: TunnelStats | null` WARP tunnel packet and byte counters. - `bytesLost?: BytesLost | null` Number of bytes lost, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `bytesReceived?: BytesReceived | null` Number of bytes received, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `bytesRetransmitted?: BytesRetransmitted | null` Number of bytes retransmitted, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `bytesSent?: BytesSent | null` Number of bytes sent, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsLost?: PacketsLost | null` Number of packets lost, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsReceived?: PacketsReceived | null` Number of packets received, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsRetransmitted?: PacketsRetransmitted | null` Number of packets retransmitted, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsSent?: PacketsSent | null` Number of packets sent, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `statsWindowMs?: number | null` The measurement window duration in milliseconds. - `tunnelType?: string | null` - `wifiStrengthDbm?: number | null` ### Example ```typescript 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 deviceListResponse of client.zeroTrust.dex.fleetStatus.devices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-10-11 00:00:00+00', page: 1, per_page: 10, to: '2023-10-11 00:00:00+00', })) { console.log(deviceListResponse.networkSsid); } ``` #### Response ```json { "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": [ { "colo": "SJC", "deviceId": "deviceId", "mode": "proxy", "platform": "windows", "status": "connected", "timestamp": "2023-10-11 00:00:00+00", "version": "1.0.0", "alwaysOn": true, "batteryCharging": true, "batteryCycles": 0, "batteryPct": 0, "connectionType": "connectionType", "cpuPct": 0, "cpuPctByApp": [ { "cpu_pct": 0, "name": "name" } ], "deviceIpv4": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "name": "name", "netmask": "netmask", "version": 1 }, "deviceIpv6": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "name": "name", "netmask": "netmask", "version": 1 }, "deviceName": "deviceName", "deviceRegistration": "deviceRegistration", "diskReadBps": 0, "diskUsagePct": 0, "diskWriteBps": 0, "dohSubdomain": "dohSubdomain", "estimatedLossPct": 0, "firewallEnabled": true, "gatewayIpv4": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "name": "name", "netmask": "netmask", "version": 1 }, "gatewayIpv6": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "name": "name", "netmask": "netmask", "version": 1 }, "handshakeLatencyMs": 0, "ispIpv4": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "name": "name", "netmask": "netmask", "version": 1 }, "ispIpv6": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "name": "name", "netmask": "netmask", "version": 1 }, "metal": "metal", "networkRcvdBps": 0, "networkSentBps": 0, "networkSsid": "networkSsid", "personEmail": "personEmail", "ramAvailableKb": 0, "ramUsedPct": 0, "ramUsedPctByApp": [ { "name": "name", "ram_used_pct": 0 } ], "registrationId": "registrationId", "rtt": { "minRttUs": { "downstream": 0, "upstream": 0 }, "rttUs": { "downstream": 0, "upstream": 0 }, "rttVarUs": { "downstream": 0, "upstream": 0 } }, "switchLocked": true, "tunnelStats": { "bytesLost": { "downstream": 0, "upstream": 0 }, "bytesReceived": { "downstream": 0, "upstream": 0 }, "bytesRetransmitted": { "downstream": 0, "upstream": 0 }, "bytesSent": { "downstream": 0, "upstream": 0 }, "packetsLost": { "downstream": 0, "upstream": 0 }, "packetsReceived": { "downstream": 0, "upstream": 0 }, "packetsRetransmitted": { "downstream": 0, "upstream": 0 }, "packetsSent": { "downstream": 0, "upstream": 0 }, "statsWindowMs": 0 }, "tunnelType": "tunnelType", "wifiStrengthDbm": 0 } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Device List Response - `DeviceListResponse` - `colo: string` Cloudflare colo airport code. - `deviceId: string` Device identifier (UUID v4) - `mode: string` The mode under which the WARP client is run. - `platform: string` Operating system. - `status: string` Network status. - `timestamp: string` - `version: string` WARP client version. - `alwaysOn?: boolean | null` - `batteryCharging?: boolean | null` - `batteryCycles?: number | null` - `batteryPct?: number | null` - `connectionType?: string | null` - `cpuPct?: number | null` - `cpuPctByApp?: Array | null` - `cpu_pct?: number | null` CPU usage percentage, on a scale of 0 to 100. - `name?: string | null` Application name. - `deviceIpv4?: DeviceIPV4 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `deviceIpv6?: DeviceIPV6 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `deviceName?: string` Device identifier (human readable). - `deviceRegistration?: string | null` Deprecated: use registrationId. Device registration identifier (UUID). - `diskReadBps?: number | null` - `diskUsagePct?: number | null` - `diskWriteBps?: number | null` - `dohSubdomain?: string | null` - `estimatedLossPct?: number | null` - `firewallEnabled?: boolean | null` - `gatewayIpv4?: GatewayIPV4 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `gatewayIpv6?: GatewayIPV6 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `handshakeLatencyMs?: number | null` - `ispIpv4?: ISPIPV4 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `ispIpv6?: ISPIPV6 | null` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `name?: string | null` - `netmask?: string | null` - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). - `metal?: string | null` - `networkRcvdBps?: number | null` - `networkSentBps?: number | null` - `networkSsid?: string | null` - `personEmail?: string` User contact email address - `ramAvailableKb?: number | null` - `ramUsedPct?: number | null` - `ramUsedPctByApp?: Array | null` - `name?: string | null` Application name. - `ram_used_pct?: number | null` RAM usage percentage, on a scale of 0 to 100. - `registrationId?: string | null` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `rtt?: RTT | null` Round-trip time statistics for the WARP tunnel. - `minRttUs?: MinRTTUs | null` Minimum round-trip time in microseconds. - `downstream?: number | null` - `upstream?: number | null` - `rttUs?: RTTUs | null` Round-trip time in microseconds. - `downstream?: number | null` - `upstream?: number | null` - `rttVarUs?: RTTVarUs | null` Round-trip time variance in microseconds. - `downstream?: number | null` - `upstream?: number | null` - `switchLocked?: boolean | null` - `tunnelStats?: TunnelStats | null` WARP tunnel packet and byte counters. - `bytesLost?: BytesLost | null` Number of bytes lost, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `bytesReceived?: BytesReceived | null` Number of bytes received, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `bytesRetransmitted?: BytesRetransmitted | null` Number of bytes retransmitted, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `bytesSent?: BytesSent | null` Number of bytes sent, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsLost?: PacketsLost | null` Number of packets lost, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsReceived?: PacketsReceived | null` Number of packets received, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsRetransmitted?: PacketsRetransmitted | null` Number of packets retransmitted, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `packetsSent?: PacketsSent | null` Number of packets sent, split by direction. - `downstream?: number | null` - `upstream?: number | null` - `statsWindowMs?: number | null` The measurement window duration in milliseconds. - `tunnelType?: string | null` - `wifiStrengthDbm?: number | null` # HTTP Tests ## Get details and aggregate metrics for an http test `client.zeroTrust.dex.httpTests.get(stringtestID, HTTPTestGetParamsparams, RequestOptionsoptions?): HTTPDetails` **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. ### Parameters - `testID: string` API Resource UUID tag. - `params: HTTPTestGetParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start time for aggregate metrics in ISO ms. - `interval: "minute" | "hour"` Query param: Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: string` Query param: End time for aggregate metrics in ISO ms. - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `HTTPDetails` - `host?: string` The url of the HTTP synthetic application test. - `httpStats?: HTTPStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `dnsResponseTimeMs: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. - `httpStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `colo: string` - `dnsResponseTimeMs: TestStatOverTime` - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. - `interval?: string` The interval at which the HTTP synthetic application test is set to run. - `kind?: "http"` - `"http"` - `method?: string` The HTTP method to use when running the test. - `name?: string` The name of the HTTP synthetic application test. - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` - `targeted?: boolean` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const httpDetails = await client.zeroTrust.dex.httpTests.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '1689520412000', interval: 'minute', to: '1689606812000', }, ); console.log(httpDetails.host); ``` #### Response ```json { "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 } } ``` ## Domain Types ### HTTP Details - `HTTPDetails` - `host?: string` The url of the HTTP synthetic application test. - `httpStats?: HTTPStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `dnsResponseTimeMs: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. - `httpStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `colo: string` - `dnsResponseTimeMs: TestStatOverTime` - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. - `interval?: string` The interval at which the HTTP synthetic application test is set to run. - `kind?: "http"` - `"http"` - `method?: string` The HTTP method to use when running the test. - `name?: string` The name of the HTTP synthetic application test. - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` - `targeted?: boolean` # Percentiles ## Get percentiles for an http test `client.zeroTrust.dex.httpTests.percentiles.get(stringtestID, PercentileGetParamsparams, RequestOptionsoptions?): HTTPDetailsPercentiles` **get** `/accounts/{account_id}/dex/http-tests/{test_id}/percentiles` Get percentiles for an http test for a given time period between 1 hour and 7 days. ### Parameters - `testID: string` API Resource UUID tag. - `params: PercentileGetParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format. - `to: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format. - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `HTTPDetailsPercentiles` - `dnsResponseTimeMs?: Percentiles` - `p50?: number | null` p50 observed in the time period. - `p90?: number | null` p90 observed in the time period. - `p95?: number | null` p95 observed in the time period. - `p99?: number | null` p99 observed in the time period. - `resourceFetchTimeMs?: Percentiles` - `serverResponseTimeMs?: Percentiles` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const httpDetailsPercentiles = await client.zeroTrust.dex.httpTests.percentiles.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-09-20T17:00:00Z', to: '2023-09-20T17:00:00Z', }, ); console.log(httpDetailsPercentiles.dnsResponseTimeMs); ``` #### Response ```json { "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": { "dnsResponseTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "resourceFetchTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "serverResponseTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 } } } ``` ## Domain Types ### HTTP Details Percentiles - `HTTPDetailsPercentiles` - `dnsResponseTimeMs?: Percentiles` - `p50?: number | null` p50 observed in the time period. - `p90?: number | null` p90 observed in the time period. - `p95?: number | null` p95 observed in the time period. - `p99?: number | null` p99 observed in the time period. - `resourceFetchTimeMs?: Percentiles` - `serverResponseTimeMs?: Percentiles` ### Test Stat Over Time - `TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. # Tests ## List DEX test analytics `client.zeroTrust.dex.tests.list(TestListParamsparams, RequestOptionsoptions?): V4PagePagination` **get** `/accounts/{account_id}/dex/tests/overview` List DEX tests with overview metrics. ### Parameters - `params: TestListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` 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. - `"http"` - `"traceroute"` - `page?: number` Query param: Page number of paginated results - `per_page?: number` Query param: Number of items per page - `registration_id?: string` Query param: Optionally filter results to a specific device registration. Must be used in combination with a single deviceId. - `testName?: string` Query param: Optionally filter results by test name. ### Returns - `Tests` - `overviewMetrics: OverviewMetrics` - `testsTotal: number` number of tests. - `avgHttpAvailabilityPct?: number | null` percentage availability for all HTTP test results in response. - `avgTracerouteAvailabilityPct?: number | null` percentage availability for all traceroutes results in response. - `tests: Array` array of test results objects. - `id: string` API Resource UUID tag. - `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 - `"http"` - `"traceroute"` - `name: string` name given to this test - `updated: string` - `httpResults?: HTTPResults | null` - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `units: "hours" | "days" | "testRuns"` - `"hours"` - `"days"` - `"testRuns"` - `value: number` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `httpResultsByColo?: Array` - `colo: string` Cloudflare colo - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `method?: string` for HTTP, the method to use when running the test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` - `targeted?: boolean` - `tracerouteResults?: TracerouteResults | null` - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `tracerouteResultsByColo?: Array` - `colo: string` Cloudflare colo - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` ### Example ```typescript 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); } ``` #### Response ```json { "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" } ] } } } ] } ] } } ``` ## Domain Types ### Aggregate Time Period - `AggregateTimePeriod` - `units: "hours" | "days" | "testRuns"` - `"hours"` - `"days"` - `"testRuns"` - `value: number` ### Tests - `Tests` - `overviewMetrics: OverviewMetrics` - `testsTotal: number` number of tests. - `avgHttpAvailabilityPct?: number | null` percentage availability for all HTTP test results in response. - `avgTracerouteAvailabilityPct?: number | null` percentage availability for all traceroutes results in response. - `tests: Array` array of test results objects. - `id: string` API Resource UUID tag. - `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 - `"http"` - `"traceroute"` - `name: string` name given to this test - `updated: string` - `httpResults?: HTTPResults | null` - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `units: "hours" | "days" | "testRuns"` - `"hours"` - `"days"` - `"testRuns"` - `value: number` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `httpResultsByColo?: Array` - `colo: string` Cloudflare colo - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `method?: string` for HTTP, the method to use when running the test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` - `targeted?: boolean` - `tracerouteResults?: TracerouteResults | null` - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `tracerouteResultsByColo?: Array` - `colo: string` Cloudflare colo - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` # Unique Devices ## Get count of devices targeted `client.zeroTrust.dex.tests.uniqueDevices.list(UniqueDeviceListParamsparams, RequestOptionsoptions?): UniqueDevices` **get** `/accounts/{account_id}/dex/tests/unique-devices` Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days. ### Parameters - `params: UniqueDeviceListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `testName?: string` Query param: Optionally filter results by test name. ### Returns - `UniqueDevices` - `uniqueDevicesTotal: number` total number of unique devices ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const uniqueDevices = await client.zeroTrust.dex.tests.uniqueDevices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(uniqueDevices.uniqueDevicesTotal); ``` #### Response ```json { "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": { "uniqueDevicesTotal": 0 } } ``` ## Domain Types ### Unique Devices - `UniqueDevices` - `uniqueDevicesTotal: number` total number of unique devices # Traceroute Test Results # Network Path ## Get details for a specific traceroute test run `client.zeroTrust.dex.tracerouteTestResults.networkPath.get(stringtestResultID, NetworkPathGetParamsparams, RequestOptionsoptions?): NetworkPathGetResponse` **get** `/accounts/{account_id}/dex/traceroute-test-results/{test_result_id}/network-path` Get a breakdown of hops and performance metrics for a specific traceroute test run ### Parameters - `testResultID: string` API Resource UUID tag. - `params: NetworkPathGetParams` - `account_id: string` Unique identifier linked to an account. ### Returns - `NetworkPathGetResponse` - `hops: Array` An array of the hops taken by the device to reach the end destination. - `ttl: number` - `asn?: number | null` - `aso?: string | null` - `ipAddress?: string | null` - `location?: Location | null` - `city?: string | null` - `state?: string | null` - `zip?: string | null` - `mile?: "client-to-app" | "client-to-cf-egress" | "client-to-cf-ingress" | "client-to-isp" | null` - `"client-to-app"` - `"client-to-cf-egress"` - `"client-to-cf-ingress"` - `"client-to-isp"` - `name?: string | null` - `packetLossPct?: number | null` - `rttMs?: number | null` - `resultId: string` API Resource UUID tag. - `colo?: string` Cloudflare colo airport code. - `deviceName?: string` Name of the device associated with this network path response. - `execution_context?: "EXECUTION_CONTEXT_INVALID" | "OUT_OF_TUNNEL" | "IN_TUNNEL"` Whether the test was run inside or outside of the WARP tunnel. - `"EXECUTION_CONTEXT_INVALID"` - `"OUT_OF_TUNNEL"` - `"IN_TUNNEL"` - `testId?: string` API Resource UUID tag. - `testName?: string` Name of the traceroute test. - `time_start?: string` Timestamp indicating when the traceroute test execution began. - `tunnel_type?: string | null` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const networkPath = await client.zeroTrust.dex.tracerouteTestResults.networkPath.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823' }, ); console.log(networkPath.hops); ``` #### Response ```json { "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": { "hops": [ { "ttl": 0, "asn": 0, "aso": "aso", "ipAddress": "ipAddress", "location": { "city": "city", "state": "state", "zip": "zip" }, "mile": "client-to-app", "name": "name", "packetLossPct": 0, "rttMs": 0 } ], "resultId": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "colo": "SJC", "deviceName": "deviceName", "execution_context": "EXECUTION_CONTEXT_INVALID", "testId": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "testName": "testName", "time_start": "2023-07-16 15:00:00+00", "tunnel_type": "tunnel_type" } } ``` ## Domain Types ### Network Path Get Response - `NetworkPathGetResponse` - `hops: Array` An array of the hops taken by the device to reach the end destination. - `ttl: number` - `asn?: number | null` - `aso?: string | null` - `ipAddress?: string | null` - `location?: Location | null` - `city?: string | null` - `state?: string | null` - `zip?: string | null` - `mile?: "client-to-app" | "client-to-cf-egress" | "client-to-cf-ingress" | "client-to-isp" | null` - `"client-to-app"` - `"client-to-cf-egress"` - `"client-to-cf-ingress"` - `"client-to-isp"` - `name?: string | null` - `packetLossPct?: number | null` - `rttMs?: number | null` - `resultId: string` API Resource UUID tag. - `colo?: string` Cloudflare colo airport code. - `deviceName?: string` Name of the device associated with this network path response. - `execution_context?: "EXECUTION_CONTEXT_INVALID" | "OUT_OF_TUNNEL" | "IN_TUNNEL"` Whether the test was run inside or outside of the WARP tunnel. - `"EXECUTION_CONTEXT_INVALID"` - `"OUT_OF_TUNNEL"` - `"IN_TUNNEL"` - `testId?: string` API Resource UUID tag. - `testName?: string` Name of the traceroute test. - `time_start?: string` Timestamp indicating when the traceroute test execution began. - `tunnel_type?: string | null` # Traceroute Tests ## Get details and aggregate metrics for a traceroute test `client.zeroTrust.dex.tracerouteTests.get(stringtestID, TracerouteTestGetParamsparams, RequestOptionsoptions?): Traceroute` **get** `/accounts/{account_id}/dex/traceroute-tests/{test_id}` Get test details and aggregate performance metrics for a traceroute test for a given time period between 1 hour and 7 days. ### Parameters - `testID: string` API Resource UUID tag. - `params: TracerouteTestGetParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start time for aggregate metrics in ISO ms. - `interval: "minute" | "hour"` Query param: Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: string` Query param: End time for aggregate metrics in ISO ms. - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `Traceroute` - `host: string` The host of the Traceroute synthetic application test. - `interval: string` The interval at which the Traceroute synthetic application test is set to run. - `kind: "traceroute"` - `"traceroute"` - `name: string` The name of the Traceroute synthetic application test. - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` - `targeted?: boolean` - `tracerouteStats?: TracerouteStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `hopsCount: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. - `tracerouteStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `colo: string` - `hopsCount: TestStatOverTime` - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const traceroute = await client.zeroTrust.dex.tracerouteTests.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '1689520412000', interval: 'minute', to: '1689606812000', }, ); console.log(traceroute.host); ``` #### Response ```json { "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": "1.1.1.1", "interval": "0h5m0s", "kind": "traceroute", "name": "Atlassian Sign In Page", "target_policies": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "default": true, "name": "name" } ], "targeted": true, "tracerouteStats": { "availabilityPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "hopsCount": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "packetLossPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "roundTripTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "uniqueDevicesTotal": 57 }, "tracerouteStatsByColo": [ { "availabilityPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "colo": "DFW", "hopsCount": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "packetLossPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "roundTripTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "uniqueDevicesTotal": 57 } ] } } ``` ## Get percentiles for a traceroute test `client.zeroTrust.dex.tracerouteTests.percentiles(stringtestID, TracerouteTestPercentilesParamsparams, RequestOptionsoptions?): TracerouteTestPercentilesResponse` **get** `/accounts/{account_id}/dex/traceroute-tests/{test_id}/percentiles` Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. ### Parameters - `testID: string` API Resource UUID tag. - `params: TracerouteTestPercentilesParams` - `account_id: string` Path param: Unique identifier linked to an account. - `from: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format. - `to: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format. - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `TracerouteTestPercentilesResponse` - `hopsCount?: Percentiles` - `p50?: number | null` p50 observed in the time period. - `p90?: number | null` p90 observed in the time period. - `p95?: number | null` p95 observed in the time period. - `p99?: number | null` p99 observed in the time period. - `packetLossPct?: Percentiles` - `roundTripTimeMs?: Percentiles` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.dex.tracerouteTests.percentiles( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-09-20T17:00:00Z', to: '2023-09-20T17:00:00Z', }, ); console.log(response.hopsCount); ``` #### Response ```json { "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": { "hopsCount": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "packetLossPct": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "roundTripTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 } } } ``` ## Get network path breakdown for a traceroute test `client.zeroTrust.dex.tracerouteTests.networkPath(stringtestID, TracerouteTestNetworkPathParamsparams, RequestOptionsoptions?): NetworkPathResponse` **get** `/accounts/{account_id}/dex/traceroute-tests/{test_id}/network-path` Get a breakdown of metrics by hop for individual traceroute test runs. ### Parameters - `testID: string` API Resource UUID tag. - `params: TracerouteTestNetworkPathParams` - `account_id: string` Path param: Unique identifier linked to an account. - `deviceId: string` Query param: Device to filter traceroute result runs to. - `from: string` Query param: Start time for aggregate metrics in ISO ms. - `interval: "minute" | "hour"` Query param: Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: string` Query param: End time for aggregate metrics in ISO ms. ### Returns - `NetworkPathResponse` - `id: string` API Resource UUID tag. - `deviceName?: string` Name of the device that ran the test. - `interval?: string` The interval at which the Traceroute synthetic application test is set to run. - `kind?: "traceroute"` - `"traceroute"` - `name?: string` - `networkPath?: NetworkPath | null` - `slots: Array` - `id: string` API Resource UUID tag. - `clientToAppRttMs: number | null` Round trip time in ms of the client to app mile - `clientToCfEgressRttMs: number | null` Round trip time in ms of the client to Cloudflare egress mile - `clientToCfIngressRttMs: number | null` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: string` - `clientToIspRttMs?: number | null` Round trip time in ms of the client to ISP mile - `sampling?: Sampling | null` Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval. - `unit: "hours"` - `"hours"` - `value: number` - `url?: string` The host of the Traceroute synthetic application test. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const networkPathResponse = await client.zeroTrust.dex.tracerouteTests.networkPath( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', deviceId: 'deviceId', from: '1689520412000', interval: 'minute', to: '1689606812000', }, ); console.log(networkPathResponse.id); ``` #### Response ```json { "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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "deviceName": "deviceName", "interval": "0h5m0s", "kind": "traceroute", "name": "name", "networkPath": { "slots": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "clientToAppRttMs": 0, "clientToCfEgressRttMs": 0, "clientToCfIngressRttMs": 0, "timestamp": "2023-07-16 15:00:00+00", "clientToIspRttMs": 0 } ], "sampling": { "unit": "hours", "value": 0 } }, "url": "1.1.1.1" } } ``` ## Domain Types ### Traceroute - `Traceroute` - `host: string` The host of the Traceroute synthetic application test. - `interval: string` The interval at which the Traceroute synthetic application test is set to run. - `kind: "traceroute"` - `"traceroute"` - `name: string` The name of the Traceroute synthetic application test. - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account. - `name: string` - `targeted?: boolean` - `tracerouteStats?: TracerouteStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `hopsCount: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. - `tracerouteStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `colo: string` - `hopsCount: TestStatOverTime` - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period. - `max?: number | null` highest observed in the time period. - `min?: number | null` lowest observed in the time period. - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period. ### Traceroute Test Percentiles Response - `TracerouteTestPercentilesResponse` - `hopsCount?: Percentiles` - `p50?: number | null` p50 observed in the time period. - `p90?: number | null` p90 observed in the time period. - `p95?: number | null` p95 observed in the time period. - `p99?: number | null` p99 observed in the time period. - `packetLossPct?: Percentiles` - `roundTripTimeMs?: Percentiles` # Rules ## Get DEX Rule `client.zeroTrust.dex.rules.get(stringruleID, RuleGetParamsparams, RequestOptionsoptions?): RuleGetResponse` **get** `/accounts/{account_id}/dex/rules/{rule_id}` Get details for a DEX Rule. ### Parameters - `ruleID: string` API Resource UUID tag. - `params: RuleGetParams` - `account_id: string` Unique identifier linked to an account. ### Returns - `RuleGetResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(rule.id); ``` #### Response ```json { "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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } } ``` ## Delete a DEX Rule `client.zeroTrust.dex.rules.delete(stringruleID, RuleDeleteParamsparams, RequestOptionsoptions?): RuleDeleteResponse | null` **delete** `/accounts/{account_id}/dex/rules/{rule_id}` Delete a DEX Rule. ### Parameters - `ruleID: string` API Resource UUID tag. - `params: RuleDeleteParams` - `account_id: string` Unique identifier linked to an account. ### Returns - `RuleDeleteResponse = boolean | null` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(rule); ``` #### Response ```json { "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": true } ``` ## Update a DEX Rule `client.zeroTrust.dex.rules.update(stringruleID, RuleUpdateParamsparams, RequestOptionsoptions?): RuleUpdateResponse` **patch** `/accounts/{account_id}/dex/rules/{rule_id}` Update a DEX Rule. ### Parameters - `ruleID: string` API Resource UUID tag. - `params: RuleUpdateParams` - `account_id: string` Path param: Unique identifier linked to an account. - `description?: string` Body param - `match?: string` Body param: The wirefilter expression to match. - `name?: string` Body param: The name of the Rule. ### Returns - `RuleUpdateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(rule.id); ``` #### Response ```json { "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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } } ``` ## Create a DEX Rule `client.zeroTrust.dex.rules.create(RuleCreateParamsparams, RequestOptionsoptions?): RuleCreateResponse` **post** `/accounts/{account_id}/dex/rules` Create a DEX Rule. ### Parameters - `params: RuleCreateParams` - `account_id: string` Path param: Unique identifier linked to an account. - `match: string` Body param: The wirefilter expression to match. - `name: string` Body param: The name of the Rule. - `description?: string` Body param ### Returns - `RuleCreateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.create({ account_id: '01a7362d577a6c3019a474fd6f485823', match: 'match', name: 'name', }); console.log(rule.id); ``` #### Response ```json { "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": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } } ``` ## List DEX Rules `client.zeroTrust.dex.rules.list(RuleListParamsparams, RequestOptionsoptions?): V4PagePagination` **get** `/accounts/{account_id}/dex/rules` List DEX Rules. ### Parameters - `params: RuleListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `page: number` Query param: Page number of paginated results. - `per_page: number` Query param: Number of results per page. - `name?: string` Query param: Filter results by rule name. - `sort_by?: "name" | "created_at" | "updated_at"` Query param: Which property to sort results by. - `"name"` - `"created_at"` - `"updated_at"` - `sort_order?: "ASC" | "DESC"` Query param: Sort direction for sort_by property. - `"ASC"` - `"DESC"` ### Returns - `RuleListResponse` - `rules?: Array` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```typescript 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 ruleListResponse of client.zeroTrust.dex.rules.list({ account_id: '01a7362d577a6c3019a474fd6f485823', page: 1, per_page: 10, })) { console.log(ruleListResponse.rules); } ``` #### Response ```json { "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": { "rules": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Rule Get Response - `RuleGetResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Rule Delete Response - `RuleDeleteResponse = boolean | null` ### Rule Update Response - `RuleUpdateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Rule Create Response - `RuleCreateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Rule List Response - `RuleListResponse` - `rules?: Array` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: SchemaData` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` # Devices # ISPs ## List device ISPs `client.zeroTrust.dex.devices.isps.list(stringdeviceID, ISPListParamsparams, RequestOptionsoptions?): V4PagePagination` **get** `/accounts/{account_id}/dex/devices/{device_id}/isps` List ISP information observed for a specific device during traceroute tests. ### Parameters - `deviceID: string` API Resource UUID tag. - `params: ISPListParams` - `account_id: string` Path param: Unique identifier linked to an account. - `per_page: number` Query param: Number of items per page - `cursor?: string` Query param: Cursor for cursor-based pagination. Mutually exclusive with page. - `from?: string` Query param: Start time for the query in ISO 8601 format. - `page?: number` Query param: Page number of paginated results. Mutually exclusive with cursor. - `sort_by?: "time_start"` Query param: The field to sort results by. - `"time_start"` - `sort_order?: "ASC" | "DESC"` Query param: The order to sort results. - `"ASC"` - `"DESC"` - `to?: string` Query param: End time for the query in ISO 8601 format. ### Returns - `ISPs` - `isps: Array` - `test_id: string` The test that generated this result. - `test_result_id: string` The specific test result. - `time_start: string` Timestamp of when the ISP was observed. - `ip?: IP` IP address information for the ISP hop. Fields marked as PII-gated (`name`, `address`, `netmask`, and all `location` sub-fields) will be returned as the literal string `"REDACTED"` for callers that do not have the PII permission. `asn`, `aso`, and `version` are always returned regardless of PII access. - `address?: string` IP address. Returned as `"REDACTED"` without PII permission. - `asn?: number` Autonomous System Number. - `aso?: string` Autonomous System Organization name. - `location?: Location` Geographic location information. All fields are returned as the literal string `"REDACTED"` for callers that do not have the PII permission. - `city?: string` City name. Returned as `"REDACTED"` without PII permission. - `country_iso?: string` Country ISO code. Returned as `"REDACTED"` without PII permission. - `state_iso?: string` State/province ISO code. Returned as `"REDACTED"` without PII permission. - `zip?: string` ZIP/postal code. Returned as `"REDACTED"` without PII permission. - `name?: string` Named IP address (reverse DNS hostname when available). Returned as `"REDACTED"` without PII permission. - `netmask?: string` Network mask. Returned as `"REDACTED"` without PII permission. - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown). ### Example ```typescript 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 isps of client.zeroTrust.dex.devices.isps.list( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', per_page: 10 }, )) { console.log(isps.isps); } ``` #### Response ```json { "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": { "isps": [ { "test_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "test_result_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "time_start": "2024-06-01T12:00:00Z", "ip": { "address": "203.0.113.1", "asn": 13335, "aso": "CLOUDFLARENET", "location": { "city": "San Francisco", "country_iso": "US", "state_iso": "CA", "zip": "94107" }, "name": "isp-gateway.example.com", "netmask": "255.255.255.0", "version": 1 } } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### ISPs - `ISPs` - `isps: Array` - `test_id: string` The test that generated this result. - `test_result_id: string` The specific test result. - `time_start: string` Timestamp of when the ISP was observed. - `ip?: IP` IP address information for the ISP hop. Fields marked as PII-gated (`name`, `address`, `netmask`, and all `location` sub-fields) will be returned as the literal string `"REDACTED"` for callers that do not have the PII permission. `asn`, `aso`, and `version` are always returned regardless of PII access. - `address?: string` IP address. Returned as `"REDACTED"` without PII permission. - `asn?: number` Autonomous System Number. - `aso?: string` Autonomous System Organization name. - `location?: Location` Geographic location information. All fields are returned as the literal string `"REDACTED"` for callers that do not have the PII permission. - `city?: string` City name. Returned as `"REDACTED"` without PII permission. - `country_iso?: string` Country ISO code. Returned as `"REDACTED"` without PII permission. - `state_iso?: string` State/province ISO code. Returned as `"REDACTED"` without PII permission. - `zip?: string` ZIP/postal code. Returned as `"REDACTED"` without PII permission. - `name?: string` Named IP address (reverse DNS hostname when available). Returned as `"REDACTED"` without PII permission. - `netmask?: string` Network mask. Returned as `"REDACTED"` without PII permission. - `version?: number` IP version (`1` for IPv4, `2` for IPv6, `0` if unknown).