Error 1014 Invalid zone type for action

Hi there, I have written a script that should be able to update the DNSSEC records for 92 Domains that I manage. However I am getting error 1014 Invalid zone type for action. Here is my code that I’m using. I checked the documentation for what permissions are required with the API key but that isn’t listed. I have confirmed my code looks good when compared to the docs. Anyone have any ideas why I cannot enable DNSSEC through the API?

    enable_dnssec_response=$(curl -s -X PATCH "https://api.cloudflare.com/client/v4/$zones/zone_identifier/dnssec" \
        -H "Authorization: Bearer $API_KEY" \
        -H "Content-Type: application/json" \
        --data '{
            "dnssec_multi_signer": false,
            "dnssec_presigned": true,
            "status": "active"
        }')

https://developers.cloudflare.com/api/operations/dnssec-edit-dnssec-status
image

I’m not sure what you’re doing here. You need to replace zone_identifier, not zones.

sorry thats a typeo - ignore that $ should be at $zone_identifier, i’ll update

Bugger cannot update. The full url I’m trying to use is

    enable_dnssec_response=$(curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dnssec" \
        -H "Authorization: Bearer $API_KEY" \
        -H "Content-Type: application/json" \
        --data '{
            "dnssec_multi_signer": false,
            "dnssec_presigned": true,
            "status": "active"
        }')

Do you have some sort of special DNS setup for your zone(s)? dnssec_multi_signer and dnssec_presigned are not common, and are probably why you’re getting that message.

thanks - that will teach me for using the example provided, removed those two options and the script is working

1 Like

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