Permanently deletes one DNS record from one of your Cloudflare zones and returns what was deleted.
curl -X POST "https://api.primaryapi.com/v1/run/cloudflare.delete_dns_record" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"zone":"example.com","recordId":"372e67954025e0ba6aaa6d586b9e0b59","name":"www","type":"A"}'{
"output": {
"found": true,
"data": {
"deleted": true,
"zone": "example.com",
"record": {
"name": "www.example.com",
"ttl": 1,
"proxied": true,
"proxiable": true, …
},
"zoneId": "023e105f4ecef8ad9ca31a8372d0c353"
}
},
"credits": 1
}Input and output
5 fields
example.com.372e67954025e0ba6aaa6d586b9e0b59.www.A.4 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.
Deleting a record can take a site, email or verification offline.
Pass `name` (and `type`) as a safety check. When they do not match the record, nothing is deleted and the call answers found: false with reason record_mismatch. A miss is an answer, not an error.
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.
The same key and credits work for every API.