How to make IPV6 with api call?


Hi to community

Hope I will find a newbie explanation about the disabling ipv6 via api.

As I see I can’t disable the IPV6 via dashboard, I need to make an API call. but honestly I dont know how to do it.

The doc is here :

Is there anybody here explain me how to do it?




This is the API for ipv6 on/off

That long curl command is how you do it from command line. Just be sure to change the funky number strings to your Zone ID and API key, plus your Cloudflare email address. Your Zone ID is on your Cloudflare Overview page.



Thanks for your help. I know this page. However I am not a coder and my friend who know php dont understand how to do it.

how to do this?

From my server console ( ubuntu )?

or a php file in my server.

Honestly I need a sample code which I can change zone id, api key…etc and upload to my server.

Hope you guys have time to send me a sample code and teach me how to use it myself as a non-techie guy like me

Thanks in advance.


I believe this should do it:

curl -X PATCH “
-H “X-Auth-Email: [email protected]
-H “X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41”
-H “Content-Type: application/json”
–data ‘{“value”:“off”}’


This should get your zone ID if you need it.

curl -X GET “
-H “X-Auth-Email: [email protected]
-H “X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41”
-H “Content-Type: application/json”


Thanks mate. I am not a coder. Can you explain what to do with this beautiful code? :slightly_frowning_face:

Where to type this and get the response?



I have below info:

Zone id
Api key
Email address


Curl is a command line utility. If you have a mac you can probably do it straight from the terminal. On a linux machine you can run it fro the command line.

In the second instance replace with the domain you want to change and replace email and auth-key with your values it should return a response in the terminal with the zoneID for your zone.

In the first example replace 023e105f4ecef8ad9ca31a8372d0c353 with your zone ID and again replace the email and auth-key values with your own.

A tutorial on curl that might help (or hurt… it was clearly written by a geek).

  1. I have my zone id which I copied from my domain dashboard in cloudflare. Do I need to do the zone id step you did?

  2. For mac, in the terminal, is it ok just copy the code above and paste and enter right after the terminal window open?

3 Or I need to do above steps in my server console ( ubuntu )?



If you have your zone ID you don’t need to look it up again (unless you just want to practice your newfound curl skills). You should be able to copy/ paste the code from the first example right into the terminal window and hit enter. Steps can be run from any machine… it’s changing a Cloudflare setting (no changes to the origin).


so which fields I need to change with mine?
I have:




Mate ,

I tried this

curl -X PATCH “”
-H “X-Auth-Email: MYEMAIL”
-H “X-Auth-Key: MYAPIKEY”
-H “Content-Type: application/json”
–data ‘{“value”:“off”}’

Used terminal and directly pasted and hit enter. It says - curl: (1) Protocol ““https” not supported or disabled in libcurl


ugh… nothing is ever easy right? :wink:

I haven’t encountered this exact error before but take a look at this article:


Hey mate,

The problem is not https protocol, but the first code you shared above. Actually code is the same as in the api doc but when I copy it, there was a " 1 " right after the api link. so it is like

curl -X PATCH “”

but it should:

curl -X PATCH “”

Now it is working fine. I changed the ipv6 from on to off!!

Thanks a lot again mate