Skip to Content
πŸŽ‰ EZMON v0.1.3 is released. Visit ezmon.web.id β†’
API Reference

πŸ“– API Reference

Base URL: https://your-hub.vercel.app

All EZMON API endpoints use JSON for requests and responses. The API is divided into two main categories: Agent API (used by monitored servers) and Dashboard API (used by the web interface).


πŸ” Authentication

Authentication differs depending on which endpoint you access:

Agent endpoints (/api/agent/*) require a Bearer Token obtained when first registering the agent in the dashboard.

Authorization: Bearer <agent_token>

Agent tokens are only shown once at registration. Store them securely. On the server side, these tokens are stored as a hash.


πŸ€– Agent Endpoints

These endpoints are designed to be lightweight and are consumed statically by the Go Agent running on your servers.

POST /api/agent/register

Register a new agent into a project. No authentication header required.

{ "projectId": "uuid-project-id", "name": "my-server", "hostname": "server.example.com", "os": "linux", "arch": "amd64" }

POST /api/agent/heartbeat

Update the agent’s online status and refresh the offline_deadline_at. Called every 30 seconds.

{ "agentId": "uuid-agent-id", "heartbeatIntervalSec": 30, "graceMultiplier": 3 }

POST /api/agent/metrics

Send the latest system metrics snapshot (CPU, RAM, Disk, Network).

{ "agentId": "uuid-agent-id", "cpuPercent": 45.2, "memPercent": 62.1, "memUsedMb": 2048, "memTotalMb": 4096, "diskPercent": 38.5, "diskUsedGb": 38.5, "diskTotalGb": 100, "loadAvg1": 0.82, "loadAvg5": 0.75, "loadAvg15": 0.60, "netBytesSent": 1048576, "netBytesRecv": 2097152, "dockerRunning": 3 }

πŸ“Š Dashboard Endpoints

These endpoints support CRUD features used by the Vercel control panel (Next.js App Router).

GET /api/dashboard/overview

Fetch project summary data (agent count, current status, and active incidents).

  • Query Params: projectId (uuid, required)

Incidents

GET /api/dashboard/incidents

Fetch incident history with pagination.

  • Query Params:
    • projectId (required)
    • status: open | resolved | all (default: all)
    • page: Page number (default: 1)
    • limit: Items per page (default: 20)

PATCH /api/dashboard/incidents

Manually close or resolve an incident (Acknowledge).


Projects

GET /api/dashboard/projects

List all projects owned by the current user.

POST /api/dashboard/projects

Create a new monitoring project.

{ "name": "Production Cluster", "slug": "prod-cluster" }

Cloud Monitors

Monitor external HTTP/TLS endpoints (max 20 per project).

GET /api/dashboard/cloud-monitors

List all external monitors.

POST /api/dashboard/cloud-monitors

Create a new monitor.

{ "projectId": "uuid", "name": "API Gateway", "type": "http", "url": "https://api.example.com/health", "intervalSec": 60, "expectedStatus": 200 }

DELETE /api/dashboard/cloud-monitors

Permanently delete a monitor, automatically cascading (deleting) all results.

Last updated on