---
title: "Record Maintenance Run"
method: POST
path: "/api/system/maintenance-runs"
tags: ["system"]
---

# Record Maintenance Run

`POST /api/system/maintenance-runs`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/system/maintenance-runs`
- Auth: none declared

Record that one maintenance routine ran (kind `maintenance.routine_ran`, business_events ledger).

Gated on `system:maintenance_runs:write`, held only by `maintenance-runner@pigeon.ly` (`service_keys.
MAINTENANCE_RUNNER`, the owner's "Yes" of 2026-11-15, FINISH_LEDGER D-23). The event is
written in its own transaction here; it is observability, so the job never waits on it for its own work.

## Request body

- RecordMaintenanceRunRequest: One attempt of a nightly maintenance routine, posted by the Node B job after the attempt ends. Whose rule: the owner's "5 cleanup routines run nightly" (order a0fdfc1a-8b9d-4e68-95e2-2e630f69d5a0), decided as a business event by the lead under the owner's 2026-11-11 delegation. The body is a closed vocabulary on purpose: the production check counts distinct routines, so a free-text name would silently pass or fail it.
  - `routine` 'dead_code' | 'finished_experiments' | 'missing_tests' | 'useless_tests' | 'abstraction_police', required
  - `result` 'no_change' | 'proposed' | 'review_fail' | 'gate_fail' | 'refused', required
  - `night` string, date, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-14** `7219f6b1f909`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/changes/api/system/maintenance-runs/post.md)

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
