Skip to content
Start here

Get device

zero_trust.devices.devices.get(strdevice_id, DeviceGetParams**kwargs) -> DeviceGetResponse
GET/accounts/{account_id}/devices/physical-devices/{device_id}

Fetches a single WARP device.

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
account_id: str
device_id: str
include: Optional[str]

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

ReturnsExpand Collapse
class DeviceGetResponse:

A WARP Device.

id: str

The unique ID of the device.

active_registrations: int

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

created_at: str

The RFC3339 timestamp when the device was created.

last_seen_at: Optional[str]

The RFC3339 timestamp when the device was last seen.

name: str

The name of the device.

updated_at: str

The RFC3339 timestamp when the device was last updated.

client_version: Optional[str]

Version of the WARP client.

deleted_at: Optional[str]

The RFC3339 timestamp when the device was deleted.

device_type: Optional[str]

The device operating system.

hardware_id: Optional[str]

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

last_seen_registration: Optional[LastSeenRegistration]

The last seen registration for the device.

policy: Optional[LastSeenRegistrationPolicy]

A summary of the device profile evaluated for the registration.

id: str

The ID of the device settings profile.

default: bool

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

deleted: bool

Whether the device settings profile was deleted.

name: str

The name of the device settings profile.

updated_at: str

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

last_seen_user: Optional[LastSeenUser]

The last user to use the WARP device.

id: Optional[str]

UUID.

maxLength36
email: Optional[str]

The contact email address of the user.

maxLength90
name: Optional[str]

The enrolled device user’s name.

mac_address: Optional[str]

The device MAC address.

manufacturer: Optional[str]

The device manufacturer.

model: Optional[str]

The model name of the device.

os_version: Optional[str]

The device operating system version number.

os_version_extra: Optional[str]

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: Optional[str]

The device serial number.

Get device

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
device = client.zero_trust.devices.devices.get(
    device_id="device_id",
    account_id="account_id",
)
print(device.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
}
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
}