---
title: "Cleanup Orphan Missing Events"
method: POST
path: "/v1/projects/{project_id}/missing-keys/cleanup-orphans"
tags: ["missing"]
---

# Cleanup Orphan Missing Events

`POST /v1/projects/{project_id}/missing-keys/cleanup-orphans`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/projects/{project_id}/missing-keys/cleanup-orphans`
- Auth: none declared

Resolve every open missing-event whose key already exists.

Designed as a one-shot purge for projects that accumulated phantom
events before the auto-resolve-on-create cascade was wired into every
creation path. Idempotent — running it again just returns 0 orphans.

## Path parameters

- `project_id` string, required

## Response `200`

Successful Response

- CleanupOrphansOut
  - `project_uuid` string, required
  - `scanned` integer, required
  - `resolved_orphans` integer, required
  - `still_open` integer, required

## Other responses

- `422`: Validation Error

---

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