---
title: "Cleanup Orphaned Invoice Rules"
method: POST
path: "/api/v1/budget_rules/cleanup-orphaned-invoice-rules"
---

# Cleanup Orphaned Invoice Rules

`POST /api/v1/budget_rules/cleanup-orphaned-invoice-rules`

Clean up orphaned invoice rules that are not referenced by any budget_rules_groups.

This is a maintenance endpoint that removes invoice rules that may have been 
left behind due to incomplete updates or system issues.

Returns the number of orphaned rules that were cleaned up.

## Query parameters

- `plan_manager_id` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/caresquare/apis/fastapi.md) · [All operations](https://skmtc.dev/caresquare/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/caresquare/fastapi/revisions/c9df874d8d59/schema)
