---
title: "Update data lifecycle settings"
method: PUT
path: "/api/v1/settings/archival"
tags: ["Internal: Data Lifecycle"]
---

# Update data lifecycle settings

`PUT /api/v1/settings/archival`

Configure archive_after_days (when live data is aggregated) and delete_after_days (when old data is permanently removed). Set to null to disable.

## Request body

- ArchivalSettingUpdate — Request schema for updating archival settings.
  - `archive_after_days` integer, nullable — Days before live data is archived. NULL to disable archival.
  - `delete_after_days` integer, nullable — Days before data is permanently deleted. NULL to keep indefinitely.

## Response `200`

Successful Response

- ArchivalSettingWithEstimate — Combined archival settings + storage estimates response.
  - `settings` ArchivalSettingRead, required — Response schema for archival settings.
    - `archive_after_days` integer, nullable — Days before live samples are aggregated into daily archive. NULL = archival disabled.
    - `delete_after_days` integer, nullable — Days before archived data is permanently removed. NULL = kept indefinitely.
  - `storage` StorageEstimate, required — Storage sizes across all database tables.
    - `live_data_bytes` integer, required — Data size of data_point_series table (bytes)
    - `live_index_bytes` integer, required — Index size of data_point_series table (bytes)
    - `archive_data_bytes` integer, required — Data size of archive table (bytes)
    - `archive_index_bytes` integer, required — Index size of archive table (bytes)
    - `other_tables_bytes` integer, required — Total size of all other tables (bytes)
    - `total_bytes` integer, required — Total storage across ALL tables
    - `live_row_count` integer, required — Number of rows in live table
    - `archive_row_count` integer, required — Number of rows in archive table
    - `avg_bytes_per_live_row` number, required — Average bytes per live row (data+index)
    - `avg_bytes_per_archive_row` number, required — Average bytes per archive row (data+index)
    - `live_data_span_days` integer, required — Actual span of live data in days (MAX - MIN recorded_at)
    - `live_total_pretty` string, required — Human-readable live total size (data+indexes)
    - `live_data_pretty` string, required — Human-readable live data size
    - `live_index_pretty` string, required — Human-readable live index size
    - `archive_total_pretty` string, required — Human-readable archive total size (data+indexes)
    - `archive_data_pretty` string, required — Human-readable archive data size
    - `archive_index_pretty` string, required — Human-readable archive index size
    - `other_tables_pretty` string, required — Human-readable other tables size
    - `total_pretty` string, required — Human-readable total DB size
    - `growth_class` string, required — Growth complexity class: 'bounded' | 'linear_efficient' | 'linear'

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/openwearables/apis/open-wearables-api.md) · [All operations](https://skmtc.net/openwearables/apis/open-wearables-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openwearables/open-wearables-api/versions/37c1c527cd8f/schema)
