What's the basic structure of a Cloudflare API request to update a DNS record?

Responsive Ad Header

Question

Grade: Education Subject: Support
What's the basic structure of a Cloudflare API request to update a DNS record?
Asked by:
78 Viewed 78 Answers

Answer (78)

Best Answer
(396)
The API endpoint for updating DNS records is `https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records/{record_id}`. You'll use the `PUT` method. The request body should be a JSON object containing the fields you want to update, such as `type`, `name`, `content`, `ttl`, and `proxied`. For example: `{"type":"A","name":"www.example.com","content":"192.0.2.1","ttl":120,"proxied":true}`.