REST API
Observe and control services from IDE plugins, desktop apps, and CLI tools.
The API server is embedded in the fuku process and available during fuku run. Disabled by default. All endpoints except /api/v1/live and /api/v1/ready require Authorization: Bearer <token> header.
| Field | Description |
|---|---|
server.listen | TCP address to bind (must be loopback) |
server.auth.token | Bearer token for authentication |
server:
listen: "127.0.0.1:9876"
auth:
token: "my-dev-token" /api/v1/live Liveness probe. Returns 200 when the API server is reachable. No authentication required.
{ "status": "alive" } /api/v1/ready Readiness probe. Returns 200 once the runtime store has received profile data, 503 before that. No authentication required.
{ "status": "ready" } { "status": "not ready" } /api/v1/status Returns fuku instance information: version, profile, phase, uptime, and service counts.
{
"version": "0.18.0",
"profile": "default",
"phase": "running",
"uptime": 3600,
"services": {
"total": 8,
"starting": 0,
"running": 6,
"stopping": 0,
"restarting": 0,
"stopped": 1,
"failed": 1
}
} { "error": "unauthorized" } { "error": "internal server error" } /api/v1/services Returns all services in the active profile, ordered by tier then name.
{
"services": [
{
"id": "550e8400-...",
"name": "api-gateway",
"tier": "foundation",
"status": "running",
"watching": true,
"pid": 12345,
"cpu": 2.4,
"memory": 67108864,
"uptime": 3600
}
]
} { "error": "unauthorized" } { "error": "internal server error" } /api/v1/services/:id Returns a single service by UUID.
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "api-gateway",
"tier": "foundation",
"status": "running",
"watching": true,
"pid": 12345,
"cpu": 2.4,
"memory": 67108864,
"uptime": 3600
} { "error": "unauthorized" } { "error": "service not found" } { "error": "internal server error" } /api/v1/services/:id/start Starts a stopped or failed service. Asynchronous — poll GET /services/:id for completion.
{
"id": "550e8400-...",
"name": "api-gateway",
"action": "start",
"status": "starting"
} { "error": "unauthorized" } { "error": "service not found" } { "error": "service cannot be started" } { "error": "instance is not accepting actions" } { "error": "internal server error" } /api/v1/services/:id/stop Stops a running service. Asynchronous — poll GET /services/:id for completion.
{
"id": "550e8400-...",
"name": "api-gateway",
"action": "stop",
"status": "stopping"
} { "error": "unauthorized" } { "error": "service not found" } { "error": "service is not running" } { "error": "instance is not accepting actions" } { "error": "internal server error" } /api/v1/services/:id/restart Restarts a running, stopped, or failed service. Asynchronous — poll GET /services/:id for completion.
{
"id": "550e8400-...",
"name": "api-gateway",
"action": "restart",
"status": "restarting"
} { "error": "unauthorized" } { "error": "service not found" } { "error": "service cannot be restarted" } { "error": "instance is not accepting actions" } { "error": "internal server error" } Common Errors | Status | Error | When |
|---|---|---|
401 | unauthorized | Missing or invalid bearer token |
404 | service not found | Unknown UUID |
409 | service cannot be started | Start on non-stopped service |
409 | service is not running | Stop on non-running service |
409 | service cannot be restarted | Restart on starting/stopping/restarting service |
409 | instance is not accepting actions | Action during startup or shutdown |