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

# SmsAlertChannel Construct

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

<Tip>
  For general information about alerting, see our docs on [SMS alerts](/integrations/alerts/sms) and [alerting with Checkly](/communicate/alerts/overview/).
</Tip>

Use SMS Alert Channels to send SMS notifications to phone numbers when checks fail or recover.

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

  const smsChannel = new SmsAlertChannel('sms-channel-1', {
    name: 'Ops on-call',
    phoneNumber: '+31061234567890',
  })
  ```

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

  const smsChannel = new SmsAlertChannel('sms-channel-1', {
    name: 'Ops on-call',
    phoneNumber: '+31061234567890',
    sendRecovery: true,
    sendFailure: true,
    sendDegraded: false,
    sslExpiry: true,
    sslExpiryThreshold: 7,
  })
  ```
</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

### SMS Alert Channel Options

<ResponseField name="phoneNumber" type="string" required>
  Phone number to send SMS notifications to.

  Each `SmsAlertChannel` supports only one phone number. Phone numbers need to be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).

  We only support phone numbers from certain [countries and regions](/integrations/alerts/sms#supported-countries-and-regions).

  ```ts highlight={3} theme={null}
  new SmsAlertChannel('sms-channel-1', {
    name: 'Ops on-call',
    phoneNumber: '+31061234567890',
  })
  ```
</ResponseField>

<ResponseField name="name" type="string">
  Friendly name for the SMS alert channel.
</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>
