Bulk Unlinking Devices
After working with Tenovi devices overtime, you can run into instances where you need to unlink many devices at once. The most common situations for this involve device audits, unenrolling many patients, etc.
Once you have a list of devices you can then make use of the unlink-gateway endpoint.
Getting a List of Devices to Unlink
In order to unlink devices, you will need the appropriate HWI Device IDs of the individual devices. Using the hwi-devices endpoint, you can get a list of all devices on your account. This endpoint is not pagniated and will, by default, return all devices on your account regardless of their status (shipped, delivered, connected, unlinked, etc.).
Pair this list down to the devices you wish to unlink by leaning upon the patient.external_id field, hardware_uuid (Gateway) field, or other unique identifiers.
Looping the unlink-gateway API Call
Using the list of applicable HWI Device IDs, you can then loop through the list and send a GET request to the unlink-gateway API endpoint.
This API call requires a valid HWI Device ID. Example URL:
https://api2.tenovi.com/clients/{your_client_domain_here}/hwi/unlink-gateway/{hwi_device_id_here}/External Tool vs Main Software Stack
You can bake this kind of process into your main software stack if you choose. However, since this operation should be infrequently done and should only be performed when absolutely neccessary with the proper oversight, it’s recommended to create tooling outside your main software stack.
A simple method for doing this would be to lean on Postman, or a similar desktop HTTP request client, to process the list of HWI Device IDs. Postman has a feature called Postman Collection Runners that enable you to loop through lists of data making API calls for each iteration.