REST API Reference
Complete reference for all HTTP endpoints.
12 min readAll endpoints require JWT authentication unless noted otherwise. Send the token in an Authorization: Bearer <token> header. Obtain a token via POST /api/auth/login or the registration flow.
Health & Configuration
Diagnostic endpoints for monitoring server state. Health endpoints are safe to poll frequently and do not mutate data.
{ status, uptime_s, db }X-Health-Key header to bypass authentication entirely.{ status, uptime_s, db, cpu, memory, disk, containers, connected_clients, version }{ chat, markers, files, overlays, voice, federation } — each booleanAuthentication
Endpoints for retrieving auth configuration and obtaining JWT tokens. When AUTH_REQUIRED=false is set on the server, tokens are still issued but route guards are relaxed.
{ auth_required: boolean }{ callsign, password }Returns:
{ token, user: { id, callsign, role } }
Users
User registration and roster management. The first user to register is automatically promoted to the admin role.
password field is optional when the server is in open-access mode.{ callsign, password? }Returns:
{ token, user: { id, callsign, role } }
{ id, callsign, role, last_position, last_seen_at }observer, operator, and admin. Connected sessions reflect the new role immediately via Socket.IO.{ role }Positions
Position history is stored in the positions table and pruned by the scheduled retention job. Live position updates flow over WebSocket; this REST endpoint is for historical track retrieval.
LineString feature, ordered chronologically. Useful for rendering track trails on the map.hours — lookback window in hours (default: 1, max: 72)Returns: GeoJSON
Feature<LineString> with recorded_at timestamps in properties
Chat
Channel discovery, history retrieval, and direct message setup. Real-time message delivery uses the chat:message Socket.IO event rather than REST.
{ id, name, type, unread_count, last_message }{ name, member_ids: string[] }id of the oldest message received as the before cursor to load the next page.limit (default: 50), before (message ID cursor)Returns:
{ messages: [...], has_more: boolean }
{ user_id }Markers
Markers are map features that unify points, lines, and polygons into a single system. Each marker has a marker_type (point, line, or polygon), optional name and category, and GeoJSON geometry stored in PostGIS. All mutation endpoints broadcast real-time updates via Socket.IO.
geometry field must be a valid GeoJSON geometry object (Point, LineString, or Polygon). Point markers support name, category, description, and photo attachments.{ marker_type, geometry: GeoJSON.Geometry, name?, category?, description?, properties? }lat, lng, and radius (metres).marker_type, category, bbox=west,south,east,north, lat, lng, radius
{ marker_type?, geometry?, name?, category?, description?, properties? }marker:deleted to all connected clients.Files
File upload, download, rename, and deletion with metadata stored in PostgreSQL and binaries on a persistent Docker volume. The MIME allowlist permits GeoJSON, GPX, KML, images, audio, video, and common document types.
multipart/form-data. The server validates the MIME type against the allowlist and stores the file on the persistent volume. Broadcasts file:created to all clients.multipart/form-data with file field{ files: [...], total_bytes, file_count }Content-Disposition: attachment to trigger a browser download. Authentication is required.FeatureCollection along with a computed bounding box. Used by the overlay system to preview spatial files before enabling them as map layers.{ geojson: FeatureCollection, bbox: [west, south, east, north] }file:updated to all clients.{ "filename": "new-name.ext" }Overlays
Overlays render uploaded spatial files as interactive map layers. Both vector overlays (GeoJSON, GPX) and georeferenced raster image overlays are supported.
overlay:created to all clients.{ file_id, name?, style? }color, opacity, line_width. For image overlays: opacity and corners (four-corner georeferencing coordinates).{ color?, opacity?, line_width?, corners? }overlay:removed to all connected clients.Admin
All admin endpoints require the admin role. They power the web-based admin dashboard and are not intended for general client use.
level (e.g. warn, error), search (substring match)include=positions,chat,markers — comma-separated listSetup
Setup endpoints are used exclusively by the first-run wizard. Once setup is complete, the PUT /api/setup/complete endpoint locks these routes.
{ setup_complete: boolean, server_name, version, auth_required }