---
title: "Purge old ledger entries."
method: DELETE
path: "/api/ledger"
tags: ["Redaction Ledger"]
---

# Purge old ledger entries.

`DELETE /api/ledger`

Deletes ledger entries older than the given number of days. The ledger is kept indefinitely by default, so this is how stale entries are pruned on demand. Requires an administrator and LEDGER_DELETION_ENABLED=true. Admins may purge another user's entries by passing that user's username as owner, which additionally requires ADMIN_CROSS_USER_ACCESS_ENABLED=true. Requires the `ledger:delete` scope.

## Query parameters

- `older_than_days` integer, required
- `owner` string

## Headers

- `Authorization` string, required

## Response `200`

The matching entries were purged.

## Other responses

- `400` — older_than_days is missing or negative.
- `401` — The Authorization header is absent or the API key is not recognized.
- `403` — The caller is not an administrator, or ledger deletion is disabled for this deployment.
- `404` — Not Found
- `413` — Content Too Large
- `415` — Unsupported Media Type
- `423` — One or more active legal holds protect entries in this user's ledger. Release all holds before purging.
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/philterd/apis/philter-api.md) · [All operations](https://skmtc.net/philterd/apis/philter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/philterd/philter-api/versions/67443cd5a65b/schema)
