PagerDuty

Lightweight, dependency-free, in-memory PagerDuty REST API v2 + Events API v2 fake for testing code that uses the @pagerduty/pdjs client or the raw PagerDuty APIs.

Default port: 4774

Quick start

import { PagerdutyServer } from "./services/pagerduty/src/server.js";

const server = new PagerdutyServer(4774);
await server.start();
// ... run your app/tests ...
await server.stop();

Call the REST API (Token auth) or the Events API (routing_key):

// REST API
await fetch("http://127.0.0.1:4774/incidents", {
  headers: {
    Authorization: "Token token=pd_parlel",
    Accept: "application/vnd.pagerduty+json;version=2",
  },
});

// Events API v2
await fetch("http://127.0.0.1:4774/v2/enqueue", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    routing_key: "parlelroutingkey0000000000000000",
    event_action: "trigger",
    payload: { summary: "boom", source: "host1", severity: "critical" },
  }),
});
// => { status: "success", dedup_key: "..." }

Access via MCP / preview URL

REST API auth: Authorization: Token token=<key> (also accepts Bearer). Set Accept: application/vnd.pagerduty+json;version=2. The Events API authenticates with routing_key in the body.

Implemented operations

State is in-memory and ephemeral; enqueued events are captured.

Service & inspection (parlel extensions)

Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ fully supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

FeatureStatus
Incidents list / create / get / update✅ Supported
Services list / create / get✅ Supported
Users list / create / get✅ Supported
Events API v2 /v2/enqueue✅ Supported (captured)
Token token= / Bearer auth✅ Required on REST API
Escalation policies / schedules / notifications⟳ Roadmap
Real paging / alerting / on-call routing✓ By design — Events captured, never delivered
more/offset pagination◐ Single page (more: false)

Error codes & shapes

REST error envelope: { "error": { "message": "...", "code": 2001, "errors": [...] } }. Events API uses { status, message, errors }.

StatusWhen
401REST API without Token/Bearer
400missing required field / invalid event
404unknown resource
405method not allowed

Manifest

See services/pagerduty/manifest.json:

<!-- parlel:testenv:start -->

Configuration — test.env

Copy these into your test.env (used by the bridge sidecar flow). Tokens are Parlel's seeded test credentials — any non-empty value is accepted by the emulator, so you rarely need to change them. Swap in real credentials only when pointing at the live service in prod.env.

PAGERDUTY_TOKEN=pd_parlel
PAGERDUTY_API_URL=http://parlel-bridge:4774
PAGERDUTY_ROUTING_KEY=parlelroutingkey0000000000000000
<!-- parlel:testenv:end -->