Set Dataset Retention
const url = 'https://example.com/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/retention/?dry_run=false';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"retention":{"column":"example","days":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url 'https://example.com/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/retention/?dry_run=false' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "retention": { "column": "example", "days": 1 } }'Set or clear how many days of rows a feature dataset keeps.
Hourly worker runs delete rows whose retention column is older than the
cutoff, in batches, so a large backlog can take several runs; rows where
it is null are kept. A dry run counts the rows past the cutoff now in
rows_past_cutoff; a save skips that scan and returns null. The
instance’s dataset editing switch does not apply: this is the owner’s
setting, not an edit.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Query Parameters
Section titled “ Query Parameters ”Check the setting and count its rows without saving it.
Check the setting and count its rows without saving it.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The retention setting to store; null turns retention off.
object
Keep only the rows from the last days days, judged by column.
object
A date or timestamp column of the dataset’s table. Rows where it is null are kept.
Example generated
{ "retention": { "column": "example", "days": 1 }}Responses
Section titled “ Responses ”Successful Response
object
Keep only the rows from the last days days, judged by column.
object
A date or timestamp column of the dataset’s table. Rows where it is null are kept.
Example generated
{ "retention": { "column": "example", "days": 1 }, "rows_past_cutoff": 1, "cutoff": "2026-04-15T12:00:00Z"}Bad request — invalid payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks write access
Not found
Conflict — resource state prevents the operation
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “ Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request