Skip to content

API Reference

dev-mondoshawan edited this page Feb 3, 2026 · 1 revision

API Reference

Base URL: http://localhost:8000/api/v1

Authentication

Register User

POST /auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "SecurePass123!",
  "full_name": "John Doe",
  "organization_name": "Acme Corp"
}

Login

POST /auth/login
Content-Type: application/x-www-form-urlencoded

username=user@example.com&password=SecurePass123!

Response:

{
  "access_token": "eyJ...",
  "token_type": "bearer"
}

Get Current User

GET /auth/me
Authorization: Bearer <token>

Agents

Create Agent

POST /agents/
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "My Laptop"
}

Response includes api_key for agent configuration.

List Agents

GET /agents/
Authorization: Bearer <token>

Agent Heartbeat

POST /agents/heartbeat
X-API-Key: mcp_sk_<key>
Content-Type: application/json

{
  "hostname": "laptop.local",
  "os_type": "windows",
  "username": "john",
  "agent_version": "0.1.0"
}

MCP Servers

Report Servers

POST /mcp/report
X-API-Key: mcp_sk_<key>
Content-Type: application/json

{
  "servers": [
    {
      "server_name": "filesystem",
      "server_type": "@modelcontextprotocol/server-filesystem",
      "command": "npx @modelcontextprotocol/server-filesystem /home",
      "scope": "/home",
      "env_vars": ["PATH"]
    }
  ]
}

List Servers

GET /mcp/servers
Authorization: Bearer <token>

Query params: risk_level, status, agent_id

Get Server Details

GET /mcp/servers/{server_id}
Authorization: Bearer <token>

Dashboard

Get Stats

GET /dashboard/stats
Authorization: Bearer <token>

Response:

{
  "total_servers": 47,
  "high_risk": 5,
  "medium_risk": 23,
  "low_risk": 19,
  "active_agents": 12
}

Alerts

List Alerts

GET /alerts/
Authorization: Bearer <token>

Dismiss Alert

POST /alerts/{alert_id}/dismiss
Authorization: Bearer <token>

Health Check

GET /health

Response:

{
  "status": "healthy",
  "version": "0.1.0",
  "database": "connected"
}

Clone this wiki locally