All API endpoints are served on the dashboard host (default: https://roji.dev.localhost).

Endpoints

EndpointMethodDescription
/_api/healthGETHealth check
/healthzGETAlias for /_api/health
/_api/statusGETDetailed status (version, uptime, certificates, Docker)
/_api/routesGETList all registered routes
/_api/projectsGETList active and inactive projects
/_api/eventsGETSSE stream for real-time route updates
/_api/logsGETRecent request logs (last 100)
/_api/logs/eventsGETSSE stream for real-time log updates
/_api/logs/exportGETExport logs as JSON or CSV
/_api/containers/{id}/restartPOSTRestart a container
/_api/projects/{name}/upPOSTStart project (docker compose up -d)
/_api/projects/{name}/downPOSTStop project (docker compose down)
/_api/projects/{name}/restartPOSTRestart all services in project
/_api/projects/{name}/logsGETStream project logs (SSE)
/_api/projects/{name}/deleteDELETERemove project from history
/_api/config/reloadPOSTReload config file

Health Check

curl -s https://roji.dev.localhost/_api/health
{"status": "healthy", "routes": 5}

Status values:

StatusDescription
healthyAll systems operational
degradedCertificates expiring within 30 days
unhealthyDocker connection lost

Log Export

Export request logs with optional filters:

# JSON format
curl -s "https://roji.dev.localhost/_api/logs/export?format=json"

# CSV format with filters
curl -s "https://roji.dev.localhost/_api/logs/export?format=csv&service=myapp&method=GET"

Query parameters:

ParameterDescription
formatjson (default) or csv
serviceFilter by service name
hostFilter by hostname
methodFilter by HTTP method
fromStart time (RFC 3339)
toEnd time (RFC 3339)

SSE Streams

Route Events (/_api/events)

Sends events when routes are added, updated, or removed:

const es = new EventSource("https://roji.dev.localhost/_api/events");
es.onmessage = (event) => {
  const routes = JSON.parse(event.data);
  console.log("Routes updated:", routes);
};

Log Events (/_api/logs/events)

Streams request log entries in real-time:

const es = new EventSource("https://roji.dev.localhost/_api/logs/events");
es.onmessage = (event) => {
  const log = JSON.parse(event.data);
  console.log(`${log.method} ${log.url} -> ${log.status}`);
};

CORS

API endpoints support cross-origin requests from any *.dev.localhost subdomain, allowing API calls from services proxied through roji.