> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pidgeon.health/llms.txt
> Use this file to discover all available pages before exploring further.

# Enterprise API

> Observability, SSO configuration, audit logs, feature flags, and health check endpoints.

## Observability

<Warning>Requires `LoftAdmin` authorization.</Warning>

### GET /api/admin/observability/sla/{orgId}

Get organization-level SLA overview.

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  "http://localhost:5100/api/admin/observability/sla/org-uuid?from=2026-02-01&to=2026-02-22"
```

### GET /api/admin/observability/sla/{orgId}/violations

Get SLA violations for an organization.

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  "http://localhost:5100/api/admin/observability/sla/org-uuid/violations?from=2026-02-01"
```

### GET /api/admin/observability/metrics/cost

Get infrastructure cost metrics.

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  http://localhost:5100/api/admin/observability/metrics/cost
```

***

## SSO Configuration

<Warning>Requires `LoftAdmin` authorization.</Warning>

### GET /api/loft/sso/providers

List configured SSO providers.

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  http://localhost:5100/api/loft/sso/providers
```

### POST /api/loft/sso/configure

Configure an SSO provider.

```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/sso/configure \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "providerType": "oidc",
    "displayName": "Corporate SSO",
    "clientId": "your-client-id",
    "clientSecret": "your-client-secret",
    "issuerUrl": "https://login.corp.com",
    "jitProvisioning": true
  }'
```

### DELETE /api/loft/sso/providers/{providerType}

Remove an SSO provider.

```bash curl theme={null}
curl -X DELETE -H "Authorization: Bearer YOUR_JWT" \
  http://localhost:5100/api/loft/sso/providers/oidc
```

***

## Audit Logs

<Warning>Requires `LoftAdmin` authorization.</Warning>

### GET /api/loft/audit/

Query audit logs.

| Query Param    | Type     | Description           |
| -------------- | -------- | --------------------- |
| `action`       | string   | Filter by action type |
| `resourceType` | string   | Filter by resource    |
| `from`         | ISO 8601 | Start time            |
| `to`           | ISO 8601 | End time              |
| `limit`        | int      | Max results           |
| `offset`       | int      | Pagination offset     |

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  "http://localhost:5100/api/loft/audit/?action=role.assign&limit=50"
```

### GET /api/loft/audit/export

Export audit logs as CSV or JSON.

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  "http://localhost:5100/api/loft/audit/export?format=csv&from=2026-02-01" \
  -o audit.csv
```

***

## Feature Flags

### GET /api/features

Get feature flags. **Public** — returns org-specific flags if authenticated, global flags otherwise.

```bash curl theme={null}
curl http://localhost:5100/api/features
```

***

## Health Check

### GET /api/health

Health check endpoint. **Public**.

```bash curl theme={null}
curl http://localhost:5100/api/health
```

```json theme={null}
{
  "status": "healthy",
  "timestamp": "2026-02-22T14:30:00Z",
  "version": "1.0.0",
  "uptimeSeconds": 86400,
  "checks": {
    "database": "healthy",
    "cache": "healthy"
  }
}
```
