Authentication
PagerDuty supports two authentication methods:- API Token (Recommended for development)
- OAuth 2.0 (Recommended for production)
Option A: API Token
Create API Key
- Go to PagerDuty
- Navigate to Integrations > API Access Keys
- Click Create New API Key
- Select Read or Write permissions (both work)
- Copy the generated token
Option B: OAuth 2.0
Create OAuth App
- Go to PagerDuty
- Navigate to Integrations > Developer Mode > My Apps
- Click Create New App
- Name:
Aurora - Enable OAuth 2.0
- Redirect URL:
http://localhost:5000/pagerduty/oauth/callback(for development) - Copy the Client ID and Client Secret
Configuration
Environment Variables
.env
Webhook Setup
Receive real-time incident notifications from PagerDuty (V3 webhooks only).Local Development Setup
Start Port Forwarding
PagerDuty webhooks cannot reach Copy the HTTPS URL (e.g.,
localhost:5080 directly. Use ngrok:https://abc123.ngrok-free.app)Configure Webhook in PagerDuty
- Go to PagerDuty
- Navigate to Integrations > Generic Webhooks (v3) > New Webhook
- Paste the Aurora webhook URL
- Set scope to Account or specific services
- Subscribe to events:
incident.triggeredincident.acknowledgedincident.resolvedincident.custom_field_values.updated
- Click Add Webhook
- Send a test notification to verify
Production Setup
In production, webhooks use your production backend URL automatically. No port forwarding needed. Webhook URL format:What Aurora Can Query
Once connected, Aurora can:Connection Status
- Verify token validity
- View connected user info
- Check account subdomain
- View token capabilities (read/write)
GET /pagerduty
Response:
Webhook Events (V3 Only)
- Receive real-time incident events
- Auto-create Aurora incidents
- Track incident lifecycle (triggered, acknowledged, resolved)
- Monitor custom field updates
- Correlate related incidents
- Generate AI-powered root cause analysis
incident.triggered- New incident createdincident.acknowledged- Incident acknowledgedincident.resolved- Incident resolvedincident.custom_field_values.updated- Custom fields changed
- Incident ID and title
- Incident status and urgency
- Service and escalation policy info
- Assignee information
- Custom field values
- Related alerts and context
Troubleshooting
“PagerDuty OAuth is not enabled”- Set
NEXT_PUBLIC_ENABLE_PAGERDUTY_OAUTH=truein.env - Restart Aurora services
- Verify
PAGERDUTY_CLIENT_IDandPAGERDUTY_CLIENT_SECRETare set - Check for typos in environment variable names
- Verify token is correct and not revoked
- Check token has required permissions (Read or Write)
- For OAuth: token may have expired, reconnect
- Verify
NGROK_URLis set correctly (local development) - Ensure ngrok/cloudflared tunnel is running
- Check webhook URL in PagerDuty matches Aurora UI
- Confirm webhook is subscribed to correct events
- Send test notification from PagerDuty
- Check Aurora logs for webhook errors
- Some account-level tokens cannot access user info
- Aurora will still work, but may not show user details
- Consider using a user-level token or OAuth
API Reference
Base Path:/pagerduty
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Check connection status |
| POST | / | Connect with API token |
| PATCH | / | Rotate API token |
| DELETE | / | Disconnect PagerDuty |
| POST | /oauth/login | Initiate OAuth flow |
| GET | /oauth/callback | OAuth callback handler |
| POST | /webhook/{user_id} | Receive V3 webhooks |
| GET | /webhook-url | Get webhook URL |