<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# Incident Communication Plans — API Reference

## PagerDuty API

### Trigger Incident

```bash
curl -X POST "https://events.pagerduty.com/v2/enqueue" \
  -H "Content-Type: application/json" \
  -d '{
    "routing_key":"'"$PD_ROUTING_KEY"'",
    "event_action":"trigger",
    "payload":{
      "summary":"P1 Security Incident - Active compromise",
      "severity":"critical",
      "source":"SIEM"
    }
  }'
```

### Acknowledge Incident

```bash
curl -X POST "https://events.pagerduty.com/v2/enqueue" \
  -d '{"routing_key":"'"$PD_ROUTING_KEY"'","event_action":"acknowledge","dedup_key":"inc-2026-0342"}'
```

## Slack API

### Create Private Channel

```bash
curl -X POST "https://slack.com/api/conversations.create" \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -d '{"name":"inc-2026-0342","is_private":true}'
```

### Post Status Update

```bash
curl -X POST "https://slack.com/api/chat.postMessage" \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -d '{"channel":"C0XXXXXX","text":"STATUS UPDATE #3 — Containment in progress"}'
```

### Set Channel Topic

```bash
curl -X POST "https://slack.com/api/conversations.setTopic" \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -d '{"channel":"C0XXXXXX","topic":"INC-2026-0342 | P1 | IR Lead: Jane | Bridge: 555-0100"}'
```

## Opsgenie API

### Create Alert

```bash
curl -X POST "https://api.opsgenie.com/v2/alerts" \
  -H "Authorization: GenieKey $OG_API_KEY" \
  -d '{
    "message":"P1 Security Incident - INC-2026-0342",
    "priority":"P1",
    "tags":["security","incident-response"],
    "responders":[{"type":"team","name":"Security IR"}]
  }'
```

## Key Parameters

| Parameter | Description | Example |
|-----------|-------------|---------|
| `routing_key` | PagerDuty service integration key | `R0XXXXXXXX` |
| `severity` | PagerDuty severity level | `critical`, `error`, `warning`, `info` |
| `priority` | Opsgenie priority | `P1` through `P5` |
| `is_private` | Slack channel visibility | `true` |
| `dedup_key` | PagerDuty deduplication key | `inc-2026-0342` |
