DELETE using SmartRest 2.0

Product/components used and version/fix level:

Cumulocity IoT 1020.296.0

Detailed explanation of the problem:

We need to delete a device using MQTT.

Here I didn’t find any template to do so.

Then I tried to define a custom SmartRest template, but on inventory the permitted operations are GET, POST and PUT

Am I missing something?
Is DELETE permitted using REST API only?

Best
Luca

Error messages / full error message screenshot / log file:

Question related to a free trial, or to a production (customer) instance?

Customer instance

SmartREST 2 does not provide an interface for deleting of devices.

It is intended that users (not devices) control when a device is deleted because deleting a device always and irreversibly removes the device and all its attached data. This includes all measurements, events, alarms and operations. Potentially also child devices and all their data is removed depending on chosen options. The device is also removed from the asset hierarchy which can have effects on other devices and their access for users. Altogether this is not an action that should be done implicitly by a device and requires careful consideration by users

1 Like

I totally backup Philipp’s answer! The device should not delete itself. This is also an audit relevant topic.

Is DELETE permitted using REST API only?

Yes, but use it with care (see above) Cumulocity - OpenAPI
A better way would be to set a specific flag on the device informing the user that it can be deleted. This can be done be setting a fragment and/or changing the device name.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.