All Collections
Versions 3.0 and 2.0
Implement
All Products
How to bulk delete batches older than a specified date
How to bulk delete batches older than a specified date
Elisa Dinsmore avatar
Written by Elisa Dinsmore
Updated over a week ago

This article is for Flatfile's Portal 2.0, Portal 3.0, and Workspaces. If you'd like to check out the latest version of the Flatfile Data Exchange Platform, click here!

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.

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.

Did this answer your question?