Skip to main content

API Schema

This page describes the concrete request and response shapes exposed by Runix's current interfaces.

Web REST API​

The web dashboard exposes JSON endpoints under /api/v1.

Process Object​

Most endpoints return ProcessInfo JSON with this shape:

{
"id": "abc12345",
"numeric_id": 1,
"name": "api",
"namespace": "backend",
"instance_index": 0,
"runtime": "go",
"state": "running",
"pid": 48291,
"exit_code": 0,
"restarts": 0,
"created_at": "2026-04-15T20:00:00Z",
"started_at": "2026-04-15T20:00:01Z",
"config": {},
"cpu_percent": 0.4,
"memory_bytes": 14876672,
"mem_percent": 0.1,
"threads": 9,
"fds": 12,
"tags": ["api"],
"uptime": 30000000000
}

Important encoding details:

  • state is one of starting, running, stopping, stopped, crashed, errored, waiting
  • uptime is serialized as a nanosecond count
  • config is the full nested ProcessConfig

GET /api/v1/processes​

Response: array of ProcessInfo.

GET /api/v1/processes/{id}​

Response: one ProcessInfo.

Not found response:

{
"error": "process not found"
}

POST /api/v1/processes​

Request body: ProcessConfig JSON.

Minimal example:

{
"name": "api",
"runtime": "go",
"entrypoint": "./cmd/api",
"cwd": "."
}

Success response: created ProcessInfo with HTTP 201.

POST /api/v1/processes/{id}/stop​

Query parameters:

NameTypeDefaultNotes
forceboolfalseSends force-stop behavior
timeoutduration string5sParsed with Go time.ParseDuration

Success response:

{
"status": "stopped"
}

POST /api/v1/processes/{id}/restart​

Success response:

{
"status": "restarted"
}

POST /api/v1/processes/{id}/reload​

Success response:

{
"status": "reloaded"
}

DELETE /api/v1/processes/{id}​

Success response:

{
"status": "deleted"
}

GET /api/v1/processes/{id}/logs​

Query parameters:

NameTypeDefault
linesinteger50

Success response:

{
"logs": "last log lines...",
"path": "api.log",
"lines": "50"
}

GET /api/v1/system/metrics​

Response: system metrics object from internal/metrics. Exact fields depend on the running platform and collector output.

WebSocket Schema​

The dashboard listens on /ws and receives process_list messages:

{
"type": "process_list",
"processes": [
{
"id": "abc12345",
"numeric_id": 1,
"name": "api",
"runtime": "go",
"state": "running",
"pid": 48291,
"exit_code": 0,
"restarts": 0,
"cpu_percent": 0.4,
"memory_bytes": 14876672,
"mem_percent": 0.1,
"threads": 9,
"fds": 12,
"uptime": 30000000000
}
],
"timestamp": 1760000000
}

Daemon IPC Schema​

The CLI talks to the daemon over HTTP on a Unix socket using a shared envelope.

Request Envelope​

{
"action": "start",
"payload": {}
}

Response Envelope​

{
"success": true,
"data": {},
"error": ""
}

Supported Actions​

ActionPayload
startStartPayload
start_allStartAllPayload
stopStopPayload
restarttarget string payload handled by daemon
reloadtarget string payload handled by daemon
deletetarget string payload handled by daemon
listoptional empty payload
statustarget string payload handled by daemon
logsLogsPayload
saveoptional empty payload
resurrectoptional empty payload
pingno auth required
cron_listCronPayload or empty payload
cron_startCronPayload
cron_stopCronPayload
cron_runCronPayload
rolling_reloadRollingReloadPayload
config_reloadConfigReloadPayload
web_startWebStartPayload

Named Payload Structs​

{
"name": "api",
"runtime": "go",
"entrypoint": "./cmd/api",
"args": ["--port", "8080"],
"cwd": ".",
"env": {"PORT": "8080"},
"restart_policy": "on-failure",
"max_restarts": 10
}

The example above is StartPayload.

Other daemon payloads:

PayloadFields
StartAllPayloadonly, config
StopPayloadtarget, force, timeout, parallel, graceful
LogsPayloadtarget, lines
CronPayloadname
RollingReloadPayloadtarget, batch_size, wait_ready, rollback_on_failure
WebStartPayloadlisten
ConfigReloadPayloadconfig_path

MCP Tool Schema​

The MCP surface is documented in MCP. Current tool names are:

  • list_apps
  • start_app
  • stop_app
  • restart_app
  • reload_app
  • delete_app
  • get_status
  • get_logs
  • save_state
  • resurrect_processes

Current resource URIs are:

  • apps://list
  • apps://{name}
  • logs://{name}
  • metrics://{name}

Config Schema​

The authoritative configuration structs are documented in: