Disable Under attack mode

What is the name of the domain?

What is the error number?

NA

What is the error message?

NA

What is the issue you’re encountering

I am able to enable the under attack mode through the API. Can this be set for x amount of hours and automatically disabled after x hours?

While I don’t understand the use case, that’s an interesting idea. I’ve seen requests to auto disable after the attack has subsided in the feature request category, https://community.cloudflare.com/c/feedback/feature-request/30, but not one for a time period. I suspect you could have a worker that would enable and then disable after x period of time.

Thank you for your help.

You suggested using a worker. I found this
https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/update/
However for now it’s not clear for me how to use it. Can you provide an example of “api call after timeout” or “set zone setting after N hours” using a worker?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.