> ## Documentation Index
> Fetch the complete documentation index at: https://docs.happyuptime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PagerDuty

Route monitor, incident, and vendor events into PagerDuty via the Events API v2.

# PagerDuty

Happy Uptime pages PagerDuty using the [Events API v2](https://developer.pagerduty.com/docs/events-api-v2). Monitor downs and incident.created events **trigger** alerts; monitor recoveries and incident.resolved events **resolve** them automatically (same `dedup_key`).

## Get the integration key

1. In PagerDuty: **Service → Integrations → Add Integration → Events API v2**.
2. Copy the **Integration Key** (routing key).

## Add the channel

```bash
curl -X POST https://happyuptime.com/api/v1/alerts/channels \
  -H "Authorization: Bearer $HU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "PagerDuty — Prod",
    "type": "pagerduty",
    "config": {
      "integrationKey": "R01XXXXXXXXXXXXXXXXXX"
    }
  }'
```

Optional config:

| Key | Purpose |
| --- | --- |
| `dedupKey` | Prefix prepended to the auto-generated dedup key. Use different prefixes per environment. |

## Mapping

| Happy Uptime event | PagerDuty action | Severity |
| --- | --- | --- |
| `monitor.down` | `trigger` | `critical` |
| `monitor.degraded` | `trigger` | `warning` |
| `monitor.up` | `resolve` | — |
| `incident.created` (critical) | `trigger` | `critical` |
| `incident.created` (major) | `trigger` | `error` |
| `incident.created` (minor) | `trigger` | `warning` |
| `incident.acknowledged` | `acknowledge` | — |
| `incident.resolved` | `resolve` | — |
| `vendor.down` / `vendor.degraded` | `trigger` | severity-mapped |
| `vendor.resolved` | `resolve` | — |

Dedup keys follow `hu:mon:<monitor_id>`, `hu:inc:<incident_id>`, `hu:vendor:<service_name>` so triggers and resolutions correlate.

## Wire to incidents (not just monitors)

To page for every incident open/resolve in the org:

```bash
curl -X POST https://happyuptime.com/api/v1/alerts/project-channels \
  -H "Authorization: Bearer $HU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"alert_channel_id": "'"$CHANNEL_ID"'", "alert_type": "incident"}'
```