Resource Deletion: API DELETE Requests, Dashboard Removal, and Dependency Limits
How Cloudflare documents removing policies, routes, DNS records, and other resources via the dashboard or REST API DELETE, including confirmations and blockers.
This page summarises Cloudflare documentation on deleting or removing configured resources: firewall and Access policies, Magic WAN routes, DNS records, certificates, AI Gateway objects, and account-level assets. The same ideas appear across products—pick the resource in the dashboard or call the matching DELETE endpoint with an API token that has the right scope.
Dashboard deletion: how to remove a policy or configuration item
Section titled “Dashboard deletion: how to remove a policy or configuration item”Most Cloudflare products expose deletion from a list or detail view: find the row, open the action menu (often three dots), choose Delete or Remove, then confirm in a modal. Wording varies (Delete, Remove, Delete selected) but the pattern is locate → action → second confirmation.
For reusable firewall-style policies, the docs give a representative flow:
Locate the policy you want to delete in the list.
From the end of the row, select Delete.
Select Delete again to confirm the deletion.
— Cloudflare, Add custom policies
Cloudflare One packet-filtering policies follow the same steps in Add policies. Rate limiting policies use Remove from the three-dot menu instead of Delete (Create Rate Limiting policies). Legacy firewall rules use an X icon and a confirmation dialog (Create, edit, and delete rules).
Bulk delete: multiple policies or DNS records at once
Section titled “Bulk delete: multiple policies or DNS records at once”Email Security and similar UIs support deleting several items in one action. For allow policies:
On the Allow policies page, select the allow policies you want to delete.
Select Action.
Select Delete.
— Cloudflare, Allow policies
The same Action → Delete pattern appears for blocked content policies, blocked senders, and trusted domains.
DNS bulk deletion adds a typed confirmation because mistakes cause outage:
Caution
Deleting DNS records can cause downtime and cannot be reverted. Make sure you only select DNS records that you can safely delete.
Select the DNS records you want to delete.
Select Delete records.
In the Delete DNS records prompt, type in DELETE and select Delete to confirm.
— Cloudflare, Batch record changes
Single-record deletion from Manage DNS records uses Edit → Delete → Delete again on one row instead of bulk select.
REST API DELETE: remove resources with curl and token permissions
Section titled “REST API DELETE: remove resources with curl and token permissions”Automation and infrastructure-as-code use HTTP DELETE on the Cloudflare API with Authorization: Bearer $CLOUDFLARE_API_TOKEN (or legacy X-Auth-Email / X-Auth-Key on some account endpoints). Cloudflare’s style guide treats DELETE as a body-less request:
curl –request DELETE \
{full_url_with_placeholders}\
–header “Authorization: Bearer $CLOUDFLARE_API_TOKEN”
— Cloudflare, Guidelines for cURL commands
A successful delete often returns "success": true and a null or minimal result, as in firewall rule deletion (DELETE examples) or schema validation (API configuration).
Zone-level vs account-level DELETE paths
Section titled “Zone-level vs account-level DELETE paths”| Scope | Example resource | Method and path pattern (from docs) |
|---|---|---|
| Zone | Firewall rule | DELETE /zones/{zone_id}/firewall/rules/{rule_id} — DELETE examples |
| Zone | API Gateway schema | DELETE /zones/$ZONE_ID/schema_validation/schemas/$SCHEMA_ID — API configuration |
| Zone | Waiting room | DELETE /zones/$ZONE_ID/waiting_rooms/$WAITING_ROOM_ID — Edit and delete waiting rooms |
| Account | Magic static route | DELETE /accounts/$ACCOUNT_ID/magic/routes/$ROUTE_ID — Configure routes |
| Account | Programmable flow program | DELETE .../magic/programmable_flow_protection/configs/programs/{program_id} — Common API calls |
| Account | AI Gateway custom provider | DELETE /accounts/$ACCOUNT_ID/ai-gateway/custom-providers/{provider_id} — Custom Providers |
| Account | Entire account | DELETE /accounts/{account_id} — Manage accounts |
Each doc page lists required API token permissions (for example Zone WAF Write, Magic WAN Write, Account API Gateway). Without them, DELETE fails before the resource logic runs.
Magic WAN and Magic Transit routes: dashboard checkbox plus API
Section titled “Magic WAN and Magic Transit routes: dashboard checkbox plus API”Static route removal is documented in several route guides (Magic Transit, Cloudflare WAN, learning paths). Dashboard steps:
From the Routes tab, locate the static route to delete.
Select the three dots next to it > Delete.
Confirm the action by selecting the checkbox and select Delete.
— Cloudflare, Configure routes
The API counterpart uses DELETE on /accounts/$ACCOUNT_ID/magic/routes/$ROUTE_ID with Magic WAN Write or Magic Transit Write, as shown in the same Configure routes pages.
When delete is blocked: dependencies, status, and references
Section titled “When delete is blocked: dependencies, status, and references”Documentation repeatedly states that deletion is refused while another object still depends on the resource.
Custom applications (Cloudflare One) cannot be deleted while a Gateway rule or reusable profile still references them; disabling a rule does not clear the reference:
You cannot delete a custom application while a Gateway rule or reusable profile references it. Remove the application from every referencing rule and profile before deleting it. Turning off a rule does not remove its reference.
— Cloudflare, Custom applications
If references remain, deletion fails with HTTP 409 and identifying metadata for the blocking resources.
Load Balancing pools cannot be removed while load balancers, geo steering, pool sets, or fallback pools still use them (Manage pools). Programmable Flow Protection programs cannot be deleted when an active rule references them (Common API calls; Programmable Flow Protection (Beta)).
Certificate signing requests (CSRs) are deletable only if no custom certificate still uses the CSR’s private key (Certificate signing requests (CSRs)).
Magic Transit IP prefixes may be deleted from the dashboard only when status is Unapproved; other statuses require administrator or account manager action (Advertise prefixes).
Zaraz variables cannot be deleted while tools or triggers still reference them; you must remove the variable from those objects first (Edit variables).
Virtual networks require no routes assigned (or routes reassigned) before delete (Virtual networks).
Version Management does not allow deleting the Production environment (Manage environments).
Reusable Access policies
Section titled “Reusable Access policies”Before deleting a reusable Access policy, remove it from every application that uses it:
If the policy is used by an application, remove the policy from all associated applications.
— Cloudflare, Manage Access policies
High-impact and irreversible deletions
Section titled “High-impact and irreversible deletions”Some deletes permanently change traffic, credentials, or data with no undo in the UI.
| Resource | Documented impact |
|---|---|
| DNS records (bulk) | Downtime risk; cannot be reverted — Batch record changes |
| Email routing rule | Pattern no longer routes; use disable instead of delete if temporary — Email routing rules and addresses |
| Secrets Store secret | Must not be deployed in Workers or AI gateways — How to |
| Log Explorer dataset | Irreversible; async deletion; cannot recreate same name while delete in progress — Manage datasets |
| AI Gateway / custom provider | Stops routed requests immediately; update apps first — Manage gateways, Custom Providers |
| Web3 gateway | Removes associated hostname DNS records — Manage gateways |
| Account | Permanent; zones and resources under account removed; some items need manual pre-delete — Manage accounts |
Account deletion explicitly calls out resources that are not automatically removed:
Logpush jobs: Will continue delivering logs after account deletion.
Zero Trust Gateway configurations: May continue resolving DNS queries after account deletion.
— Cloudflare, Manage accounts
The same page documents sequential DELETE calls for Gateway configuration and Access organization before deleting the account.
Cloudflare Pages projects with a custom domain should have the related CNAME removed first to avoid stale DNS pointing at a deleted project (Git integration).
Deleting a custom finding type stops future evaluations and removes associated finding instances, which cannot be undone (Custom finding types).
API Shield, WAF, and security objects
Section titled “API Shield, WAF, and security objects”Sequence mitigation rules are removed with DELETE and a rule ID (Configure sequence mitigation via the API). Content Scanning custom expressions use zone DELETE on content-upload-scan/payloads/$EXPRESSION_ID (Common API calls).
Custom rulesets are deleted from Security rules or WAF → Custom rulesets (Custom rulesets (zone level), Work with custom rulesets in the dashboard). Managed ruleset deployment exceptions use Delete from the deployed ruleset row (Deploy a WAF managed ruleset in the dashboard (account)).
Deleting API Shield operations (manual or bulk) stops performance and analytics tracking for that operation; historical metrics are not restored if traffic is matched again later (Endpoint Management, Manage operations).
Common mistakes when deleting Cloudflare resources
Section titled “Common mistakes when deleting Cloudflare resources”- Deleting DNS or email routing rules without checking what still resolves or delivers mail.
- Assuming turning off a Gateway rule removes a custom application reference (it does not).
- Running account
DELETEwhile Logpush or Zero Trust Gateway config still runs. - Deleting Secrets Store entries still bound to Workers or AI Gateway.
- Removing Pages custom domains without cleaning DNS first.
- Using the API without the token permission named on the product’s delete section (symptom: authorization error, not “in use”).
- Deleting pools or programs still referenced by load balancers or PFP rules without reading the error’s hostname or reference list.
How to check this on your site
Section titled “How to check this on your site”- In the Cloudflare dashboard, open the product doc page for your resource (for example Manage DNS records or Configure routes) and verify the object no longer appears in the list after delete.
- For API deletes, re-run a read/list call or refresh the dashboard and confirm
"success": truein the response matches the shape in the linked DELETE example for that product. - After policy or application deletes, check dependent UIs (Access applications, load balancers, Gateway rules) so nothing still references the removed ID.
- For DNS or routing changes, validate resolution and traffic paths from your origin or monitoring tools once propagation completes.
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.