API - Cloudflare


# Get the list of records and export results to file called records. ie. Postman
# Run Grep on records file exporting as records_id:
# grep '"id":\|"name":' records  | grep -B1 \"....x.x.x | grep -v '\-\-' | sed s/" "//g | sed s/,//g  | grep id | sed s/\"id\"\:\"//g  | sed s/\"//g > records_id
# The iteration below deletes all records found in records_id:

while read p; do
    curl -X DELETE "https://api.cloudflare.com/client/v4/zones/x/dns_records/$p" \
        -H "X-Auth-Email: [email protected]" \
        -H "X-Auth-Key: x" \
        -H "Content-Type: application/json" &
done <page2_idw