RESOURCE_NOT_EMPTY
- HTTP status
- 409
- Details payload
{ resourceType: "app" | "environment" | "flag" | "variant" | "organization" | "segment", resourceId: string, childType: string, childCount: number, childCounts?: Record<string, number>, attemptedOp: string, blockers?: Array<{ resourceType, resourceId, childType, children: Array<{ id, removeCommand }> }>, targetingRuleIds?: string[], targetingRules?: Array<{ id, environmentId }> }
Remediation
Remove the children listed in details.blockers, then delete the parent
Cause
A destructive delete was refused because child resources still exist under the target and this delete does not cascade.
Fix
details.blockers lists every current child by ID and the CLI command that removes it (removeCommand, CLI vocabulary). childType summarizes the first group and childCount counts that type. When unlike child types block the operation, childCounts gives each count separately. A Variant delete blocked by Targeting Rules sets childType to flag-targeting-rules and names those rules in details.targetingRuleIds / details.targetingRules (each ID is scoped to an Environment). Remove or retarget those rules, then delete the parent. For App deletes only, apps delete --force can cascade non-gated children (and stop on pending Approvals). The refusal is deliberate: a silent cascade would take down more than the call named.
splitch