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/jsonBody:
json
{
"caddyfile": "{\n email admin@example.com\n}\n\napp.example.com {\n reverse_proxy http://backend:8080\n}\n"
}| Code | Description |
|---|---|
200 | { "success": true } |
400 | caddyfile missing from body |
502 | Caddy rejected the configuration |
GET /logs
Read local Caddy access logs.
Headers:
Authorization: Bearer <AGENT_TOKEN>Query params:
| Param | Type | Default | Description |
|---|---|---|---|
domain | string | — | Filter by domain |
status | integer | — | Filter by HTTP code |
page | integer | 1 | Page 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
}