> ## 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.

# Admin API

> RBAC role management, workspace operations, and SLA definitions — requires LoftAdmin authorization.

<Warning>All admin endpoints require the `LoftAdmin` authorization policy. Include a JWT or API key with admin privileges.</Warning>

## RBAC Management

### GET /api/loft/admin/roles

List organization role assignments.

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

### POST /api/loft/admin/roles

Assign a role to a user.

```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/admin/roles \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"userId": "user-uuid", "role": "LoftOperator"}'
```

### DELETE /api/loft/admin/roles/{userId}

Revoke a user's role.

```bash curl theme={null}
curl -X DELETE -H "Authorization: Bearer YOUR_JWT" \
  http://localhost:5100/api/loft/admin/roles/user-uuid
```

***

## Workspace Management

### GET /api/loft/admin/workspaces

List workspaces.

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

### POST /api/loft/admin/workspaces

Create a workspace.

```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/admin/workspaces \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "East Region", "description": "East region interfaces"}'
```

### POST /api/loft/admin/workspaces/{id}/members

Add a member to a workspace.

```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/admin/workspaces/ws-001/members \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"userId": "user-uuid", "role": "LoftViewer"}'
```

### POST /api/loft/admin/workspaces/{id}/interfaces

Add an interface to a workspace.

```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/admin/workspaces/ws-001/interfaces \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"interfaceId": "intf-001"}'
```

***

## SLA Management

### GET /api/loft/admin/sla/{interfaceId}

Get SLA definition for an interface.

```bash curl theme={null}
curl -H "Authorization: Bearer YOUR_JWT" \
  http://localhost:5100/api/loft/admin/sla/intf-001
```

### POST /api/loft/admin/sla

Create an SLA definition.

```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/admin/sla \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"interfaceId": "intf-001", "uptimeTarget": 99.9, "maxResponseMs": 500, "alertThresholdPercent": 5}'
```

### GET /api/loft/admin/sla/{interfaceId}/report

Get SLA compliance report.

| Query Param | Type     | Description  |
| ----------- | -------- | ------------ |
| `from`      | ISO 8601 | Report start |
| `to`        | ISO 8601 | Report end   |

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