Skip to main content
The PopLock API is a single-file, zero-dependency Node.js HTTP server built on Node’s built-in modules. It exposes a REST interface for reading server state and issuing management commands. The service runs as a systemd unit and survives reboots. Default port: 6767

Base URL

http://<your-server-ip>:6767

Endpoint tiers

The API splits its routes into two tiers:
  • Public read endpoints — all GET routes. No authentication required. Safe to call from any client.
  • Secured write endpoints — all POST routes. Require an X-API-Key header carrying your configured secret key.
See Authentication for details on how to pass the key.

Endpoint map

Read endpoints (public)

MethodRouteDescription
GET/Plain text servreport output
GET/apiEndpoint index and API version
GET/api/statusOnline/offline status, version, uptime, memory
GET/api/players/onlineList of currently online players
GET/api/players/whitelistFull whitelist
GET/api/logs/latest?lines=200Latest server log (adjustable line count)
GET/api/logs/snapshot?lines=200Snapshot cron log
GET/api/backupsAll backups listed with size and type
GET/api/propertiesserver.properties as JSON
GET/api/reportservreport as JSON

Write endpoints (secured — require X-API-Key)

MethodRouteDescription
POST/api/server/startStart the Minecraft server
POST/api/server/stopStop the Minecraft server
POST/api/server/restartRestart the Minecraft server
POST/api/commandSend a console command (body: {"command": "say hello"})
POST/api/whitelist/addAdd player to whitelist (body: {"player": "username"})
POST/api/whitelist/removeRemove player from whitelist (body: {"player": "username"})
POST/api/backupTrigger a silent background backup
For full request and response details, see Read endpoints and Write endpoints.

Get started

Installation

Copy the files, generate an API key, and start the systemd service.

Authentication

Learn how to pass your API key and handle auth errors.