Cloudflare API to delete sites?

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?

API sure makes it seem like it should work:

Open a Support Ticket: Login & go to https://dash.cloudflare.com/?account=support

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”

1 Like