PurgeBudgetPolicy
POST/v1/customers/:customer_id/projects/:project_id/policy/budget-policies/:id/purge
PurgeBudgetPolicy permanently removes an INACTIVE budget policy. DeleteBudgetPolicy only deactivates (budget_policies has no deleted_at column), so without this RPC an API-only operator could never remove a row. The policy must already be inactive -- deactivate it first through SetBudgetPolicyStatus or DeleteBudgetPolicy -- and that check is part of the delete statement itself, so a policy reactivated concurrently is left in place rather than destroyed.
A caller without the admin scope may purge only PROJECT- and API_KEY-scoped policies within the request project. After request authorization, unknown policies and targets outside this allow-list both return NOT_FOUND. An active policy returns FAILED_PRECONDITION only if the caller is authorized to purge it. Alert history survives the purge with BudgetAlert.policy_id cleared (budget_alerts.policy_id is ON DELETE SET NULL), so ListBudgetAlerts can no longer find those alerts by policy_id.
Request
Responses
- 200
Success