Cloudflare API to delete sites?


#1

I found this: https://support.cloudflare.com/hc/en-us/articles/360000841472-Adding-Multiple-Sites-to-Cloudflare-via-Automation

It works perfectly to add a domain to Cloudflare.

But I thought reversing it with a DELETE command would do remove a domain from Cloudflare.

What I get, however is this:

{“success”:false,“errors”:[{“code”:7001,“message”:“Method DELETE not available for that URI.”}],“messages”:[],“result”:null}

I have searched but found nothing on deleting a domain (removing the website) from Cloudflare completely.

Any ideas?


#2

API sure makes it seem like it should work:
https://api.cloudflare.com/#zone-delete-zone

Open a Support Ticket: support AT cloudflare DOT com
or https://support.cloudflare.com/hc/en-us/requests


#3

Figured this out.

DELETE A ZONE

curl -X DELETE “https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353
-H “X-Auth-Email: [email protected]
-H “X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41”
-H “Content-Type: application/json”