Skip to content
Start here

Update CT Alerting Subscription

client.zones.ct.alerting.edit(AlertingEditParams { zone_id, enabled, emails } params, RequestOptionsoptions?): CTAlertingSubscription { enabled, emails }
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. The enabled field is required on every request and controls whether the subscription is active. The emails field is optional and, when provided, replaces the stored recipient list for the zone. When emails is omitted, the stored recipient list is preserved and only the enabled state is toggled. A maximum of 100 email addresses may be configured per zone. Requests that omit enabled are rejected with error code 1008. Subscribe and unsubscribe notification emails are only sent for recipients whose effective subscription state changes. Idempotent requests (no state change) send no notification email.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
SSL and Certificates Write
ParametersExpand Collapse
params: AlertingEditParams { zone_id, enabled, emails }
zone_id: string

Path param: Identifier.

maxLength32
enabled: boolean

Body param: Whether CT alerting is enabled for the zone.

emails?: Array<string>

Body param: Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.

ReturnsExpand Collapse
CTAlertingSubscription { enabled, emails }

Certificate Transparency alerting subscription settings for a zone.

enabled: boolean

Whether CT alerting is enabled for the zone.

emails?: Array<string>

Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.

Update CT Alerting Subscription

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const ctAlertingSubscription = await client.zones.ct.alerting.edit({
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
  enabled: true,
});

console.log(ctAlertingSubscription.enabled);
{
  "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"
    ]
  }
}
Returns Examples
{
  "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"
    ]
  }
}