Skip to content

Agent API

Base URL : racine de l'agent (par defaut port 3002).

Toutes les routes (sauf /health) necessitent un header Authorization: Bearer <AGENT_TOKEN>.

GET /health

Health check. Pas d'authentification requise.

Reponse : 200

json
{ "status": "ok" }

POST /caddy/reload

Recharger la configuration Caddy avec un nouveau Caddyfile.

Headers :

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

Body :

json
{
  "caddyfile": "{\n  email admin@exemple.com\n}\n\napp.exemple.com {\n  reverse_proxy http://backend:8080\n}\n"
}
CodeDescription
200{ "success": true }
400caddyfile manquant dans le body
502Caddy a refuse la configuration

GET /logs

Lire les logs d'acces Caddy locaux.

Headers :

Authorization: Bearer <AGENT_TOKEN>

Query params :

ParamTypeDefaultDescription
domainstringFiltrer par domaine
statusintegerFiltrer par code HTTP
pageinteger1Numero de page

Reponse : 200

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