In Flatfile, you now have the ability to automatically bulk delete batches that were uploaded prior to a specified date. These deletions can be automated using cron.
You can do this by accessing the API and sending a few simple commands:
Let’s go over the elements of this API call that allow you to customize your request.
First, `teamId` must be set to your team ID (the team ID that contains the batches you would like to delete).
Next, `olderThanUnit` must be `minute`, `hour`, `day`, `week`, or `month`. This specifies, as the name suggests, the units of the next element: `olderThanQuantity`.
`olderThanQuantity` defines the quantity of the units defined in `olderThanUnit`. For example, if `olderThanUnit=day` and `olderThanQuanity=4`, you will delete all batches older than 4 days.
Remember, just like with your other API requests, you must include the API key with the mandatory header `X-Api-Key`.
For additional reference, our API docs can be accessed here.