# Alert Channels

- Alert channels are used to send notifications when checks and monitors fail or recover.
- Alert channels are added to checks, monitors, and check groups constructs by adding them to the `alertChannels` array property.

Here are some examples of how to create different types of alert channels.

All available alerts are described in the [Checkly docs](https://www.checklyhq.com/docs/constructs/overview/).

*Important*: Don't make up email addresses, phone numbers, Slack channel names or similar static values. Scan the project to discover a valid configuration or ask what the values should be.

For new Slack notifications, prefer `SlackAppAlertChannel`. It uses the Checkly Slack App and only needs Slack `#channel` names, channel IDs (such as `C0123456789`) or `@user` handles in `slackChannels`. It needs the Checkly Slack App connected to the Checkly account: without it, `npx checkly validate`, `test` and `deploy` fail with "Checkly Slack app not connected". If you can't confirm the app is connected, ask before adding one.

Some alert channels need an integration that not every Checkly plan includes, such as PagerDuty, Opsgenie, SMS, phone calls or some webhook integrations. For a channel whose integration the account's plan doesn't include, `npx checkly validate`, `test` and `deploy` fail with "Integration not included in your plan". If that happens, ask whether to upgrade the plan or remove the channel instead of working around it.

## Email Alert Channel

**Reference:** https://www.checklyhq.com/docs/constructs/email-alert-channel/

```typescript
import { EmailAlertChannel } from 'checkly/constructs'

export const testEmailAlert = new EmailAlertChannel('example-email-alert-channel', {
  address: 'test@example.com',
  sslExpiry: true,
})
```

## Phone Call Alert Channel

**Reference:** https://www.checklyhq.com/docs/constructs/phone-call-alert-channel/

```typescript
import { PhoneCallAlertChannel } from 'checkly/constructs'

export const testUserPhoneCallAlert = new PhoneCallAlertChannel('example-call-alert-channel', {
  name: 'Test User',
  phoneNumber: 'INSERT_PHONE_NUMBER',
})
```

## Slack App Alert Channel

**Reference:** https://www.checklyhq.com/docs/constructs/slack-app-alert-channel/

```typescript
import { SlackAppAlertChannel } from 'checkly/constructs'

export const alertsOpsAliceSlackAppAlert = new SlackAppAlertChannel('example-slack-app-alert-channel', {
  slackChannels: [
    '#alerts',
    '#ops',
    '@alice',
  ],
})
```

## Telegram Alert Channel

Sends alerts to a Telegram chat via a bot. Use the optional `messageThreadId` property to post into a specific forum topic within a Telegram group.

**Reference:** https://www.checklyhq.com/docs/constructs/telegram-alert-channel/

```typescript
import { TelegramAlertChannel } from 'checkly/constructs'

export const opsTelegramTelegramAlert = new TelegramAlertChannel('example-telegram-alert-channel', {
  name: 'Ops Telegram',
  apiKey: 'INSERT_TELEGRAM_API_KEY',
  chatId: 'INSERT_TELEGRAM_CHAT_ID',
  messageThreadId: 'INSERT_TELEGRAM_THREAD_ID',
})
```

## Incident.io Alert Channel

Sends alerts to Incident.io via the webhook URL and API key created when installing the Checkly integration.

**Reference:** https://www.checklyhq.com/docs/constructs/incidentio-alert-channel/

```typescript
import { IncidentioAlertChannel } from 'checkly/constructs'

export const opsIncidentsIncidentioAlert = new IncidentioAlertChannel('example-incidentio-alert-channel', {
  name: 'Ops Incidents',
  url: 'INSERT_INCIDENTIO_URL',
  apiKey: 'INSERT_INCIDENTIO_API_KEY',
})
```

## Microsoft Teams Alert Channel

Sends alerts to a Microsoft Teams channel via an incoming webhook URL.

**Reference:** https://www.checklyhq.com/docs/constructs/msteams-alert-channel/

```typescript
import { MSTeamsAlertChannel } from 'checkly/constructs'

export const opsTeamsTeamsAlert = new MSTeamsAlertChannel('example-msteams-alert-channel', {
  name: 'Ops Teams',
  url: 'INSERT_MSTEAMS_URL',
})
```
