...
After unbinding the device from all gateways it's bound to, use the Device delete method to delete the device.
This Node.js code samples sample illustrates how to delete a device bound to a gateway:
...
After unbinding all devices from the gateway, use the Device delete method to delete the gateway, specifying the ID of the gateway you want to delete.
This Node.js code samples sample illustrates how to delete a gateway:
...