Deleting Data Logs

Data logs can be removed (deleted) only by the IAP/REST API. Once you remove a data log entry you can not recover that information later.  All data log entries have a retention time that you specify for a datapoint property (see CMS Datapoint Properties Widget). This means that all log entries should eventually be removed automatically based on the retention time.


Removes one or more datapoint data logs by specifying the datapoint names and time range.

DELTE     /iap/devs/{id}/if/{block_type}/{block_handle}/{dp_name}/logs/value/*

Deletes all data log entries from  for a range specifying UTC start and end times.

Remove some data logs
Example: 
DELETE https://localhost/iap/devs/*/if/*/*/*+timestamp=>2022-08-05T18:36Z×tamp<2022-03-29T00:00Z/logs/value/*
Request payload: no entry

Response:
Response code 204

Deletes older data log entries by removing all entries with times older than the specified UTC time.

Remove all older data logs
Example: 
DELETE https://localhost/iap/devs/*/if/*/*/*+timestamp<=2022-03-29T00:00Z/logs/value/*
Request payload: no entry

Response:
Response code 204

Deletes all data log entries.

Remove all old data logs
Example: 
DELETE https://localhost/iap/devs/*/if/*/*/*+timestamp<=2022-03-29T00:00Z/logs/value/*
Request payload: no entry

Response:
Response code 204

Deletes all old data log entries for a specific datapoint by removing all entries with times older than the specified UTC time.

Remove all old data logs for specific datapoint
Example: 
DELETE https://localhost/iap/devs/*+name==Sensor1/if/Lamp/0/*+name==nviLamp&timestamp<=2022-03-29T00:00Z/logs/value/*
Request payload: no entry

Response:
Response code 204

Deletes all data log entries from UTC time 2022-08-05T18:36Z and any future recorded events.  This is typically used if you are testing schedules and temporarily moving the SmartServer to a future date and after the test moving back to the current date were data log entries get added due to the test. After going back to the current you will want to remove the future data log entries in order to not interfere with trending reports.

Remove future data logs – used for schedule testing
Example: 
DELETE https://localhost/iap/devs/*/if/*/*/*+timestamp=>2022-08-05T18:36Z/logs/value/*
Request payload: no entry

Response:
Response code 204