---
title: "Schema Retention"
description: "Configure data retention policies for profile fields."
url: "https://www.contentstack.com/docs/lytics/schema-retention"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-05"
---

# Schema Retention

Configure data retention policies for profile fields.

## Overview

Schema retention settings control how long data is kept for specific fields or tables in your schema. Retention policies help you manage data lifecycle, comply with privacy regulations, and keep profiles clean by automatically expiring stale data.

Retention applies to the _data on profiles_, not to the audiences built from it. Audiences are live filters that re-evaluate as profile data changes — they have no lifespan of their own. The optional per-audience **Expires After** setting is unrelated to retention: it deletes the audience definition and leaves every profile untouched. See [Audiences](/docs/lytics/audiences).

**Schema retention is opt in; some account settings are not**

The schema-level controls on this page — field keep\_days and capacity, and table retention — apply only once you configure them. Nothing expires by default.

Two account-level settings are different: depending on your package, **event archive retention** (archive\_retention\_duration, between 1 and 12 months) and the **anonymous profile cull** (cull\_anonymous, commonly 60 days) may already be active without anyone having configured them. Both are ordinary account settings, so a per-account value overrides the package default, and where no value is set the data has no age limit.

To confirm what applies to you, check your package and whether an account-level override is in place. Your account team can confirm both.

## Configuring Retention

Retention settings can be applied at the table level to control how long profile data is retained.

### API Reference

#### Get Retention Settings

```
GET /v2/schema/{table}/retention
```

Returns the current retention configuration for a table.

#### Update Retention Settings

```
POST /v2/schema/{table}/retention
```

Updates the retention configuration for a table.

## Field-Level Retention

Individual fields can have keep\_days configured to control how long their values are retained on profiles. When keep\_days is set, field values older than the specified number of days are automatically cleared during profile maintenance.

See [Fields & Mappings](/docs/lytics/fields-mappings) for details on configuring keep\_days when creating or updating fields.

## Use Cases

*   **Cookie expiration**: Set retention on cookie-based identity fields to automatically expire inactive anonymous profiles.
*   **GDPR compliance**: Configure retention limits on PII fields to ensure data is not kept beyond required periods.
*   **Data freshness**: Expire behavioral signals that become stale after a defined period (e.g., recent purchase flags).

## Other Data Lifecycle Controls

Schema retention is one of several independent controls. Each operates at a different level, and they can be combined.

Control

Scope

Where to configure

**Field retention** (keep\_days, capacity)

Individual values within a field

[Fields & Mappings](/docs/lytics/fields-mappings)

**Table retention**

All data in a schema table

This page

**Cull User Filter**

Whole profiles matching a segment expression, removed nightly

[Profile Controls](/docs/lytics/profile-schema#cull-user-filter)

**Cull Anonymous Users**

Anonymous-only profiles past an age threshold, removed nightly. Many packages default this to 60 days

[Profile Controls](/docs/lytics/profile-schema#cull-anonymous-users)

**Profile deletion**

A specific person, on request

[Identity Deletion](/docs/lytics/identity-deletion), [Bulk User Deletion](/docs/lytics/bulk-user-deletion)

**Event archive retention**

Maximum age of events kept in the archive. Package-derived, typically 1–12 months, overridable per account

Account setting archive\_retention\_duration — contact your account team

Audience expiration is deliberately absent from this table. Setting **Expires After** on an audience deletes that audience's definition and nothing else — no profile, field value, or event is removed. It is an organizational convenience for retiring unused audiences, not a data lifecycle control, and it does not contribute to any retention or minimization requirement.

**Culling is not deletion**

Culling removes profiles from the profile store and search index but does not delete the underlying event data. If new events later arrive for a culled identifier, the profile is rebuilt with its prior history. To permanently remove a person, use [Identity Deletion](/docs/lytics/identity-deletion).

For how these controls map to privacy obligations and data subject requests, see [Privacy and Data Protection](/docs/lytics/privacy-and-data-protection) and [Compliance](/docs/lytics/compliance). For modeling consent — which Lytics does not track natively and you define in your own schema — see [Consent & Privacy](/docs/lytics/consent).