---
title: "Cleanup Revoked"
method: POST
path: "/admin/cleanup-revoked"
---

# Cleanup Revoked

`POST /admin/cleanup-revoked`

## Request

- Base URL: `https://api.xdogtrading.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xdogtrading.com/admin/cleanup-revoked`
- Auth: none declared

Purge revoked keys and delete tenant docs left with no keys.

Operator housekeeping for the Mission Control subscriber table:
  1. Hard-delete every API-key doc that has ``revoked_at`` set.
  2. Delete any tenant doc that, afterwards, has no remaining keys — UNLESS
     it is protected (``main`` etc.) or still flagged ``is_admin`` (our infra
     agents, which may have no customer-issued key but must never vanish).

Pass ``{"dry_run": true}`` to preview what would be removed without writing.

## Request body

- object, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xdogtrading/apis/xdog-orchestrator.md) · [All operations](https://skmtc.dev/xdogtrading/apis/xdog-orchestrator/llms.txt) · [OpenAPI document](https://skmtc.dev/xdogtrading/apis/xdog-orchestrator/revisions/00593148bd7d?raw)
