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

# PagerdutyAlertChannel Construct

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

<Tip>
  For general information about alerting, see our docs on [the Pagerduty integration](/integrations/incident-management/pagerduty) and [alerting with Checkly](/communicate/alerts/overview/).
</Tip>

Sends an alert notification to a specific service in your Pagerduty account.

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

  const pagerdutyChannel = new PagerdutyAlertChannel('pagerduty-channel-1', {
    account: 'ACME',
    serviceName: 'ACME products',
    serviceKey: '872b9b58ff4a9n06d0dl9f20487bbqwew'
  })
  ```

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

  const pagerdutyChannel = new PagerdutyAlertChannel('pagerduty-channel-1', {
    account: 'ACME',
    serviceName: 'ACME products',
    serviceKey: '872b9b58ff4a9n06d0dl9f20487bbqwew',
    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

### Pagerduty Alert Channel Options

<ResponseField name="account" type="string" required>
  The name of your Pagerduty account.
</ResponseField>

<ResponseField name="serviceName" type="string" required>
  The name of your service defined in Pagerduty under which the alerts should be nested.
</ResponseField>

<ResponseField name="serviceKey" type="string" required>
  The API key created by installing the Checkly integration in Pagerduty. We advise you to [install the Pagerduty alert channel first from the UI](https://app.checklyhq.com/alerts/settings/channels/new/pagerduty/) to grab the `serviceKey`.
</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>
