---
title: "Purge files past the retention window"
method: POST
path: "/v1/workspaces/{workspace}/usage/purge-expired"
tags: ["Maintenance"]
---

# Purge files past the retention window

`POST /v1/workspaces/{workspace}/usage/purge-expired`

## Request

- Base URL: `https://api.uploads.sh`
- URL: `https://api.uploads.sh/v1/workspaces/{workspace}/usage/purge-expired`
- Auth: HTTP bearer

Destructive: permanently deletes objects older than the workspace's `retentionDays`, then reconciles usage. Requires a bearer token with `files:delete`; browser sessions are not accepted. The response is either `{ skipped: true }` or a purge and reconciliation result.

## Response `200`

Purge result or a skipped result.

## Other responses

- `401`: Missing or invalid credential.
- `403`: The credential lacks the required scope or role.

---

[API](https://skmtc.dev/uploads/apis/uploads-sh-api.md) · [All operations](https://skmtc.dev/uploads/apis/uploads-sh-api/llms.txt) · [OpenAPI document](https://skmtc.dev/uploads/apis/uploads-sh-api/revisions/6df242babacd?raw)
