Skip to content

Agent API

Base URL: agent root (default port 3002).

All routes (except /health) require an Authorization: Bearer <AGENT_TOKEN> header.

GET /health

Health check. No authentication required.

Response: 200

json
{ "status": "ok" }

POST /caddy/reload

Reload the Caddy configuration with a new Caddyfile.

Headers:

Authorization: Bearer <AGENT_TOKEN>
Content-Type: application/json

Body:

json
{
  "caddyfile": "{\n  email admin@example.com\n}\n\napp.example.com {\n  reverse_proxy http://backend:8080\n}\n"
}
CodeDescription
200{ "success": true }
400caddyfile missing from body
502Caddy rejected the configuration

GET /logs

Read local Caddy access logs.

Headers:

Authorization: Bearer <AGENT_TOKEN>

Query params:

ParamTypeDefaultDescription
domainstringFilter by domain
statusintegerFilter by HTTP code
pageinteger1Page number

Response: 200

json
{
  "logs": [
    {
      "timestamp": "2025-01-15T10:30:00.000Z",
      "domain": "app.example.com",
      "method": "GET",
      "path": "/",
      "status": 200,
      "latency": "5.2ms",
      "ip": "192.168.1.1"
    }
  ],
  "total": 42,
  "page": 1,
  "pageSize": 50
}