> ## 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.

# SlackAlertChannel Construct

> Learn how to configure Slack alert channels with the Checkly CLI.

<Warning>
  The Slack webhook based alert channel is deprecated in favour of the more modern [Slack App alert channel](/constructs/slack-app-alert-channel)
</Warning>

Sends alert notifications to a Slack channel via an incoming webhook.

<CodeGroup>
  ```ts Basic Example theme={null}
  import { SlackAlertChannel } from 'checkly/constructs'

  const slackChannel = new SlackAlertChannel('slack-channel-1', {
    url: new URL('https://hooks.slack.com/services/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'),
    channel: '#ops'
  })
  ```

  ```ts Advanced Example theme={null}
  import { SlackAlertChannel } from 'checkly/constructs'

  const slackChannel = new SlackAlertChannel('slack-channel-1', {
    url: new URL('https://hooks.slack.com/services/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'),
    channel: '#ops',
    sendRecovery: true,
    sendFailure: true,
    sendDegraded: true,
    sslExpiry: true,
    sslExpiryThreshold: 30,
  })
  ```
</CodeGroup>

<Note>
  If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/constructs/alert-channel#using-fromid-to-reference-an-existing-channel).
</Note>

## Configuration

### Slack Alert Channel Options

<ResponseField name="url" type="URL" required>
  The Slack incoming webhook URL where Checkly will send alert notifications.

  ```ts highlight={2} theme={null}
  new SlackAlertChannel('slack-channel-1', {
    url: new URL('https://hooks.slack.com/services/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'),
    channel: '#ops'
  })
  ```
</ResponseField>

<ResponseField name="channel" type="string">
  Target Slack channel or user for notifications. You can specify the target channel to override the default channel configured in the webhook.
</ResponseField>

### General Alert Channel Options

These options are valid for all alert channels types.

<ResponseField name="sendRecovery" type="boolean">
  Whether to send notifications when checks recover from a [failed or degraded state](/communicate/alerts/overview/#alert-channels). Default value is `true`.
</ResponseField>

<ResponseField name="sendFailure" type="boolean">
  Whether to send notifications when checks [fail](/communicate/alerts/overview/#alert-channels). Default value is `true`.
</ResponseField>

<ResponseField name="sendDegraded" type="boolean">
  Whether to send notifications when checks [become degraded](/communicate/alerts/overview/#alert-channels). Default value is `false`.
</ResponseField>

<ResponseField name="sslExpiry" type="boolean">
  Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`.

  ```ts highlight={3} theme={null}
  new EmailAlertChannel("email-channel-1", {
    address: "alerts@acme.com",
    sslExpiry: true,
    sslExpiryThreshold: 30, // Alert 30 days before expiry
  })
  ```

  [Learn more about SSL alerts.](/communicate/alerts/ssl-expiration/)
</ResponseField>

<ResponseField name="sslExpiryThreshold" type="number">
  Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`.

  ```ts highlight={4} theme={null}
  new EmailAlertChannel("email-channel-1", {
    address: "alerts@acme.com",
    sslExpiry: true,
    sslExpiryThreshold: 30, // Alert 30 days before expiry
  })
  ```

  [Learn more about SSL alerts.](/communicate/alerts/ssl-expiration/)
</ResponseField>
