Skip to main content
DELETE
/
devices
/
{device_id}
Delete Device
curl --request DELETE \
  --url https://api.example.com/devices/{device_id}
{
  "success": true,
  "message": "<string>"
}
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

device_id
string
required
The unique identifier of the device to deleteExample: "principal" or "bodega"

Response

success
boolean
required
Indicates whether the deletion was successful
message
string
required
Confirmation message

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 CodeDescription
200Device successfully deleted
404Device with the specified ID does not exist

What Gets Deleted

When you delete a device:
  1. Device configuration is removed from memory (DEVICES dictionary)
  2. Thread lock for the device is removed (_locks dictionary)
  3. 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

Build docs developers (and LLMs) love