# PagerDuty

![PagerDuty_Logo.svg](https://assets.relyanceuat.xyz/images/docs/6564258478221/6563722922637.svg)
PagerDuty is an incident response Saas-based platform for IT departments. It provides IT alert monitoring, on-call scheduling, escalation policies used to fix problems in apps, servers and websites across the entire incident lifecycle.

In order to integrate PagerDuty with Relyance AI you will need to follow an **Oauth2** flow.

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendor Integration** tab.
5. Find the **PagerDuty** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Oauth2 / App Token**.

![PagerDuty-3.png](https://assets.relyanceuat.xyz/images/docs/6564258478221/6564193837581.png)

The **Authentication** step asks for:

- **API Key**: required; held as a secret.

8. Click **Authenticate**.
9. This will bring up a login page on the PagerDuty site:
10. Select your service region or if you use SSO, select one of the below options.
11. Login to PagerDuty and follow any prompts to accept the connection.
12. At this point, you should see the following result on the Vendor Integrations page:

![PagerDuty-1.png](https://assets.relyanceuat.xyz/images/docs/6564258478221/6564079394445.png)

![PagerDuty-2.png](https://assets.relyanceuat.xyz/images/docs/6564258478221/6564174758285.png)

![PagerDuty-4.png](https://assets.relyanceuat.xyz/images/docs/6564258478221/6564267008013.png)

13. Congratulations, you are now connected to **PagerDuty**.

<!-- failure-modes:begin (generated from the integration catalog; do not hand-edit) -->

## If the connection reports Connected but returns nothing

These are the ways this integration comes back empty without reporting an error. Generated from the integration catalog, so it tracks what the connection actually asks for.

1. **Authorised, then empty.** The connection carries an authorisation, not a password: it stops returning data if the account that granted it loses access, its own permissions narrow, or the grant is revoked at the vendor. None of that reports an error here -- the connection keeps its last status until the next scan.
2. **A credential rotated at the vendor is not picked up here.** **API Key** is stored when you save the connection, so regenerating the value at the vendor breaks the next scan until it is re-pasted here. Recording the expiry on the connection means Relyance warns you before it lapses.

<!-- failure-modes:end -->

<!-- auth-methods:begin (generated from the integration catalog; do not hand-edit) -->

## Authentication methods and fields

Pick one of these under **Authentication Method** on the connection wizard's **Authentication** step. This table is generated from the integration catalog, so it always matches what the form actually asks for.

| Method | Required | Optional |
| --- | --- | --- |
| **Oauth2 / App Token** | — | — |
| **Custom** | `API Key` (secret) | — |

<!-- auth-methods:end -->

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

### OAuth (browser authorization)

The **OAuth (browser authorization)** method uses a browser authorization flow, so the connection is created in the Relyance app. Manage it in Terraform afterwards by importing it (`terraform import relyance_integration_connection.example pagerduty/<connection_id>`) or reading it with the `relyance_integration_connection` data source.

### API key

```hcl
resource "relyance_integration_connection" "pagerduty_1" {
  vendor = "pagerduty"
  name   = "<your connection name>"

  auth = {
    method = "api-key"
    params = {
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      api_key = var.pagerduty_api_key
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
