<!-- 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 Adaptive Authentication

## Adaptive Authentication APIs

### Microsoft Graph — Conditional Access

| Endpoint | Description |
|---|---|
| `GET /identity/conditionalAccess/policies` | List policies |
| `POST /identity/conditionalAccess/policies` | Create policy |
| `PATCH /identity/conditionalAccess/policies/{id}` | Update policy |
| `POST /identity/conditionalAccess/evaluate` | What-if evaluation |

### Okta — Policy API

| Endpoint | Description |
|---|---|
| `GET /api/v1/policies?type=SIGN_ON` | List sign-on policies |
| `POST /api/v1/policies` | Create policy |
| `GET /api/v1/policies/{id}/rules` | List policy rules |
| `POST /api/v1/policies/{id}/rules` | Create policy rule |

### Agent Script

```bash
# Create conditional access policy
node agent.js create-policy --name "high_risk_block" --conditions '{"risk": "high"}' --controls block

# Evaluate risk
node agent.js evaluate --user-id user@example.com

# Simulate policy
node agent.js simulate --policy-id policy_123 --scenarios test_cases.json
```
