Skip to main content
Mole managing agents

Agent Endpoints

Query any agent in your mesh from any other agent. Get status, routes, and peer lists without direct access to the remote machine.

Quick examples:

# List all known agents
curl http://localhost:8080/agents

# Get specific agent's status
curl http://localhost:8080/agents/abc123def456/

# See what routes an agent advertises
curl http://localhost:8080/agents/abc123def456/routes

GET /agents

List all known agents in the mesh.

Response:

[
{
"id": "abc123def456789012345678901234ab",
"short": "abc123de",
"display_name": "Agent 1",
"local": true
},
{
"id": "def456789012345678901234567890cd",
"short": "def45678",
"local": false
}
]

GET /agents/{agent-id}

Get status from specific agent.

Response:

{
"id": "abc123...",
"display_name": "Agent 1",
"uptime": 3600,
"peers": 3,
"streams": 42,
"routes": 5
}

GET /agents/{agent-id}/routes

Get route table from specific agent.

Response:

{
"routes": [
{
"cidr": "10.0.0.0/8",
"next_hop": "def456...",
"metric": 1,
"ttl": 300
}
]
}

GET /agents/{agent-id}/peers

Get peer list from specific agent.

Response:

{
"peers": [
{
"id": "def456...",
"address": "192.168.1.20:4433",
"transport": "quic",
"connected": true
}
]
}

GET /agents/{agent-id}/shell

WebSocket endpoint for remote shell access.

See Shell WebSocket API.

GET /agents/{agent-id}/icmp

WebSocket endpoint for ICMP ping sessions.

See ICMP Ping WebSocket API.

POST /agents/{agent-id}/file/upload

Upload file to remote agent.

See File Transfer Endpoints.

POST /agents/{agent-id}/file/download

Download file from remote agent.

See File Transfer Endpoints.