---
title: "How to automate cleanup of Dataplane reports and preview deletions"
canonical: "https://support.appfire.com/space/SUPPORT/3538518031/How%20to%20automate%20cleanup%20of%20Dataplane%20reports%20and%20preview%20deletions"
format: markdown
---
This article covers two primary methods for managing the cleanup of Dataplane reports: using the built-in automated cleanup feature and a manual workaround for previewing and auditing deletions using the REST API.

## Summary

Dataplane now includes a built-in **Report Clean Up** feature that automatically removes inactive reports based on a configured retention period. Administrators can enable the feature, choose whether to include reports that have never run, and allow the daily cleanup job to remove eligible reports. Because the feature does not currently provide a preview or audit log, administrators who need to review affected reports should use the **REST API** to capture and compare report inventories.

## Use case 1: automated bulk cleanup

Recommended method for ongoing maintenance of inactive reports.

### Solution

Dataplane provides a native [cleanup job](https://support.appfire.com/space/dataplane/455967734/Configure+Dataplane#Report-Clean-Up) that runs daily.

1. Navigate to **Manage apps** > **Dataplane Configuration** > **Clean Up**.
2. **Enable** the **Report Clean Up** feature.
3. Set the **Retention Period**. Options:
  - 3 months (≈ 90 days)
  - 6 months
  - 9 months
  - 12 months
4. (Optional) Select the checkbox to **delete reports that were never run**.
5. Save the configuration. The job will remove eligible reports every 24 hours.

![image](media://85895cf4-0c05-4d5d-916d-64434636e933)

## Use case 2: previewing or auditing report deletions

The automated cleanup job provides no history or preview. Use this API-based workaround to identify reports the job will remove.

### Solution

Use the Dataplane Admin Reports REST API to snapshot your report inventory and compare snapshots.

1. Before enabling Clean Up, export a full inventory of your current reports using the Dataplane Admin Reports REST API and save it as a baseline snapshot.
2. Use the REST API below directly in a browser window:
  *Note: Replace *`<your-jira-host>`* with your Jira URL. You must have System Administrator permissions.*
3. The API returns a JSON payload with metadata for each report, including:
  - `guid`: Unique report identifier.
  - `lastRun`: Timestamp of the last execution.
  - `name` and `owner`.
4. **Compare snapshots:**
  - Save the initial JSON output.
  - Let the cleanup job run.
  - Export the inventory again using the same endpoint.
  - Compare the two lists by `guid` to find removed reports.