> For the complete documentation index, see [llms.txt](https://docs.mipcraft.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mipcraft.eu/network-manager/api/dashboard-api.md).

# Dashboard API

The web dashboard communicates with the proxy via a RESTful JSON API. All endpoints except login require authentication via Bearer token.

## Authentication

### Login

```http
POST /api/auth/login
Content-Type: application/json

{"password": "your-password"}
```

**Response:**

```json
{"token": "abc123..."}
```

**Error:** Returns 401 if password is incorrect.

### Authenticating Requests

All subsequent requests must include the token:

```http
Authorization: Bearer abc123...
```

Or as a query parameter for SSE connections:

```http
GET /api/servers/events?token=abc123...
```

Tokens expire after 24 hours.

## Servers API

### List All Servers

```http
GET /api/servers
```

**Response:**

```json
[
  {
    "name": "hub-1",
    "type": "HUB",
    "state": "IDLE",
    "players": 12,
    "maxPlayers": 20,
    "gameName": "",
    "serverId": "hub-01",
    "online": true,
    "canRejoin": false
  }
]
```

### Get Server Detail

```http
GET /api/servers/{name}
```

### Get Server Players

```http
GET /api/servers/{name}/players
```

**Response:**

```json
[
  {
    "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "Player1",
    "onlineTime": 3600,
    "totalTime": 72000
  }
]
```

### Add Server

```http
POST /api/servers
Content-Type: application/json

{
  "name": "hub-2",
  "type": "HUB",
  "maxPlayers": 20,
  "serverId": "hub-02",
  "gameName": "",
  "gameData": "",
  "canRejoin": false
}
```

### Remove Server

```http
DELETE /api/servers/{name}
```

### Restart Server

```http
POST /api/servers/{name}/restart
```

### Ping Server

```http
POST /api/servers/{name}/ping
```

**Response:**

```json
{
  "success": true,
  "state": "IDLE"
}
```

### SSE Events

```http
GET /api/servers/events?token={token}
```

**Events:**

* `server_update` — Server state changed (includes `name`, `state`, `players`, `maxPlayers`, `online`, or `removed: true`)

## Players API

### List Online Players

```http
GET /api/players?sort=onlineTime&order=desc&search=player
```

**Parameters:**

* `sort`: `onlineTime` (default), `totalTime`, `name`
* `order`: `desc` (default), `asc`
* `search`: Filter by name (case-insensitive)

### List All Players (Online + Offline)

```http
GET /api/players/all?sort=name&order=asc&search=player&limit=100&offset=0
```

**Parameters:**

* `sort`: `name`, `totalTime`, `joinedDate`, `lastOnline`
* `order`: `desc`, `asc`
* `search`: Filter by name
* `limit`: Max results (default 100)
* `offset`: Pagination offset (default 0)

**Response:**

```json
[
  {
    "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "Player1",
    "isOnline": true,
    "server": "hub-1",
    "totalTime": 72000,
    "totalTimeText": "20h 0m",
    "lastOnline": "2024-01-15 14:30:00",
    "joinedDate": "2024-01-01 00:00:00",
    "isBanned": false
  }
]
```

### Get Player Detail

```http
GET /api/players/{uuid}
```

**Response:**

```json
{
  "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "name": "Player1",
  "isOnline": true,
  "server": "hub-1",
  "onlineTime": 3600,
  "totalTime": 72000,
  "totalTimeText": "20h 0m",
  "lastOnline": "2024-01-15 14:30:00",
  "joinedDate": "2024-01-01 00:00:00",
  "isBanned": false,
  "isPermanent": false,
  "banExpires": -2,
  "bannedTimes": 0,
  "banReason": "",
  "banDate": "",
  "bannedIp": ""
}
```

### Ban Player

```http
POST /api/players/{uuid}/ban
Content-Type: application/json

{
  "name": "Player1",
  "time": "7D",
  "reason": "Griefing"
}
```

**Time format:** `perma`, `1h`, `24h`, `7D`, `30D`, `1Y`

### Unban Player

```http
POST /api/players/{uuid}/unban
```

### Kick Player

```http
POST /api/players/{uuid}/kick
Content-Type: application/json

{
  "reason": "Kicked from dashboard"
}
```

### Get Player Friends

```http
GET /api/players/{uuid}/friends
```

**Response:**

```json
[
  {
    "uuid": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
    "name": "FriendPlayer",
    "friendSince": "2024-01-15 14:30:00"
  }
]
```

### Get Player Party

```http
GET /api/players/{uuid}/party
```

**Response:**

```json
null
```

*(Or party detail object if a compatible Party plugin is active)*

### SSE Events

```http
GET /api/players/events?token={token}
```

**Events:**

* `player_join` — Player connected to the proxy
* `player_leave` — Player disconnected
* `ban_update` — Ban created or revoked
* `player_history` — Player count snapshot (every 60s), format: `{"timestamp": 1700000000000, "count": 42}`

## Bans API

### List Bans

```http
GET /api/bans?search=player&sort=date&order=desc
```

**Parameters:**

* `search`: Filter by player name
* `sort`: `name`, `expires`, `times`, `date`
* `order`: `desc`, `asc`

**Response:**

```json
[
  {
    "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "Player1",
    "reason": "Griefing",
    "bannedDate": "2024-01-15 14:30:00",
    "bannedTimes": 3,
    "expires": 1700000000000,
    "active": true,
    "permanent": false,
    "bannedIp": "192.168.1.1"
  }
]
```

### Get Single Ban

```http
GET /api/bans/{uuid}
```

### Create Ban

```http
POST /api/bans
Content-Type: application/json

{
  "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "name": "Player1",
  "time": "7D",
  "reason": "Griefing"
}
```

### Revoke Ban

```http
DELETE /api/bans/{uuid}
```

## Proxy API

### Get Proxy Status

```http
GET /api/proxy/status
```

**Response:**

```json
{
  "maintenance": false,
  "motd": "Welcome to MyNetwork",
  "maintenanceMotd": "",
  "preventJoin": false,
  "onlinePlayers": 42,
  "maxPlayers": 100,
  "maintenanceBypass": ["Notch", "Dinnerbone"]
}
```

### Update Proxy Status

```http
PUT /api/proxy/status
Content-Type: application/json

{
  "maintenance": true,
  "motd": "New MOTD here #FF6B35✦",
  "maintenanceMotd": "Down for maintenance",
  "preventJoin": true,
  "maxPlayers": 100,
  "maintenanceBypass": ["Notch"]
}
```

All fields are optional — only included fields are updated.

### Get Proxy Settings

```http
GET /api/proxy/settings
```

### Update Proxy Settings

```http
PUT /api/proxy/settings
Content-Type: application/json

{
  "maxPlayers": 100
}
```

### Get Player History

```http
GET /api/proxy/player-history
```

**Response:**

```json
[
  {"timestamp": 1700000000000, "count": 42},
  {"timestamp": 1700000060000, "count": 45}
]
```

60 data points (one per minute, last hour).

### List Maintenance Bypass Players

```http
GET /api/proxy/maintenance-bypass
```

### Add Bypass Player

```http
POST /api/proxy/maintenance-bypass
Content-Type: application/json

{
  "player": "Notch"
}
```

### Remove Bypass Player

```http
DELETE /api/proxy/maintenance-bypass?player=Notch
```

## Parties API

### Get All Active Parties

```http
GET /api/parties
```

**Response:**

```json
[]
```

*(Or list of active party objects if a compatible Party plugin is active)*

***

All proxy endpoints except status are **Velocity-primary**. For BungeeCord, equivalent endpoints exist with the same paths.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mipcraft.eu/network-manager/api/dashboard-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
