<!-- 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 — Performing Identity Posture Assessment

## Posture Assessment APIs

### Microsoft Graph — Identity Reports

| Endpoint | Description |
|---|---|
| `GET /reports/authenticationMethods/userRegistrationDetails` | MFA registration status |
| `GET /directoryRoles` | Enumerate directory roles |
| `GET /directoryRoles/{id}/members` | Role membership |
| `GET /applications` | Registered applications |
| `GET /servicePrincipals` | Service principals and secrets |

### Okta — Security APIs

| Endpoint | Description |
|---|---|
| `GET /api/v1/users?filter=status eq "ACTIVE"` | Active users |
| `GET /api/v1/users/{id}/factors` | MFA factors enrolled |
| `GET /api/v1/groups/{id}/roles` | Group role assignments |

### Agent Script

```bash
# Assess MFA coverage
node agent.js assess-mfa --tenant contoso.onmicrosoft.com

# Assess privilege hygiene
node agent.js assess-privilege --tenant contoso.onmicrosoft.com

# Calculate posture score
node agent.js score --results-file assessment_results.json
```
