Skip to main content

Documentation Index

Fetch the complete documentation index at: https://checklyhq.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

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:
api-health.check.ts
import { ApiCheck, EmailAlertChannel } from 'checkly/constructs'

// Create a new alert channel
const emailChannel = new EmailAlertChannel('email-channel-1', {
  address: 'alerts@example.com',
})

// Create a new API check
new ApiCheck('api-health-check', {
  name: 'API Health',
  request: {
    method: 'GET',
    url: 'https://api.example.com',
  },
  alertChannels: [emailChannel], // Assign our email alert channel to this API check
})
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

If you have an existing alert channel that was created outside of your CLI project, you can reference it using the fromId() method on any AlertChannel class:
export const emailChannel = EmailAlertChannel.fromId(20)
Find the alert channel ID in the the Checkly web UI or via our our REST API. email channel id
If your fromId() references an invalid alert channel, the CLI will throw an error when you try to deploy your project.
This is useful if you have multiple CLI projects, since you can reference the same alert channel in each project without needing to redefine it each time. If you have a single CLI project, instead of using fromId(), we recommend defining your alert channel within that CLI project and referencing its JS/TS object. This allows your alert channel to be managed as code alongside your other CLI resources, which makes it easier to manage and scale your alerting setup.