ServerBee

API Reference

ServerBee REST API overview, authentication, WebSocket endpoints, and Swagger UI interactive docs.

ServerBee exposes the same capabilities used by the web dashboard through REST and WebSocket APIs. The authoritative, schema-level reference is generated from OpenAPI annotations in the server binary.

Swagger UI

Open the built-in interactive documentation at:

https://your-server/swagger-ui/

Swagger UI lets you inspect request/response schemas, authentication requirements, and test requests against your own deployment. The raw OpenAPI document is available at:

https://your-server/api-docs/openapi.json

Response Format

Successful REST responses are wrapped as:

{
  "data": {}
}

Errors use:

{
  "error": "Error message describing what went wrong"
}

Authentication

Used by the web dashboard after login:

curl -X POST https://your-server/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"your-password"}' \
  -c cookies.txt

curl https://your-server/api/servers -b cookies.txt

API Key

Use API keys for automation. Create them in Settings → API Keys.

curl https://your-server/api/servers \
  -H "X-API-Key: serverbee_your-api-key-here"

API keys use the serverbee_ prefix and are shown only once when created.

Bearer Session Token

Mobile flows use Bearer tokens for selected REST and WebSocket endpoints:

curl https://your-server/api/auth/me \
  -H "Authorization: Bearer <session-token>"

Public Endpoints

MethodPathDescription
POST/api/auth/loginWeb login
GET/api/auth/oauth/providersList enabled OAuth providers
GET/api/auth/oauth/{provider}OAuth authorization redirect
GET/api/auth/oauth/{provider}/callbackOAuth callback
POST/api/mobile/auth/loginMobile login
POST/api/mobile/auth/refreshRefresh a mobile session
POST/api/mobile/auth/pairRedeem a mobile pairing code
POST/api/agent/registerAgent auto-registration using discovery key
GET/api/statusDefault public status page data
GET/api/status/{slug}Configurable public status page data
GET/api/settings/brandPublic brand settings
GET/api/brand/logoServe uploaded logo
GET/api/brand/faviconServe uploaded favicon

Authenticated Read Endpoints

Read endpoints are available to Admin and Member users unless noted otherwise.

FamilyRepresentative endpoints
Current user and API keysGET /api/auth/me, PUT /api/auth/password, GET/POST /api/auth/api-keys, DELETE /api/auth/api-keys/{id}
2FA and OAuth accounts/api/auth/2fa/*, GET/DELETE /api/auth/oauth/accounts/*
Mobile devicesPOST /api/mobile/auth/logout, GET /api/mobile/auth/devices, DELETE /api/mobile/auth/devices/{id}
ServersGET /api/servers, GET /api/servers/{id}, GET /api/servers/{id}/records, GET /api/servers/{id}/gpu-records
Groups and tagsGET /api/server-groups, GET /api/server-tags
Uptime and trafficGET /api/servers/{id}/uptime-daily, GET /api/servers/{id}/traffic
GeoIPGET /api/geoip/status
Ping tasksGET /api/ping-tasks, GET /api/ping-tasks/{id}/records
Network probes/api/network-probes/*, /api/servers/{id}/network-probes/*
Traceroute resultsGET /api/servers/{id}/traceroute/{request_id}
Files, read-onlyPOST /api/files/{server_id}/list, stat, read, GET /api/files/transfers, GET /api/files/download/{transfer_id}
Docker, read-onlyGET /api/servers/{id}/docker/containers, stats, info, events, networks, volumes
Service monitorsGET /api/service-monitors, GET /api/service-monitors/{id}, GET /api/service-monitors/{id}/records
Status page configGET /api/status-pages
DashboardsGET /api/dashboards, GET /api/dashboards/default, GET /api/dashboards/{id}
ThemesGET /api/themes/*
Cost insightsGET /api/cost/overview, GET /api/servers/{id}/cost-insights
Alert eventsalert event read endpoints used by the dashboard

Admin Write and Management Endpoints

Admin role is required for write operations and system management.

FamilyRepresentative endpoints
Server managementPOST/PUT/DELETE /api/servers/*, PUT /api/servers/batch-capabilities, POST /api/servers/{id}/upgrade
Agent recoveryGET /api/servers/{target_id}/recovery-candidates, GET /api/servers/recovery-jobs/{job_id}, POST /api/servers/{target_id}/recover-merge
Groups and tagsCRUD /api/server-groups/*, CRUD /api/server-tags/*
Ping and network probesCRUD /api/ping-tasks/*, write endpoints under /api/network-probes/*
TraceroutePOST /api/servers/{id}/traceroute
FilesPOST /api/files/{server_id}/write, delete, mkdir, move, download, upload, DELETE /api/files/transfers/{transfer_id}
Docker actionsPOST /api/servers/{id}/docker/containers/{cid}/action
Service monitorsCRUD /api/service-monitors/*, POST /api/service-monitors/{id}/check
DashboardsPOST /api/dashboards, PUT/DELETE /api/dashboards/{id}
Themes and appearancetheme write endpoints, PUT /api/settings/brand, POST /api/settings/brand/logo, POST /api/settings/brand/favicon
Status pagesCRUD /api/status-pages/*
IncidentsCRUD /api/incidents/*, POST /api/incidents/{id}/updates
Maintenance windowsCRUD /api/maintenances/*
Alerts and notificationsCRUD /api/alert-rules/*, /api/notifications/*, /api/notification-groups/*
TasksGET/POST /api/tasks, GET/PUT/DELETE /api/tasks/{id}, GET /api/tasks/{id}/results, POST /api/tasks/{id}/run
UsersCRUD /api/users/*
Audit and settingsGET /api/audit-logs, /api/settings/*, backup/restore endpoints
GeoIPPOST /api/geoip/download
Mobile pushPOST /api/mobile/pair, POST /api/mobile/push/register, POST /api/mobile/push/unregister

WebSocket Endpoints

PathAuthDescription
/api/agent/ws?token=<agent_token>Agent token query parameterAgent metrics, commands, pings, files, Docker, traceroute
/api/ws/serversSession cookie, API key, or Bearer tokenBrowser/mobile real-time server updates
/api/ws/terminal/{server_id}Authenticated Admin + CAP_TERMINALWeb terminal proxy; terminal payloads use binary frames
/api/ws/docker/logs/{server_id}Authenticated + CAP_DOCKERPer-container Docker log streaming

Common Status Codes

CodeMeaning
400Bad request or invalid operation
401Not authenticated
403Forbidden: role, capability, or local agent policy blocks the operation
404Resource not found, server offline, or disabled public page
409Conflict, such as duplicate slug/name
422Validation error
429Rate limited
500Internal server error

On this page