PagerDuty Events API
Point a PagerDuty Events API v2-compatible sender at OpsKnight and preserve alert lifecycle correlation.
What it does
The adapter is an Events API v2-compatible receiver. It lets an alert sender that already produces PagerDuty Events API v2 payloads send those events to OpsKnight instead. It is useful during a PagerDuty migration or behind a relay that targets more than one incident platform.
This is not a PagerDuty webhook-subscription endpoint. PagerDuty's own outbound webhooks use a different payload contract and must be transformed by a relay before they can be sent here.
Prerequisites
- An OpsKnight service and enabled integration record.
- The integration identifier.
- Control of the monitoring tool, script, or relay that currently sends PagerDuty Events API v2 requests.
- A network path from the provider to the OpsKnight web runtime.
Setup and configuration
- In OpsKnight, open Services → your service → Integrations.
- Select Add integration → PagerDuty Events API, then save the integration.
- Copy the webhook URL and integration key shown by OpsKnight. Use the complete URL; it identifies the integration record.
- In the sending monitor or relay, replace its PagerDuty Events API v2 target
with the OpsKnight URL. Keep
POSTandContent-Type: application/json. - Put the OpsKnight integration key in
routing_key. Alternatively, send it asroutingKey,keyortokenin the query string,X-Routing-Key, or a bearer token. Do not send a real PagerDuty routing key to OpsKnight. - Keep a stable
dedup_keyfor all states of one alert. Sendevent_actionastrigger,acknowledge, orresolveand includepayload.summary,payload.source, and a supportedpayload.severity. - Send a trigger from a non-production alert, acknowledge it, and resolve it. Verify that OpsKnight updates one incident rather than creating three.
Provider console labels can change independently of OpsKnight. Use the webhook or notification configuration area in the provider rather than copying a URL from another service. Treat keys and signature secrets as credentials; never place them in logs or source control.
Authentication and request verification
The endpoint requires the OpsKnight integration key. When the URL contains an
integrationId, the route compares the supplied key with the stored integration
key. Without an integrationId, it looks up the enabled PagerDuty integration by
the supplied key. There is no separate request-signature contract.
The exact payload schema is defined by src/app/api/integrations/pagerduty/route.ts and src/lib/integrations/pagerduty.ts.
- Method:
POST - Integration identifier: optional
integrationIdquery parameter - Integration key transports: JSON
routing_keyorroutingKey; querykeyortoken;X-Routing-Key; orAuthorization: Bearer … - Schema:
shared provider schema - Body limit: 1048576 bytes (1 MiB)
- Rate limit: 100 requests per 60 seconds, per integration
Event mapping and incident lifecycle
The adapter emits the lifecycle actions found in its current source:
triggeracknowledgeresolveCorrelation usesdedup_key(ordedupKey). When neither is present, the adapter derives a fallback from the summary. Explicitly sending a stable, provider-owned key is safer because summary text can change.
Recovery and deduplication
The route does not use a delivery ID. Retries and lifecycle updates converge on the adapter correlation key. Reusing one key for unrelated alerts merges them; changing it between trigger and resolve leaves the original incident open.
Limits and testing
Per-integration rate limiting protects the ingestion path. Send a representative trigger and recovery pair in a non-production service, verify that one incident is created, and confirm that recovery updates that incident rather than creating another.
Verify the connection
After the test alert, confirm all of the following:
- One incident appears for the selected OpsKnight service.
- The incident source identifies PagerDuty Events API.
- A repeat event updates or correlates according to the adapter identity.
- A recovery event resolves the correlated incident.
Error reference
202: the event was accepted; the response includes the normalizeddedup_key.400: invalid JSON, invalid schema, or no integration key.401: the key does not match the integration named inintegrationId.404: the integration does not exist, is disabled, has another type, or no enabled PagerDuty integration matches the key.413: the request exceeds 1 MiB.429: more than 100 requests reached this integration in 60 seconds.500: processing failed after validation.
Troubleshooting
- Confirm the integration is enabled and belongs to the intended service.
- Verify the integration ID in the URL and the OpsKnight key in
routing_key; rotate any key that may have been exposed. - Inspect Settings → Integrations → Failures for validation or signature errors.
- Check for
413before changing payload templates and429before retrying rapidly. - Confirm the sender uses Events API v2 fields, not PagerDuty webhook
subscription fields such as an
eventenvelope. - Compare
dedup_keyacross trigger and resolve payloads. They must be exactly equal. - Preserve a redacted payload, response status, normalized
dedup_key, and timestamp when escalating.
Related pages
Security
Use HTTPS, rotate exposed keys at both systems, configure signature verification when supported, and restrict provider egress or ingress controls without blocking legitimate retries.
Last updated for v2.0.0
Edit this page on GitHub