Skooh.io Logo
Back to blog
IntegrationDeveloper TutorialJune 4, 20257 min

PagerDuty Webhooks to an Internal Incident Router Using Skooh

Route PagerDuty incidents to internal systems and use replay to test incident playbooks.

Use Case

When PagerDuty fires, you want to:

  • Create tickets in internal systems
  • Trigger automated remediation
  • Post to internal Slack
  • Update status pages

Skooh forwards PagerDuty webhooks to your internal incident router.

Setup

1. Create Skooh Endpoint

Create "PagerDuty Incidents" in Skooh.

2. Run the Skooh Proxy

Using the Desktop App:

  1. Download the Skooh Desktop App
  2. Enter your API key and hook token
  3. Set forwarding URL (e.g., `http://localhost:3000/incidents\`)
  4. Click Connect

Using Docker:

docker run -d \\
  --name skooh-pagerduty \\
  -e SKOOH_TOKEN=pagerduty-incidents \\
  -e SKOOH_API_KEY=your_api_key \\
  -e FORWARD_URL=http://incident-router:3000/incidents \\
  --restart unless-stopped \\
  skooh/proxy

3. Configure PagerDuty

Note: See PagerDuty's Webhooks documentation for current setup instructions.

In PagerDuty:

  1. Go to Integrations → Generic Webhooks (v3)
  2. Create a new webhook
  3. Enter your Skooh URL
  4. Select events to subscribe to

Handling PagerDuty Events

app.post('/incidents', express.json(), async (req, res) => {
  const { event, incident } = req.body.message;
  
  switch (event) {
    case 'incident.triggered':
      await handleIncidentTriggered(incident);
      break;
      
    case 'incident.acknowledged':
      await handleIncidentAcknowledged(incident);
      break;
      
    case 'incident.resolved':
      await handleIncidentResolved(incident);
      break;
      
    case 'incident.escalated':
      await handleIncidentEscalated(incident);
      break;
  }
  
  res.status(202).send('Accepted');
});

Incident Routing Logic

async function handleIncidentTriggered(incident) {
  const {
    id,
    title,
    urgency,
    service,
    escalation_policy,
    created_at
  } = incident;
  
  // 1. Create internal ticket
  const ticket = await ticketService.create({
    title: \`[PD-\${id}] \${title}\

Written by Skooh Team

Share:

Ready to try Skooh?

Start receiving webhooks in your local environment in under 5 minutes.

Skooh | PagerDuty Webhooks to an Internal Incident Router Using Skooh