Skip to content

Device Management

The Devices API allows location administrators to register, query, monitor status, and queue commands for ZKTeco biometric edge hardware.

Endpoints Overview

MethodEndpointDescription
GET/api/devicesRetrieve a paginated list of devices
POST/api/devicesAssign a device to location
GET/api/devices/{device_serial}Retrieve detailed information for a device
GET/api/devices/{device_serial}/statusGet real-time connection status
DELETE/api/devices/{device_serial}Unassign a device from location

List Devices

GET /api/devices

Retrieve a paginated list of devices assigned to the authenticated location.

Query Parameters

ParameterTypeRequiredDefaultDescription
pageIntegerNo1Page number (1-indexed).
limitIntegerNo15Number of records per page.
searchStringNonullFilter by device name or serial number.
is_activeBooleanNonullFilter by online/active status (true or false).

Response Attributes

Pagination Response Wrap

AttributeTypeDescription
dataArray[DeviceResponse]List of device records for current page.
totalIntegerTotal count of devices matching criteria.
pageIntegerCurrent page number.
limitIntegerLimit per page.
total_pagesIntegerCalculated total number of pages.
has_nextBooleantrue if next page exists.
has_prevBooleantrue if previous page exists.

DeviceResponse Attributes

AttributeTypeDescription
idIntegerDevice internal database ID.
nameStringDevice display name (e.g., "Device AFK921400123").
serial_numberStringDevice hardware serial number (SN).
location_idInteger | NullID of assigned location.
locationLocationBasic | NullBasic object containing id and name of location.
registry_codeString | NullDevice registration code.
session_idString | NullActive iClock session identifier.
registered_atString (ISO 8601) | NullTimestamp when device first registered with server.
optionsObject | NullKey-value dictionary of device options reported during handshake.
versionString | NullPush SDK protocol version ("2.0.0" or "3.0.0").
last_seenString (ISO 8601) | NullTimestamp of last heartbeat request received from device.
is_activeBooleanDevice online status (true if connected within threshold).
created_atString (ISO 8601)Timestamp when record was created.
updated_atString (ISO 8601) | NullTimestamp when record was last updated.

Response Example

json
{
  "data": [
    {
      "id": 12,
      "name": "Main Entrance Gate",
      "serial_number": "AFK921400123",
      "location_id": 1,
      "location": {
        "id": 1,
        "name": "Headquarters Office"
      },
      "registry_code": "REG-88231",
      "session_id": "sess_9941a",
      "registered_at": "2026-02-10T11:00:00Z",
      "options": {
        "~DeviceName": "SpeedFace-V5L",
        "FirmVer": "Ver 8.0.4.3-2024",
        "UserNum": "142",
        "FPNum": "210"
      },
      "version": "3.0.0",
      "last_seen": "2026-08-26T17:45:10Z",
      "is_active": true,
      "created_at": "2026-02-10T11:00:00Z",
      "updated_at": "2026-08-26T17:45:10Z"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 15,
  "total_pages": 1,
  "has_next": false,
  "has_prev": false
}

Assign Device

POST /api/devices

Assign a device (identified by serial number) to the authenticated location and automatically initiate user synchronization.

Request Body Parameters

ParameterTypeRequiredDescription
snStringYesDevice hardware serial number (SN).
nameStringNoCustom display name for the device (defaults to "Device {SN}").

Response Attributes

Returns the assigned DeviceResponse object.

Response Example

json
{
  "sn": "AFK921400123",
  "name": "Front Gate SpeedFace"
}
json
{
  "id": 12,
  "name": "Device AFK921400123",
  "serial_number": "AFK921400123",
  "location_id": 1,
  "location": {
    "id": 1,
    "name": "Headquarters Office"
  },
  "registry_code": null,
  "session_id": null,
  "registered_at": null,
  "options": null,
  "version": "3.0.0",
  "last_seen": null,
  "is_active": false,
  "created_at": "2026-08-26T17:49:00Z",
  "updated_at": "2026-08-26T17:49:00Z"
}

Get Device Details

GET /api/devices/{device_serial}

Retrieve detailed information for a specific device by its serial number.

Path Parameters

ParameterTypeRequiredDescription
device_serialStringYesSerial number of the target device.

Response Attributes

Returns DeviceResponse object.

Response Example

json
{
  "id": 12,
  "name": "Main Entrance Gate",
  "serial_number": "AFK921400123",
  "location_id": 1,
  "location": {
    "id": 1,
    "name": "Headquarters Office"
  },
  "registry_code": "REG-88231",
  "session_id": "sess_9941a",
  "registered_at": "2026-02-10T11:00:00Z",
  "options": {
    "~DeviceName": "SpeedFace-V5L"
  },
  "version": "3.0.0",
  "last_seen": "2026-08-26T17:45:10Z",
  "is_active": true,
  "created_at": "2026-02-10T11:00:00Z",
  "updated_at": "2026-08-26T17:45:10Z"
}

Get Device Status

GET /api/devices/{device_serial}/status

Get light-weight real-time connection status and last heartbeat timestamp for a device.

Path Parameters

ParameterTypeRequiredDescription
device_serialStringYesSerial number of the target device.

Response Attributes

AttributeTypeDescription
device_idIntegerDevice internal database ID.
serial_numberStringDevice hardware serial number.
is_onlineBooleanOnline status flag (true if active).
last_seenString (ISO 8601) | NullTimestamp of last heartbeat.
statusStringOperational status string ("online" or "offline").

Response Example

json
{
  "device_id": 12,
  "serial_number": "AFK921400123",
  "is_online": true,
  "last_seen": "2026-08-26T17:45:10Z",
  "status": "online"
}

Unassign Device

DELETE /api/devices/{device_serial}

Unassign and remove a device from the authenticated location. Operation is idempotent.

Path Parameters

ParameterTypeRequiredDescription
device_serialStringYesSerial number of device to unassign.

Response Example

json
{}

Enterprise Biometric Gateway Infrastructure