Skip to main content
POST /api/system/update Triggers a self-update: downloads the latest release archive, backs up the current installation, extracts the update in place, and schedules a server restart. The response is returned before the restart occurs.
The server restarts 2 seconds after this endpoint responds. All in-flight connections will be dropped. The AIS stream, scheduler, and carrier tracker restart automatically on the next boot.
Rate limit: 1 request per minute per IP.

Authentication

X-Admin-Key
string
required
Admin authentication key matching the ADMIN_KEY environment variable.

Response

The response body is the result object from perform_update(). Shape depends on outcome:
status
string
required
"ok" if the update completed and a restart is pending. "error" if the update failed.
message
string
Human-readable description of what happened.
version
string
The version that was installed, if available.
backup_path
string
Absolute path to the backup ZIP file created from the current backend/ and frontend/ directories before the update was applied. Stored in a temporary directory.
files_updated
number
Number of files copied from the update archive.
On failure the endpoint returns HTTP 500 and does not schedule a restart. The existing installation is unmodified.

Example

curl -X POST http://localhost:8000/api/system/update \
  -H "X-Admin-Key: your-secret-key"
{
  "status": "ok",
  "version": "v1.4.2",
  "files_updated": 142,
  "backup_path": "/tmp/sb_update_abc123/backup_20240115_120000.zip",
  "message": "Updated to v1.4.2 — 142 files replaced. Restarting..."
}

Build docs developers (and LLMs) love