API call to enable "Certificate Transparency Monitoring"

Hi all

Does anyone know if it is possible to enable Certificate Transparency Monitoring for a domain via an API call?

I haven’t been able to find anything in the docs

/T

If it isn’t in the docs, then there isn’t an official way.

You can probably try
PATCH https://api.cloudflare.com/client/v4/zones//ct/alerting
JSON body: {“enabled”:true}

Probably need an API token with SSL:Edit. Haven’t tested.

Good idea.

I can get the status:

curl -s -X GET xxxs://api.Cloudflare.com/client/v4/zones/xxx/ct/alerting -H “X-Auth-Email: [email protected]” -H “X-Auth-Key: xxx” |jq
{
“result”: {
“enabled”: true
},
“success”: true,
“errors”: null,
“messages”: null
}

But if I try to change it it fails:
curl -s -X PATCH xxxs://api.Cloudflare.com/client/v4/zones/xxx/ct/alerting -H “X-Auth-Email: [email protected]” -H “X-Auth-Key: xxx” -H “Content-Type: application/json” --data ‘{“enabled”:“false”}’|jq
{
“result”: null,
“success”: false,
“errors”: [
{
“code”: 1000,
“message”: “Error processing request.”
}
],
“messages”: null
}

Any ideas?

Got it!!

Removed the notations around true/false:

curl -s -X PATCH xxxs://api.Cloudflare.com/client/v4/zones/xxx/ct/alerting -H “X-Auth-Email: [email protected]” -H “X-Auth-Key: xxx” -H “Content-Type: application/json” --data ‘{“enabled”:false}’|jq

curl -s -X PATCH xxxs://api.Cloudflare.com/client/v4/zones/xxx/ct/alerting -H “X-Auth-Email: [email protected]” -H “X-Auth-Key: xxx” -H “Content-Type: application/json” --data ‘{“enabled”:true}’|jq

Thanks for the input - it was really helpful :slight_smile: