Skip to main content
Alert channels let you get alert notifications when a check or monitor fails. Learn more about alerting in our docs.

Common properties

All alert channels share a set of common properties to define when / how they should alert derived from the abstract class AlertChannel. Configure common alert channel properties:
PropertyTypeRequiredDefaultDescription
sendRecoverybooleantrueSend notifications when checks recover
sendFailurebooleantrueSend notifications when checks fail
sendDegradedbooleanfalseSend notifications when checks degrade
sslExpirybooleanfalseSend notifications for SSL certificate expiry
sslExpiryThresholdnumber30Days before SSL expiry to send notification
Alert channels are assigned to checks, monitors, and groups by instantiating a class and adding the resulting object to the alertChannels array. To assign alert channels to CheckGroupV2 constructs, you’ll also need to set the alertEscalationPolicy to enable the group alerting override.

Using fromId() to reference an existing channel

You can reference an existing alert channel in your Checkly account using the fromId() method on any AlertChannel class. When your CLI project is responsible for creating and managing alert channels, it integrates seamlessly with Checkly’s deployment control mechanisms. This ensures that any changes made are thoroughly validated. For users with multiple Checkly CLI projects:
  • Alert channels can be set up through the Checkly UI or any other method, ensuring they remain intact and unaffected by individual CLI project operations.
For users managing a single Checkly CLI project:
  • The entire process of creating and subscribing to alert channels can be handled within that single project. This is made possible because the project references the logical ID of the alert channel, rather than an ID generated post-deployment.
If you attempt to deploy a project that references alert channels which have been removed or are no longer valid, the deployment process will not proceed. This feature helps maintain the integrity and reliability of your monitoring and alerting setup.
export const emailChannel = EmailAlertChannel.fromId(20)
You can obtain the ID for your alert channel either from the Checkly web UI or by utilizing our REST API. email channel id