This guide covers the UI-based configuration. You can also manage retention policies programmatically through the Upsert Retention Policies API or the TypeScript SDK.
Prerequisites
- A dataset you own or have write access to
- The dataset must be on an active data plane
Understanding policy classes
Before configuring a policy, choose the right policy class for your use case. The available classes depend on your data plane:
For a detailed explanation of each policy class, see Dataset retention policies.
Adding a retention policy
1
Navigate to the dataset
Go to My Data > Datasets and select the dataset you want to configure.
2
Open the new-policy form
You can start a new policy from several places on the dataset details page:
- Retention section, no policies yet — the section shows an empty state with a New Policy + button. Click the button to configure the policy manually, or click its dropdown arrow to choose between Ask Rosetta (AI-assisted) and Configure manually.
- Retention section, existing policies — click the … button at the top of the section’s card and select New policy, or Ask Rosetta for an AI-assisted policy.
- Details panel — under Behavior, click the pencil icon on the Retention row. On a narrow window, click Details to open the panel first.
- Actions menu — click Actions, then under the Retention group select Configure retention policy.
3
Configure the policy
In the configuration form, set the following:Policy class — Select the type of retention policy. The available options depend on your data plane.Interval — Choose a preset duration (30, 90, 180, or 365 days) or enter a custom ISO 8601 duration such as Policy enabled — Toggle the policy on or off. Policies are enabled by default.
P60D for 60 days.Class-specific settings:- Row TTL
- Snapshot TTL
- Table TTL
Event time clock — Select the Rosetta Stone attribute that maps to a timestamp column in your dataset. The dropdown shows all
timestamptz attributes mapped on the dataset. If you don’t specify one, the system defaults to nio_last_modified.4
Save the policy
Click Save. The policy appears in the retention policies table, and the details panel shows the dataset’s details again.
Using Ask Rosetta to generate a policy
Instead of configuring a policy manually, you can describe what you want in plain language and let Rosetta generate the configuration for you.1
Open Ask Rosetta
From the Retention section, click the … button at the top of the section’s card and select Ask Rosetta. If the dataset has no policies yet, click the dropdown arrow on the New Policy + button and select Ask Rosetta instead.
2
Describe your policy
Enter a plain-language description of the retention behavior you want. For example:
Delete individual rows older than 90 days based on when the event occurred. Use the event_timestamp attribute as the clock. Keep the policy enabled.You can also click Use this prompt to start with the sample prompt provided.
3
Generate and review
Click Generate Policy. Rosetta converts your description into a structured policy configuration and opens the configuration form with the values pre-filled. Review the settings and adjust if needed.
4
Save the policy
Click Save to save the generated configuration.
Editing a retention policy
To modify an existing policy, click the actions menu (three dots) on the policy row and select Edit. The Edit retention policy form opens in the details panel with the current settings pre-populated. You cannot change the policy class when editing — to switch policy classes, delete the existing policy and create a new one.Enabling or disabling a policy
You can toggle a policy on or off without deleting it:- From the table — Click the toggle switch next to the policy class badge
- From the actions menu — Click the actions menu and select Enable or Disable
Deleting a retention policy
Click the actions menu on the policy row and select Delete. Confirm the deletion in the dialog that appears. This removes the policy configuration entirely — it does not undo any deletions that have already occurred.Related content
Dataset retention policies
Understand how retention policies work and when to use each policy class
Data planes
Learn where your data physically resides and how it affects retention behavior
EXPIRE clause
Set retention on materialized views using NQL
Upsert Retention Policies API
Manage retention policies programmatically

