Skip to content
Start here

List devices

client.zeroTrust.devices.devices.list(DeviceListParams { account_id, id, active_registrations, 9 more } params, RequestOptionsoptions?): CursorPagination<DeviceListResponse { id, active_registrations, created_at, 16 more } >
GET/accounts/{account_id}/devices/physical-devices

Lists WARP devices.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
params: DeviceListParams { account_id, id, active_registrations, 9 more }
account_id: string

Path param

id?: Array<string>

Query param: Filter by a one or more device IDs.

active_registrations?: "include" | "only" | "exclude"

Query param: Include or exclude devices with active registrations. The default is “only” - return only devices with active registrations.

One of the following:
"include"
"only"
"exclude"
cursor?: string

Query param: Opaque token indicating the starting position when requesting the next set of records. A cursor value can be obtained from the result_info.cursor field in the response.

include?: string

Query param: Comma-separated list of additional information that should be included in the device response. Supported values are: “last_seen_registration.policy”.

last_seen_user?: LastSeenUser

Query param

email?: string

Filter by the last seen user’s email.

per_page?: number

Query param: The maximum number of devices to return in a single response.

formatuint64
seen_after?: string

Query param: Filter by the last_seen timestamp - returns only devices last seen after this timestamp.

seen_before?: string

Query param: Filter by the last_seen timestamp - returns only devices last seen before this timestamp.

sort_by?: "name" | "id" | "client_version" | 4 more

Query param: The device field to order results by.

One of the following:
"name"
"id"
"client_version"
"last_seen_user.email"
"last_seen_at"
"active_registrations"
"created_at"
sort_order?: "asc" | "desc"

Query param: Sort direction.

One of the following:
"asc"
"desc"
ReturnsExpand Collapse
DeviceListResponse { id, active_registrations, created_at, 16 more }

A WARP Device.

id: string

The unique ID of the device.

active_registrations: number

The number of active registrations for the device. Active registrations are those which haven’t been revoked or deleted.

created_at: string

The RFC3339 timestamp when the device was created.

last_seen_at: string | null

The RFC3339 timestamp when the device was last seen.

name: string

The name of the device.

updated_at: string

The RFC3339 timestamp when the device was last updated.

client_version?: string | null

Version of the WARP client.

deleted_at?: string | null

The RFC3339 timestamp when the device was deleted.

device_type?: string | null

The device operating system.

hardware_id?: string | null

A string that uniquely identifies the hardware or virtual machine (VM).

last_seen_registration?: LastSeenRegistration | null

The last seen registration for the device.

policy?: Policy | null

A summary of the device profile evaluated for the registration.

id: string

The ID of the device settings profile.

default: boolean

Whether the device settings profile is the default profile for the account.

deleted: boolean

Whether the device settings profile was deleted.

name: string

The name of the device settings profile.

updated_at: string

The RFC3339 timestamp of when the device settings profile last changed for the registration.

last_seen_user?: LastSeenUser | null

The last user to use the WARP device.

id?: string

UUID.

maxLength36
email?: string

The contact email address of the user.

maxLength90
name?: string

The enrolled device user’s name.

mac_address?: string | null

The device MAC address.

manufacturer?: string | null

The device manufacturer.

model?: string | null

The model name of the device.

os_version?: string | null

The device operating system version number.

os_version_extra?: string | null

Additional operating system version details. For Windows, the UBR (Update Build Revision). For Mac or iOS, the Product Version Extra. For Linux, the distribution name and version.

serial_number?: string | null

The device serial number.

List devices

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.devices.devices.list({
  account_id: 'account_id',
})) {
  console.log(deviceListResponse.id);
}
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "fc9ab6ab-3b94-4319-9941-459462b3d73e",
      "active_registrations": 1,
      "created_at": "2025-02-14T13:17:00Z",
      "last_seen_at": "2025-02-14T13:17:00Z",
      "name": "My Device",
      "updated_at": "2025-02-14T13:17:00Z",
      "client_version": "1.0.0",
      "deleted_at": "2025-02-14T13:17:00Z",
      "device_type": "linux",
      "hardware_id": "hardware_id",
      "last_seen_registration": {
        "policy": {
          "id": "11ffb86f-3f0c-4306-b4a2-e62f872b166a",
          "default": true,
          "deleted": true,
          "name": "name",
          "updated_at": "2025-02-14T13:17:00Z"
        }
      },
      "last_seen_user": {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "email": "user@example.com",
        "name": "John Appleseed"
      },
      "mac_address": "f5:01:73:cf:12:23",
      "manufacturer": "ACME",
      "model": "Mark VII",
      "os_version": "os_version",
      "os_version_extra": "os_version_extra",
      "public_ip": "1.1.1.1",
      "serial_number": "ABS765ASD8A"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "cursor": "ais86dftf.asdf7ba8",
    "per_page": 10,
    "total_count": null
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "fc9ab6ab-3b94-4319-9941-459462b3d73e",
      "active_registrations": 1,
      "created_at": "2025-02-14T13:17:00Z",
      "last_seen_at": "2025-02-14T13:17:00Z",
      "name": "My Device",
      "updated_at": "2025-02-14T13:17:00Z",
      "client_version": "1.0.0",
      "deleted_at": "2025-02-14T13:17:00Z",
      "device_type": "linux",
      "hardware_id": "hardware_id",
      "last_seen_registration": {
        "policy": {
          "id": "11ffb86f-3f0c-4306-b4a2-e62f872b166a",
          "default": true,
          "deleted": true,
          "name": "name",
          "updated_at": "2025-02-14T13:17:00Z"
        }
      },
      "last_seen_user": {
        "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        "email": "user@example.com",
        "name": "John Appleseed"
      },
      "mac_address": "f5:01:73:cf:12:23",
      "manufacturer": "ACME",
      "model": "Mark VII",
      "os_version": "os_version",
      "os_version_extra": "os_version_extra",
      "public_ip": "1.1.1.1",
      "serial_number": "ABS765ASD8A"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "cursor": "ais86dftf.asdf7ba8",
    "per_page": 10,
    "total_count": null
  }
}