Proxied=false invalid

Batch add domain names ("{name ": \ "$domain ", \ "proxied ": false}) through cloudflare API, where proxied is set to false. After adding successfully, the proxy is opened and invalid. I want to close it

What API call are you using? The API call to add a domain does not support proxied as an option, to my knowledge:

https://api.cloudflare.com/#zone-create-zone

It is however an option when creating a DNS record within a zone:

https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record

OK, when I create a record, the return record does not exist. But I’ve added the domain name.

curl -X PUT “https://api.cloudflare.com/client/v4/zones/aaaaaaaaaaaaa/dns_records/bbbbbbbbbbbbb
-H “X-Auth-Email: [email protected]
-H “X-Auth-Key: aaaaaaaaaaaaaaaaaaa”
-H “Content-Type: application/json”
–data ‘{“type”:“A”,“name”:“jyyxx.com”,“content”:“23.226.148.12”,“ttl”:120,“proxied”:false}’

{“result”:null,“success”:false,“errors”:[{“code”:81044,“message”:“Record does not exist.”}],“messages”:}

PUT is for updating existing DNS records. You need to create the record first, which is done with POST as per the example I linked to:

https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record

Thank you very much, thank you.

1 Like

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