The devices routes manage the inventory of Raspberry Pi sensor nodes that submit BLE scan data. Each device is identified by a unique stringDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AngelAmoSanchez/TFG-RaspberryPi-BLE/llms.txt
Use this file to discover all available pages before exploring further.
device_id chosen by the operator. Devices are registered automatically when the bulk detection endpoint is called, or explicitly via POST /register. All endpoints are mounted under /api/v1/devices.
Device model
The following fields are returned by every endpoint that returns a device object.Auto-incremented integer primary key.
Operator-assigned unique identifier, e.g.
"pi-entrance-01". Maximum 50 characters.Human-readable label.
null if not set.Physical location description.
null if not set.true when the device is active, false when deactivated. Stored as an integer (1/0) in the database and serialised as a boolean in responses.ISO 8601 timestamp of the most recent detection submission from this device.
null if the device has never submitted data.ISO 8601 timestamp of when the device record was first created.
ISO 8601 timestamp of the most recent update to the device record.
POST /api/v1/devices/register
Register a new device or update the metadata of an existing one. If a device with the givendevice_id already exists it is updated in place; otherwise a new record is created.
Request body
Unique identifier for the Raspberry Pi node.
Human-readable label for the device.
Physical location description.
GET /api/v1/devices/
Return all registered devices. Query parametersWhen
true, returns only devices whose is_active flag is set. When false (the default), all devices are returned regardless of active state.GET /api/v1/devices/active
Return devices that have submitted at least one detection within the last N minutes. This is distinct fromactive_only on the list endpoint, which filters by the stored is_active flag rather than recent activity.
Query parameters
Number of minutes to look back from the current time. A device is considered active if its
last_seen timestamp falls within this window.GET /api/v1/devices/
Return a single device by itsdevice_id.
Path parameters
The device’s unique identifier.
GET /api/v1/devices//stats
Return detection statistics scoped to a single device. Path parametersThe device’s unique identifier.
DeviceService.get_device_stats.
PUT /api/v1/devices/
Update thename and/or location of an existing device. Both fields are optional; supply only the ones you want to change.
Path parameters
The device’s unique identifier.
New human-readable label for the device.
New physical location description.
POST /api/v1/devices//deactivate
Setis_active to false for the device. Deactivated devices stop appearing in responses filtered by active_only=true, but their detection history is preserved.
Path parameters
The device’s unique identifier.
is_active: false, or HTTP 404 if not found.
POST /api/v1/devices//activate
Setis_active to true for a previously deactivated device.
Path parameters
The device’s unique identifier.
is_active: true, or HTTP 404 if not found.