Permanently removes a device from the server’s configuration. This operation cannot be undone and will delete all stored connection information for the device.
This operation is permanent. The device configuration will be deleted from devices.json. You will need to re-register the device using the POST /devices endpoint to restore it.
Path Parameters
The unique identifier of the device to deleteExample: "principal" or "bodega"
Response
Indicates whether the deletion was successful
Example Request
curl -X DELETE https://your-server.com/devices/bodega
Example Response
Success (200)
{
"success": true,
"message": "Dispositivo 'bodega' eliminado."
}
Error: Device Not Found (404)
{
"success": false,
"error": "Dispositivo 'nonexistent' no encontrado.",
"disponibles": ["principal", "bodega"]
}
Error Codes
| Status Code | Description |
|---|
| 200 | Device successfully deleted |
| 404 | Device with the specified ID does not exist |
What Gets Deleted
When you delete a device:
- Device configuration is removed from memory (
DEVICES dictionary)
- Thread lock for the device is removed (
_locks dictionary)
- Persistent storage is updated (changes written to
devices.json)
What Is NOT Deleted
Deleting a device from the server does not:
- Remove users or attendance records stored on the physical device itself
- Delete any historical data you may have extracted and stored elsewhere
- Affect the physical device’s operation or configuration
Use Cases
- Decommission a device that is no longer in use
- Remove a misconfigured device before re-adding it
- Clean up test devices from your configuration
- Manage device lifecycle in dynamic environments
Notes
- This operation is thread-safe and protected by a lock
- The device can be re-registered at any time using the POST /devices endpoint
- Consider using GET /devices/ first to verify you’re deleting the correct device