Deleting device state

Hi there,
is there a way to delete the entire state or time slice of it (one or many attributes) for a device via API or Node function?
This is to prevent dirty data coming into the system as a result of a parsing issue or a source issue.
Cheers.

You can delete device data for a given device on the device’s detail page, in the “Other Actions” dropdown. The default settings are to delete all attribute data associated with the device, but you can click the “Make changes” button to narrow the deletion request to a time range and specific attributes.

From the device list, you may also do the same but for a set of devices in bulk.

Behind the scenes, both requests use the Devices: Remove Data API endpoint. If you wish to do the deletion programatically, you can use the same endpoint.

I totally missed that function thanks!