<!-- 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 — Auditing Privacy Compliance

## PII Discovery
```bash
# Scan database schemas for PII columns
node agent.js --framework gdpr --check data-inventory --input schema.json

# Search for PII in flat files
grep -rEi '(ssn|social.security|credit.card|\b\d{3}-\d{2}-\d{4}\b)' /data/ --include="*.csv"
```

## GDPR Audit
```bash
# Generate GDPR compliance checklist
node agent.js --framework gdpr --check checklist

# Generate DPIA for processing activity
node agent.js --framework gdpr --dpia --input processing.json --output dpia.json
```

## CCPA Audit
```bash
# Generate CCPA consumer rights checklist
node agent.js --framework ccpa --check consumer-rights

# Test Do Not Sell endpoint
curl -s "https://target.com/.well-known/ccpa" | jq .
```

## HIPAA Technical Safeguards
```bash
# Check encryption of PHI at rest
openssl enc -aes-256-cbc -in phi_data.db -out /dev/null -pass pass:test 2>&1

# Verify access controls on PHI directories
getfacl /data/health/
```

## Data Subject Rights Testing
```bash
# Test Subject Access Request (GDPR Art. 15)
curl -s -X POST "https://target.com/api/privacy/sar" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"request_type": "access"}' | jq .

# Test Right to Erasure (GDPR Art. 17)
curl -s -X POST "https://target.com/api/privacy/delete" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"request_type": "erasure"}' | jq .
```
