Manage teams, escalation policies, on-call schedules, and team membership
You are helping the user manage PagerDuty teams, escalation policies, on-call schedules, and team membership.
Verify the PAGERDUTY_API_KEY environment variable is set:
echo $PAGERDUTY_API_KEY
# List all teams
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams list
# Search teams by name
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams list --query "vecu"
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams get --id YOUR_TEAM_ID
Returns:
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams create \
--name "Infiquetra Platform Team" \
--description "Infiquetra platform engineering and operations"
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams update \
--id PXXXXX \
--name "Infiquetra Engineering" \
--description "Updated description"
⚠️ Warning: Deleting a team may affect services and escalation policies.
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams delete --id PXXXXX
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams members \
--team-id YOUR_TEAM_ID \
--action list
Returns list of members with:
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams members \
--team-id YOUR_TEAM_ID \
--action add \
--user-id PXXXXX \
--role responder
Roles:
manager: Full team management permissionsresponder: Can respond to incidents, view schedulesobserver: Read-only accesspython plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py teams members \
--team-id YOUR_TEAM_ID \
--action remove \
--user-id PXXXXX
# List all policies
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py policies list
# Filter by team
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py policies list --team-id YOUR_TEAM_ID
# Search by name
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py policies list --query "production"
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py policies get --id YOUR_POLICY_ID
Returns:
# List all on-call schedules
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py schedules list
# Search by name
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py schedules list --query "primary"
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py schedules get --id PXXXXX
# All on-call users
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py oncall
# Filter by schedule
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py oncall --schedule-id PXXXXX
# Filter by escalation policy
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py oncall --escalation-policy-id YOUR_POLICY_ID
# On-call users for a time range
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py oncall \
--since "2026-02-26T00:00:00Z" \
--until "2026-02-27T00:00:00Z"
# List all users
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py users list
# Filter by team
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py users list --team-id YOUR_TEAM_ID
# Search by name/email
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py users list --query "jeff.cox"
python plugins/pagerduty/skills/pagerduty-incidents/scripts/pagerduty_client.py users get --id PXXXXX
Returns:
User: "Show me all Infiquetra teams"
Response:
--query "vecu"User: "Who is on the wallet team?"
Response:
User: "Who is on-call right now?"
Response:
User: "Who will be on-call next week?"
Response:
--since and --untilUser: "Am I on-call this weekend?"
Response:
User: "Add Sarah to the Infiquetra team as a responder"
Response:
User: "Show me the Infiquetra escalation policy"
Response:
User: "Which services use the production escalation policy?"
Response:
{
"coverage_summary": {
"current_week": {
"covered_hours": 168,
"gaps": 0,
"rotations": 3
},
"next_week": {
"covered_hours": 168,
"gaps": 0,
"rotations": 3
}
},
"coverage_by_level": {
"L1": "100% (Jeff Cox, Sarah Smith rotation)",
"L2": "100% (Mike Johnson, Lisa Brown rotation)",
"L3": "100% (Manager escalation)"
}
}
{
"team": "Infiquetra (YOUR_TEAM_ID)",
"metrics": {
"members": 12,
"services": 8,
"active_incidents": 3,
"escalation_policies": 2,
"on_call_schedules": 2
},
"on_call_distribution": {
"balanced": true,
"avg_shifts_per_person_per_week": 2.5,
"longest_continuous_shift": "12 hours",
"shortest_rest_period": "36 hours"
},
"recommendations": [
"On-call distribution is balanced across team",
"Consider adding backup responder for wallet-service"
]
}
Incident Escalation for wallet-service:
Level 1 (Immediate):
└─ Primary On-Call: Jeff Cox
Contact: +1-555-0100, [email protected]
Response time: < 5 minutes
Level 2 (After 5 minutes):
└─ Secondary On-Call: Sarah Smith
Contact: +1-555-0101, [email protected]
Notification: SMS + Email
Level 3 (After 15 minutes):
└─ Manager Escalation: Mike Johnson
Contact: +1-555-0102, [email protected]
Notification: Phone Call + SMS
Current Status: All levels staffed ✓
When adding members:
Adding user to Infiquetra team...
Suggested role: responder
Reason: User has no manager permissions on other teams
Recommended next steps:
1. Add to primary on-call rotation (every 3rd week)
2. Grant access to Slack
3. Add to documentation portal documentation
4. Schedule onboarding with team lead
After on-call queries:
Current on-call: Jeff Cox (L1), Sarah Smith (L2)
Would you like to:
1. Post on-call schedule to
2. Send DM to on-call engineer
3. Create on-call handoff thread
Link teams to SLED organizational structure:
Team: Infiquetra (YOUR_TEAM_ID)
SLED Mapping:
- Team ID:
- Portfolio: I5 - Vehicle Services
- Services: 8 components
- On-call coverage: 24/7
Sync team roster to SLED? (y/n)
Export on-call schedules:
On-call schedule for next month:
Export options:
1. iCal format (import to Outlook/Google Calendar)
2. CSV (import to spreadsheet)
3. JSON (programmatic access)
4. Send to Slack channel
Would you like to export?
The Infiquetra production escalation policy follows this structure:
Level 1 - Immediate Response (0 minutes):
- Target: Primary on-call engineer
- Notification: SMS + Push + Phone
- Timeout: 5 minutes
Level 2 - Secondary Response (5 minutes):
- Target: Secondary on-call engineer
- Notification: SMS + Phone
- Timeout: 10 minutes
Level 3 - Manager Escalation (15 minutes):
- Target: Engineering manager
- Notification: Phone call
- Timeout: Incident resolved or manager responds
Check policy configurations:
Escalation Policy Audit for Infiquetra:
✓ Primary policy (YOUR_POLICY_ID):
- 3 escalation levels
- All levels staffed
- Average response time: 2.3 minutes
⚠ Dev policy (P0G40L1):
- Missing L3 escalation
- Recommendation: Add manager fallback
✗ Legacy policy (P0G40L0):
- Deprecated, no active services
- Recommendation: Delete policy
User Not Found:
{
"error": true,
"message": "User PXXXXX not found",
"status_code": 404
}
Solution: Search users first to get valid ID
Insufficient Permissions:
{
"error": true,
"message": "Insufficient permissions to modify team",
"status_code": 403
}
Solution: Verify API key has team management permissions
Team Member Already Exists:
{
"error": true,
"message": "User is already a member of this team",
"status_code": 400
}
Solution: Update member role instead of adding
All commands return JSON:
{
"success": true,
"data": {...},
"count": 5,
"message": "Optional success message"
}
See references/ directory for:
pagerduty-api.md: Complete PagerDuty API v2 referenceescalation-policies.md: Policy configuration and best practiceson-call-management.md: On-call scheduling and rotation patternsteam-structure.md: Infiquetra team organization and roles