---
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`

## Request

- Base URL: `https://api.caresquare.com.au` (the document declares no server; this is the origin it was published from)
- URL: `https://api.caresquare.com.au/api/v1/budget_rules/cleanup-orphaned-invoice-rules`
- Auth: none declared

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/caresquare-api.md) - [All operations](https://skmtc.dev/caresquare/apis/caresquare-api/llms.txt) - [OpenAPI document](https://skmtc.dev/caresquare/apis/caresquare-api/revisions/d428fe38bf62?raw)
