---
title: "Prune Runs"
method: POST
path: "/api/v1/system/prune/runs"
tags: ["System"]
---

# Prune Runs

`POST /api/v1/system/prune/runs`

Deletes completed runs matching the provided filters, or previews the deletion set when dry-run is enabled.

## Request body

- PruneRunsRequest — Filters for system run pruning.
  - `dry_run` boolean — Preview matching runs without deleting them.
  - `before` string — Include runs started before this YYYY-MM-DD prefix.
  - `workflow` string — Filter by workflow name substring.
  - `labels` object — Label filters applied with AND semantics.
  - `orphans` boolean — Include orphan run directories without run metadata.
  - `older_than` string — Include only runs older than this duration, such as 24h or 7d.

## Response `200`

Prune result

- PruneRunsResponse — Result of a prune preview or deletion.
  - `dry_run` boolean — Whether this response is a dry-run preview.
  - `runs` PruneRunEntry[], nullable — Matched runs when dry-run is enabled.
    - `run_id` string — Run identifier.
    - `dir_name` string — Scratch directory name for the run.
    - `workflow_name` string — Workflow display name.
    - `size_bytes` integer — Bytes used by the run scratch directory.
  - `total_count` integer — Count of runs matching the prune filters.
  - `total_size_bytes` integer — Total bytes of the matching runs.
  - `deleted_count` integer — Number of runs deleted when dry-run is false.
  - `freed_bytes` integer — Estimated freed bytes when deletion occurs.

## Other responses

- `400` — Invalid prune request

---

[API](https://skmtc.net/fabro-sh/apis/fabro-run-api.md) · [All operations](https://skmtc.net/fabro-sh/apis/fabro-run-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fabro-sh/fabro-run-api/revisions/adbc4b711284/schema)
