Skip to main content
Mole connecting APIs

HTTP API Reference

Query agent status, trigger actions, and build integrations. Every agent exposes an HTTP API for monitoring and management.

Quick reference:

I want to...Endpoint
Check if an agent is runningGET /healthz
See all agents in the meshGET /agents
Push route updates immediatelyPOST /routes/advertise
Add, remove, or list dynamic routesPOST /routes/manage
Manage routes on a remote agentPOST /agents/{id}/routes/manage
Set or get agent display namePOST /display-name/manage
Manage display name on remote agentPOST /agents/{id}/display-name/manage
Run commands on remote agentsWebSocket /agents/{id}/shell
Transfer files to/from agentsPOST /agents/{id}/file/*
Test connectivity to all mesh agentsPOST /api/mesh-test
Get topology for visualizationGET /api/topology

Base URL

http://localhost:8080

Configure via:

http:
enabled: true
address: ":8080"

Endpoint Categories

CategoryPurpose
HealthHealth checks and readiness probes
AgentsRemote agent status and management
RoutesRoute management and triggers
ShellRemote shell access (interactive and streaming)
File TransferFile upload/download
DashboardTopology data, dashboard overview, and mesh connectivity test

Authentication

Bearer Token (API-wide)

When http.token_hash is configured, all non-health endpoints require a bearer token:

Authorization: Bearer <token>

Exempt endpoints (always accessible without a token):

  • /health, /healthz, /ready -- health probes
  • / and /logo.png -- splash page

Query parameter fallback for WebSocket clients that cannot set headers:

ws://localhost:8080/agents/{id}/shell?token=<token>

CLI usage:

# Flag
muti-metroo status --token my-secret-token

# Environment variable
export MUTI_METROO_TOKEN=my-secret-token
muti-metroo status

Generate a token hash:

muti-metroo hash
# Paste the output into config:
# http:
# token_hash: "$2a$10$..."

When token_hash is empty (default), no API-wide authentication is enforced.

Feature-specific Authentication

Shell and file transfer endpoints have their own password authentication when configured (shell.password_hash, file_transfer.password_hash).

Response Formats

  • JSON: Most endpoints return JSON
  • Plain text: Health checks return plain text
  • Binary: File downloads return binary data

Error Responses

{
"error": "error message",
"code": "ERROR_CODE"
}

Common HTTP status codes:

  • 200 OK: Success
  • 400 Bad Request: Invalid request
  • 401 Unauthorized: Authentication failed
  • 404 Not Found: Resource not found
  • 500 Internal Server Error: Server error