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
Explain which route an agent would pickPOST /route/trace
Trace route selection on a remote agentPOST /agents/{id}/route/trace
Set or get agent display namePOST /display-name/manage
Manage display name on remote agentPOST /agents/{id}/display-name/manage
Add, remove, or list dynamic peer connectionsPOST /peers/manage
Manage peers on a remote agentPOST /agents/{id}/peers/manage
Add, remove, or list dynamic transport listenersPOST /listeners/manage
Manage listeners on a remote agentPOST /agents/{id}/listeners/manage
Run commands on remote agentsWebSocket /agents/{id}/shell
Transfer files to/from agentsPOST /agents/{id}/file/*
Gracefully stop an agentPOST /shutdown
Stop a remote agentPOST /agents/{id}/shutdown
Test connectivity to all mesh agentsPOST /api/mesh-test
Probe a Muti Metroo listener (dial + handshake)POST /api/probe
Probe a listener from a remote agentPOST /agents/{id}/probe
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
Management CommandsRun management commands (interactive and streaming)
File TransferFile upload/download
DashboardTopology data, dashboard overview, and mesh connectivity test
ProbeConnectivity probe (dial + handshake) for individual listeners

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
  • /, /logo.png, /notfound.png -- splash page assets

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.

Management-key Authorization​

Privileged operations -- management commands, file transfer, every dynamic mutation (routes, peers, forward listeners and endpoints, hosts, display name), and sleep/wake -- additionally require an Ed25519 signature from the mesh management signing key on top of the bearer token. See Management Key Configuration for the full scope and the deployment model. There is no separate per-feature password for these operations.

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"
}

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