How to get zone id for all domains

i am trying to automate DNS update using api.
1st thing that i need to do is to get the list of zone id’s, how can we get all those id’s using curl or any other commands, or can i get that info. from Cloudflare dashboard?

Thank you for providing that that link, i am not sure where i’ll find the information to get the id’s for multiple zones.
examples says to run the command with zone id’s. after doing a quick search, some users says to use the string as id(,
when i use that string getting this error:
[{“code”:1000,“message”:“Invalid zone identifier”}

so i am sure i am missing something here.
Thank you,

Well, the parameters are all optional. Dont provide any and you get all zones.

1 Like

Try something like this:

curl -s -X GET "" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name)"'

Replace auth_email and auth_key with your own values. You will need jq in your path.

1 Like

This topic was automatically closed after 31 days. New replies are no longer allowed.