Manage incidents and on-call operations via the PagerDuty REST API (v2).
bash
export PAGERDUTY_API_KEY="your-api-key-here"
# Optional: set default email for actions that require it
export PAGERDUTY_FROM_EMAIL="oncall@yourcompany.com"
Get your API key: PagerDuty → User Icon → My Profile → User Settings → API Access Keys → Create New API Key
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py incidents --status triggered,acknowledged
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py acknowledge --id P1234AB
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py resolve --id P1234AB
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py trigger \
--service-key "your-service-integration-key" \
--description "Database is down" \
--severity critical
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py oncall
# With schedule filter:
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py oncall --schedule-id PABC123
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py get --id P1234AB
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py services
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py escalations
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py note --id P1234AB --message "Investigating DB failover"
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py snooze --id P1234AB --duration 3600
bash
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py reassign --id P1234AB --user-id PU12345
For operations not covered by the script, use curl directly:
bash
curl -s -H "Authorization: Token token=$PAGERDUTY_API_KEY" \
-H "Accept: application/vnd.pagerduty+json;version=2" \
"https://api.pagerduty.com/incidents?statuses[]=triggered&limit=25"
triggered → acknowledged → resolvedincidents to check overnight alertsoncall + incidents for current stateget for timeline, then note to document RCAincidents filtered by urgency, then acknowledge--limit flag to control result set size