---
title: "C3: prune derived_prices rows older than the hot window (dry-run by default)"
method: POST
path: "/internal/cron/prune-derived"
tags: ["internal"]
---

# C3: prune derived_prices rows older than the hot window (dry-run by default)

`POST /internal/cron/prune-derived`

Daily retention prune: removes derived_prices rows older than
derived_prices_hot_window_days (default 90d) across all known symbols.

DRY-RUN BY DEFAULT (execute=False) until the founder explicitly enables
automated pruning by flipping the lambda to execute=True. Flipping to
execute=True is a FOUNDER DECISION and is gated by C3 cutover preconditions
(core_ohlc_serving_enabled=True + R2 export verified) enforced inside
prune_derived.run — so even a mistaken flip raises before deleting if the
cutover isn't complete. Deleted rows are irreversible.

pg_cron schedule: daily at 03:50 UTC (0004_schedule_prune_derived.sql).
Dead-man 2x = 48h.

## Headers

- `x-internal-secret` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-18** `b7c4b36e1fa1` — 1 warning, 3 info
  - removed the optional property `detail` from the response with the `422` status
  - added the required property `details` to the response with the `422` status
  - added the required property `error` to the response with the `422` status
  - added the required property `message` to the response with the `422` status

[Change history](https://skmtc.dev/goldprice/apis/gold-api/changes/internal/cron/prune-derived/post.md)

---

[API](https://skmtc.dev/goldprice/apis/gold-api.md) · [All operations](https://skmtc.dev/goldprice/apis/gold-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goldprice/gold-api/revisions/5e6518098e6e/schema)
