Changes part of an existing DNS record in one of your Cloudflare zones and returns it before and after.
curl -X POST "https://api.primaryapi.com/v1/run/cloudflare.update_dns_record" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"zone":"example.com","recordId":"372e67954025e0ba6aaa6d586b9e0b59","content":"203.0.113.10"}'{
"output": {
"found": true,
"data": {
"zone": "example.com",
"record": {
"name": "www.example.com",
"ttl": 1,
"proxied": true,
"proxiable": true, …
},
"previous": {
"name": "www.example.com",
"ttl": 1,
"proxied": true,
"proxiable": true, …
},
"changed": [
"content"
], …
}
},
"credits": 1
}Input and output
11 fields
example.com.372e67954025e0ba6aaa6d586b9e0b59.data). For example 203.0.113.10.5 fields
Good to know
Changes your account. This call creates, edits or deletes something in the connected account, live. Confirm before running it. With an Idempotency-Key it never runs twice, and monitors can’t schedule it.
Runs as your connected Cloudflare account. Needs the "Manage DNS" permission.
Only the fields you pass change. The rest of the record stays as it is.
This changes the live configuration of your Cloudflare zone right away. There is no undo, no preview.
A call that times out may still have gone through. So read the current state before trying again.
An Idempotency-Key does not protect it. Results of private APIs are never stored, so a repeated key runs the change again.
The same key and credits work for every API.