v2026.1 Open Portal ↗
On this page

PagerDuty Integration

Prerequisites

RequirementDetails
PagerDuty accountAdmin role to generate API keys and create integrations
PagerDuty planProfessional or Enterprise (Events API v2 required)
StackFlow rolesuper_admin or itsm_manager

Step 1: Generate PagerDuty API Key

  1. Log into PagerDuty and go to Integrations → API Access Keys
  2. Click Create New API Key
  3. Name it StackFlow Integration and select Read/Write
  4. Copy the generated API key — it is shown only once
API Key Security: StackFlow stores this key in AWS Secrets Manager (stackflow/integrations/pagerduty/api-key) encrypted with KMS CMK mrk-bd842691514c4d74a02992b8dc11fe16. Never paste it into plain text files or chat.

Step 2: Create a Service Integration

  1. In PagerDuty, go to Services → Service Directory → [your service] → Integrations → Add Integration
  2. Search for Events API v2 and add it
  3. Copy the Integration Key (routing key) for this service
  4. Repeat for each PagerDuty service you want to map to StackFlow assignment groups

Step 3: Configure Service Mapping

Map PagerDuty services to StackFlow assignment groups so incidents route correctly:

{
  "service_mapping": [
    {
      "pagerduty_service_id": "P1234AB",
      "pagerduty_service_name": "Production API",
      "stackflow_assignment_group": "Platform Engineering",
      "stackflow_category": "api",
      "integration_key": "abc123def456..."
    },
    {
      "pagerduty_service_id": "P5678CD",
      "pagerduty_service_name": "Database Service",
      "stackflow_assignment_group": "Database Reliability",
      "stackflow_category": "database",
      "integration_key": "xyz789..."
    }
  ]
}

Step 4: Connect in StackFlow

  1. Navigate to Admin → Integration Hub → PagerDuty → Configure
  2. Paste your PagerDuty API Key
  3. Enter your PagerDuty subdomain (e.g., your-org from your-org.pagerduty.com)
  4. Configure the service mapping table
  5. Enable Bidirectional Sync and enter the StackFlow webhook URL as a PagerDuty webhook extension
  6. Click Save & Test

Bidirectional Sync

With bidirectional sync enabled, incidents created in StackFlow automatically trigger PagerDuty alerts, and PagerDuty incidents create StackFlow records. State changes sync in both directions:

StackFlow EventPagerDuty Action
Incident created (P1/P2)Trigger alert via Events API v2
Incident resolvedResolve PagerDuty incident
Incident assignedAcknowledge PagerDuty incident
PagerDuty alert triggeredCreate StackFlow incident
PagerDuty incident acknowledgedSet StackFlow incident to in_progress
PagerDuty incident resolvedSet StackFlow incident to resolved

Escalation Policy Mapping

Map PagerDuty escalation policies to StackFlow SLA breach escalation rules. When a StackFlow SLA is breached at 100%, the integration can trigger the associated PagerDuty escalation policy.

{
  "escalation_mapping": [
    {
      "stackflow_sla_policy": "P1-Response-SLA",
      "pagerduty_escalation_policy_id": "PXXXXXX",
      "trigger_on": "sla_breach"
    }
  ]
}

Field Reference

FieldRequiredDescription
API KeyYesPagerDuty REST API key (Read/Write)
SubdomainYesPagerDuty subdomain (e.g., acme)
Service MappingYesMap PagerDuty services to StackFlow groups
Bidirectional SyncNoEnable two-way incident state sync (default: true)
Priority ThresholdNoMinimum priority to send to PagerDuty (default: P2)
Auto-AcknowledgeNoAcknowledge PD incident when SF incident assigned (default: true)

Testing the Integration

  1. In StackFlow, go to Admin → Integration Hub → PagerDuty → Test
  2. Click Send Test Event — a test alert should appear in PagerDuty
  3. Acknowledge the PagerDuty incident and verify the StackFlow incident state changes to in_progress
  4. Resolve the PagerDuty incident and verify the StackFlow incident moves to resolved

Troubleshooting

IssueCauseFix
Events not reaching PagerDutyIntegration key invalidRe-copy the Integration Key from PagerDuty service → Integrations
401 on API callsAPI key expired or revokedGenerate a new API key in PagerDuty and update in Secrets Manager
Duplicate incidentsBoth directions triggering simultaneouslyEnable dedup key in Integration Hub settings; check webhook filter conditions
Wrong assignment groupService mapping misconfiguredReview service mapping in Integration Hub; verify PagerDuty service IDs