API - SteamServerUI/StationeersServerUI GitHub Wiki

API Documentation

This documentation provides a comprehensive overview of the Game Server API endpoints for server management, authentication, configuration, and monitoring.

Table of Contents

Some endpoints use GET even though other types might be more adequate. This will be addressed.

Authentication

Authentication is required for most API endpoints. Use the login endpoint to obtain an authentication token.

Endpoint Method Description
/auth/login POST Authenticate and obtain an access token

Example Request

{
  "username": "admin",
  "password": "password"
}

Authentication

[!IMPORTANT] If auth is enabled, an access token cookie is required for most API endpoints. Only the login endpoint is public. Use the >login endpoint to obtain an authentication token. If auth is disabled, the Middleware skip the cookie check and the whole API will be public.

Endpoint Method Description
/auth/login POST Authenticate and obtain an access token cookie

Example Request

{
  "username": "admin",
  "password": "password"
}

Server Management

Control the game server status with these endpoints.

Endpoint Method Description
/api/v2/server/start GET Start the game server
/api/v2/server/stop GET Stop the game server
/api/v2/server/status GET Gets the server status in a structured Json format
/start GET (Legacy) Start the game server
/stop GET (Legacy) Stop the game server
/ GET Access the server's HTML interface

Configuration

Manage server configuration settings through this API.

Endpoint Method Description
/setup Access the setup wizard HTML interface
/saveconfigasjson POST form data (Legacy) Update and save server configuration
/api/v2/saveconfig POST JSON Update and save server configuration
none none There is NO endpoint to GET the current config

[!IMPORTANT]
The /saveconfigasjson endpoint only allows config values present on the config page. (Technically it allows any sting value, but just use the /api/v2/saveconfig endpoint please

Configuration Parameters

See Configuration

Backups

Manage server backups with these endpoints.

Endpoint Method Description
/api/v2/backups GET Get a list of all available backups
/api/v2/backups/restore GET Restore a specific backup
/backups GET (Legacy) Get a list of all available backups
/backups/restore GET (Legacy) Restore a specific backup

Restore Backup URL Parameters

Parameter Description Example
index Index of the backup to restore 7

Custom Detections

Create and manage custom event detections for server monitoring.

Endpoint Method Description
/api/v2/custom-detections GET Get all custom detections
/api/v2/custom-detections POST Create a new custom detection
/api/v2/custom-detections/delete/ DELETE Delete a custom detection

Types of Custom Detections

Keyword Detection

Triggers when an exact string is found in logs or events.

{
  "type": "keyword",
  "pattern": "UnloadTime",
  "eventType": "CUSTOM_DETECTION",
  "message": "UnloadTime found"
}

Regex Detection

Uses regular expressions to match patterns and capture groups.

{
  "type": "regex",
  "pattern": "Player (.+) has reached level (\\d+)",
  "eventType": "CUSTOM_DETECTION",
  "message": "Player {1} reached level {2}!"
}

Do NOT use another event type!

Delete Custom Detection Parameters

Parameter Description Example
id UUID of the detection to delete bd923b8c-f773-42ca-baee-e35084e3b989

Real-time Events (SSE)

Monitor server events in real-time using Server-Sent Events.

Endpoint Method Description
/console GET Stream server console output
/events GET Stream server events

Status Codes

Code Description
200 Success
303 See Other (after successful configuration)
400 Bad Request
401 Unauthorized
404 Not Found
405 Method Not Allowed
500 Internal Server Error

Postman

Here you can download Postman collections for all API Endpoints.

V5

V4

1- Login

2- Authenticated UI

3- Start & Stop the Server

4- Configuration API

5- Backups

6- Custom Detections API

7- SSE

Additional Notes

  • All endpoints require an authentication Cookie obtained through the login endpoint
  • The server can be managed both through the API and the web interface
  • Custom detections support both simple keyword matching and complex regex patterns
  • Real-time monitoring is available through SSE endpoints