Permanently remove a device from your account. This action cannot be undone.
Hosted service only. This endpoint is part of the hosted API at https://nolongerevil.com/api/v1 and requires an nle_ API key. It is not available on the self-hosted server.
This action is irreversible! The device will be unlinked from your account and will need to be reclaimed using an entry key.
{ "error": "Only device owners can delete devices"}
Cause: You have shared access to this device but are not the owner.Solution: Only the device owner can delete it. If you want to remove your access, ask the owner to revoke the share.
// When replacing an old thermostatasync function replaceDevice(oldDeviceId, newEntryKey) { // Delete old device await deleteDevice(oldDeviceId); // Claim new device await claimDevice(newEntryKey);}
// When selling your home or moving outasync function removeAllDevices() { const { devices } = await listDevices(); for (const device of devices) { if (device.accessType === 'owner') { await deleteDevice(device.id); console.log(`Deleted ${device.name || device.serial}`); } }}