β¬… Dashboard πŸ“Š Status
API Reference
Tutte le risorse sono relative a http://<host>:3080 β€” risposta sempre in JSON
Checks
GET /api/checks Lista tutti i check con stato corrente
[
  {
    "id":               "dmdesk",
    "name":             "DmDesk CMS",
    "url":              "https://desk-robin.cloud.atex.com/desk/#/",
    "type":             "HTTPS",
    "status":           "ok",        // "ok" | "ko" | "unknown"
    "phase":            3,
    "uptime_pct":       99.2,
    "last_response_ms": 4821,
    "last_checked_at":  "2026-05-03T10:00:00.000Z",
    "last_root_cause":  null,
    "last_ts":          1746266400000,
    "last_phase_data":  { "navigate_ms": 1200, "login_ms": 3800 }
  }
]
GET /api/checks/:id/history Storico risultati di un check
ParamTipoDescrizione
id reqstringID del check (es. dmdesk, video-encoding)
ParamTipoDefaultDescrizione
days optinteger7Giorni di storico (max 30)
[
  {
    "id":          1234,
    "check_id":    "dmdesk",
    "status":      "ok",
    "phase":       3,
    "response_ms": 4821,
    "root_cause":  null,
    "phase_data":  "{\"navigate_ms\":1200}",
    "ts":          1746266400000
  }
]
POST /api/checks/:id/run Esegui un check manualmente
ParamTipoDescrizione
id reqstringID del check
{
  "status":      "ok",
  "phase":       3,
  "response_ms": 4821,
  "root_cause":  null,
  "ts":          1746266400000
}
GET /test/:id Risultato rapido dell'ultimo check (cache in memoria)
{
  "status":      "OK",         // "OK" | "KO" | "PENDING"
  "phase":       3,
  "response_ms": 4821,
  "root_cause":  null,
  "checked_at":  "2026-05-03T10:00:00.000Z"
}
Restituisce 202 PENDING se il check non Γ¨ ancora stato eseguito dall'avvio del server.
GET /api/health Health check del server
{ "ok": true, "uptime": 3600.5 }
Status Page
GET /api/status Stato aggregato per la status page pubblica (90 giorni)
{
  "global":     "operational",  // "operational" | "outage"
  "updated_at": "2026-05-03T10:00:00.000Z",
  "services": [
    {
      "id":             "dmdesk",
      "name":           "DmDesk CMS",
      "status":         "operational",
      "uptime_30d":     99.85,
      "uptime_90d":     99.71,
      "last_checked_at": "2026-05-03T10:00:00.000Z",
      "daily":          [ { "date": "2026-05-03", "ok": 288, "total": 288, "pct": 100 } ],
      "incidents":      []
    }
  ]
}
GET /api/external/dailymotion-status Proxy per lo stato ufficiale Dailymotion (evita CORS)
{ "indicator": "none", "description": "All Systems Operational" }
indicator: none = tutto ok Β· minor Β· major Β· critical
Alert Log
GET /api/alerts/log Ultimi alert inviati (Telegram + Push)
ParamTipoDefaultDescrizione
limit optinteger50Numero massimo di righe (max 100)
[
  {
    "id":       42,
    "check_id": "dmdesk",
    "channel":  "telegram",   // "telegram" | "push"
    "event":    "down",        // "down" | "up"
    "payload":  "Timeout fase 2",
    "sent_at":  1746266400000
  }
]
Telegram
GET /api/telegram Stato configurazione Telegram
{ "configured": true, "chat_id": "-100123456789", "verified": true }
POST /api/telegram/setup Configura bot Telegram
CampoTipoDescrizione
bot_token reqstringToken del bot Telegram
chat_id reqstringID del gruppo o canale destinatario
POST /api/telegram/verify Invia messaggio di test e marca come verificato
Nessun body richiesto. Restituisce {"ok": true} se il messaggio Γ¨ stato inviato.
DELETE /api/telegram Rimuove la configurazione Telegram
Nessun body richiesto. Restituisce {"ok": true}.
Push Notifications
GET /api/push/vapid-public-key Chiave pubblica VAPID per la registrazione push
{ "key": "BNx8..." }
Se la variabile VAPID_PUBLIC_KEY non Γ¨ configurata, key sarΓ  null.
POST /api/push/subscribe Registra una sottoscrizione push
CampoTipoDescrizione
endpoint reqstringURL endpoint push del browser
keys.p256dh reqstringChiave pubblica del client
keys.auth reqstringSecret di autenticazione
label optstringEtichetta per identificare il dispositivo
DELETE /api/push/unsubscribe Rimuove una sottoscrizione push
CampoTipoDescrizione
endpoint reqstringURL endpoint da rimuovere
Chatbot
POST /api/chat Invia una domanda all'assistente AI
CampoTipoDescrizione
question reqstringTesto della domanda
session_id optstringID sessione per tracciare il feedback
{
  "answer": "DmDesk CMS Γ¨ attualmente operativo...",
  "source": "ai"   // "ai" | "cache" | "error"
}
POST /api/chatbot/feedback Invia feedback su una risposta AI
CampoTipoDescrizione
question reqstringDomanda originale
ai_answer reqstringRisposta AI ricevuta
session_id optstringID sessione
rating optintegerValutazione (es. 1 = positivo, -1 = negativo)
correction optstringTesto correttivo fornito dall'utente
GET /api/chatbot/qa Lista voci della knowledge base
ParamTipoDefaultDescrizione
approved opt0 | 10Se 1, restituisce solo le voci approvate
[
  {
    "id":       1,
    "question": "Cosa fare se DmDesk Γ¨ down?",
    "answer":   "Procedura intervento...",
    "source":   "runbook",  // "ai" | "manual" | "runbook"
    "approved": 1,
    "ts":       1746266400000
  }
]
POST /api/chatbot/qa Aggiunge manualmente una voce alla knowledge base
CampoTipoDescrizione
question reqstringDomanda
answer reqstringRisposta
approved optbooleanApprova immediatamente (default: false)
POST /api/chatbot/qa/:id/approve Approva una voce Q&A (la rende attiva nel system prompt)
Nessun body. Restituisce {"ok": true}.
DELETE /api/chatbot/qa/:id Elimina una voce Q&A dalla knowledge base
Nessun body. Restituisce {"ok": true}.
Check ID di riferimento
IDNomeFrequenza
dmdeskDmDesk CMSogni 5 min
frontpageDmDesk Frontpageogni 5 min
desk-agenzieDmDesk Agenzieogni 5 min
article-previewDmDesk Article Previewogni 10 min
video-encodingDmDesk Video Encodingogni 10 min
dailymotionDailymotion Statusogni 5 min