How do I pause and start again cloudflare through the API?


#1

Some time ago I asked how to pause and start again cloudflare through the API, got this response, which told me how to pause it, but not how to start it again.

Can somebody please tell me how to start cloudflare again through the API?

Thanks


#2

The “pause website” setting can be changed through the Edit Zone endpoint. Set the paused parameter to true to pause it, false if you want to resume it. This has the same effect of clicking the “pause website” button on the Cloudflare dashboard.


#3

Oh, I think I found a bug.

In the response I was given by your team here it was said that to pause I had to do this:

curl -X PATCH "https://api.cloudflare.com/client/v4/zones/0000ZONEID0000" \
       -H "X-Auth-Email: [email protected]" \
       -H "X-Auth-Key: 0000APIKEY0000" \
       -H "Content-Type: application/json" \
       --data '{"paused":"true"}'

Which in fact paused cloudflare, however, when trying to put it to “false”, I was getting an error, that’s why I asked this question. The actual value, as seen in the documentation, is true or false, whithout the “”.

The bug that I found is that whatever string you put in the API, it will pause cloudflare. For example, now to pause my system I can do:

curl -X PATCH "https://api.cloudflare.com/client/v4/zones/0000ZONEID0000" \
       -H "X-Auth-Email: [email protected]" \
       -H "X-Auth-Key: 0000APIKEY0000" \
       -H "Content-Type: application/json" \
       --data '{"paused":"YOU SHALL NOT PASS!!!!"}'

and it pauses cloudflare :slight_smile: