List devices
zero_trust.devices.devices.list(DeviceListParams**kwargs) -> SyncCursorPagination[DeviceListResponse]
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:
Parameters
cursor: Optional[str]
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: Optional[str]
Comma-separated list of additional information that should be included in the device response. Supported values are: “last_seen_registration.policy”.
seen_after: Optional[str]
Filter by the last_seen timestamp - returns only devices last seen after this timestamp.
List devices
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
page = client.zero_trust.devices.devices.list(
account_id="account_id",
)
page = page.result[0]
print(page.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
}
}