Delete rule
Deletes a company automation rule. Accepts no request body, including an empty JSON object. Requires Accounting setup: Manage, Transactions: Manage and API access: Manage on every request, including retries for absent IDs. Permission checks precede body and ID validation, so callers missing Transactions: Manage receive 403 even for malformed IDs or requests with a body. Successful deletion and already-absent rules return 204 with no body. Foreign-company, global, internal/system, owner-specific and mixed-owner records are indistinguishable from absence and are not changed. Malformed rule_ IDs return 400 invalid_request. Transactions directly linked through rule_id can have their categories reset to defaults; matched transfer legs keep their categories and are detached from the rule. This is not a general undo of every rule action and does not promise that historical transactions remain unchanged. Retries after success do not repeat these effects. No Idempotency-Key is required. Queued API historical application is cancelled atomically with deletion. Already-running work returns retryable 503 rule_busy without changes; retry with exponential backoff. Legacy unassociated UI jobs do not gain these cancellation guarantees. Missing-resource associated jobs safely cancel without recreating the rule. Deletion does not validate or serialize the stored definition, so stale references or definitions not representable by the API do not prevent deletion. A failed deletion rolls back category changes, rule deletion and history cancellation and returns 500 api_error with code rule_deletion_failed, never 204. Unexpected server errors use existing server handling. Retry failed or interrupted requests with exponential backoff; seek operator help for persistent failures. No new history, migration, backfill, feature flag or public job API is added.