# CT # Alerting ## Get CT Alerting Subscription `client.Zones.CT.Alerting.Get(ctx, query) (*CTAlertingGetResponse, error)` **get** `/zones/{zone_id}/ct/alerting` Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and, for Business and Enterprise zones, the list of email addresses that receive alerts. ### Parameters - `query CTAlertingGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type CTAlertingGetResponse struct{…}` Certificate Transparency alerting subscription settings for a zone. - `Enabled bool` Whether CT alerting is enabled for the zone. - `Emails []string` Email addresses that receive CT alert notifications. Only present and configurable for Business and Enterprise zones. Maximum of 10 addresses. For Free and Pro zones, notifications are sent to all users with SSL permissions on the zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zones" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) alerting, err := client.Zones.CT.Alerting.Get(context.TODO(), zones.CTAlertingGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", alerting.Enabled) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "enabled": true, "emails": [ "security@example.com", "admin@example.com" ] } } ``` ## Update CT Alerting Subscription `client.Zones.CT.Alerting.Edit(ctx, params) (*CTAlertingEditResponse, error)` **patch** `/zones/{zone_id}/ct/alerting` Create or update the Certificate Transparency alerting subscription for a zone. Enables or disables email notifications when certificates are issued for the zone's domains. For Free and Pro zones, the subscription is toggled on or off using the enabled field. Notification emails are sent to all users with SSL permissions on the zone. For Business and Enterprise zones, the emails field is required and controls which addresses receive alerts. Setting emails to an empty list disables the subscription regardless of the enabled field. A maximum of 10 email addresses may be configured. ### Parameters - `params CTAlertingEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Enabled param.Field[bool]` Body param: Whether CT alerting is enabled for the zone. - `Emails param.Field[[]string]` Body param: Email addresses that receive CT alert notifications. Only present and configurable for Business and Enterprise zones. Maximum of 10 addresses. For Free and Pro zones, notifications are sent to all users with SSL permissions on the zone. ### Returns - `type CTAlertingEditResponse struct{…}` Certificate Transparency alerting subscription settings for a zone. - `Enabled bool` Whether CT alerting is enabled for the zone. - `Emails []string` Email addresses that receive CT alert notifications. Only present and configurable for Business and Enterprise zones. Maximum of 10 addresses. For Free and Pro zones, notifications are sent to all users with SSL permissions on the zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zones" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Zones.CT.Alerting.Edit(context.TODO(), zones.CTAlertingEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Enabled: cloudflare.F(true), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Enabled) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "enabled": true, "emails": [ "security@example.com", "admin@example.com" ] } } ```