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

## GoPhish API
```bash
# List campaigns
curl -k https://localhost:3333/api/campaigns/ -H "Authorization: Bearer API_KEY"

# Create campaign
curl -k -X POST https://localhost:3333/api/campaigns/ \
  -H "Authorization: Bearer API_KEY" \
  -d '{"name":"Q1 Phish Test","template":{"name":"Template"},"page":{"name":"Landing"}}'

# Get campaign results
curl -k https://localhost:3333/api/campaigns/1/results -H "Authorization: Bearer API_KEY"
```

## M365 Attack Simulator
```powershell
# Requires Security Administrator role
# Configure via Security portal > Attack simulation training
# API access via Microsoft Graph Security API
```

## Metrics Formulas
```
Click Rate = (Users Clicked / Total Targets) * 100
Report Rate = (Users Reported / Total Targets) * 100
Phish-Prone % = (Users Submitted Creds / Total Targets) * 100
Resilience Ratio = Users Reported / Users Clicked
```
