How to Configure Data Retention Policies in Flatfile

Last updated: October 10, 2025

Introduction

This guide will walk you through how to set up and manage data retention policies in Flatfile to automatically manage the lifecycle of your data.

Prerequisites

  • Enterprise contract (for automatic data retention features)

  • API access to Flatfile

Steps

  1. Understanding Data Retention Scope

    1. Data retention policies are configured at the environment level only

    2. The default retention period is 365 days

  2. Creating a Data Retention Policy

    1. Use the API endpoint at https://reference.flatfile.com/api-reference/data-retention-policies/create

    2. Specify the period in days (minimum value is 1)

    3. Configure parameters like lastActivity or sinceCreated based on your needs


Tips

  • When a space expires, all its associated workbooks are automatically expired

  • There is no maximum limit to the retention period you can set

  • For custom retention logic, you can utilize cron events in your server-side listener

Troubleshooting

  • If you don't see retention settings in the UI, these must be configured via API

  • Retention policies cannot be set at the space, workbook, or account level - only at the environment level