Riferimento API
API di Amministrazione
Endpoint di fatturazione, SSO, audit, notifiche e regole di escalation.
Fatturazione
| Metodo | Endpoint | Descrizione |
|---|---|---|
GET | /api/v1/admin/billing/plan | Piano attuale del tenant |
PUT | /api/v1/admin/billing/plan | Cambiare piano |
GET | /api/v1/admin/billing/usage | Utilizzo del periodo |
GET | /api/v1/admin/billing/usage/history | Storico utilizzo mensile |
GET | /api/v1/admin/billing/invoices | Elenco fatture |
Esempio di risposta sull'utilizzo:
{
"agents": { "used": 3, "limit": 5 },
"events": { "used": 4200, "limit": 10000 },
"storage_mb": { "used": 312, "limit": 1024 },
"period_start": "2026-03-01T00:00:00Z",
"period_end": "2026-03-31T23:59:59Z"
}SSO
| Metodo | Endpoint | Descrizione |
|---|---|---|
GET | /api/v1/admin/sso/config | Ottieni configurazione SSO |
POST | /api/v1/admin/sso/config | Configura SAML SSO |
PUT | /api/v1/admin/sso/config | Aggiorna configurazione |
DELETE | /api/v1/admin/sso/config | Disattiva SSO |
POST | /api/v1/admin/sso/login | Avvia flusso SSO |
POST | /api/v1/admin/sso/callback | Callback ACS (risposta IdP) |
Gli endpoint SSO richiedono il piano Enterprise e il permesso
manage_settings.Audit
| Metodo | Endpoint | Descrizione |
|---|---|---|
GET | /api/v1/admin/audit | Elenco registri |
GET | /api/v1/admin/audit/export | Esporta per conformita |
GET | /api/v1/admin/audit/resource/{resource_type}/{resource_id} | Cronologia risorsa |
GET | /api/v1/admin/audit/verify-chain | Verifica integrita |
Filtri disponibili per l'elenco:
| Parametro | Tipo | Descrizione |
|---|---|---|
resource_type | string | Tipo di risorsa |
resource_id | string | ID della risorsa |
action | string | create, update, delete |
actor | string | ID dell'attore |
start_date | date | Inizio dell'intervallo |
end_date | date | Fine dell'intervallo |
Notifiche
| Metodo | Endpoint | Descrizione |
|---|---|---|
GET | /api/v1/admin/notifications | Elenco notifiche |
POST | /api/v1/admin/notifications | Crea notifica |
PUT | /api/v1/admin/notifications/{notification_id}/read | Segna come letta |
PUT | /api/v1/admin/notifications/read-all | Segna tutte come lette |
GET | /api/v1/admin/notifications/preferences | Preferenze dell'utente |
PUT | /api/v1/admin/notifications/preferences | Aggiorna preferenze |
Tipi di notifica: alert, task, maintenance, system, billing.
Canali disponibili: in_app, email, whatsapp, push.
Regole di Escalation
Le regole definiscono come vengono escalati gli avvisi non gestiti:
| Metodo | Endpoint | Descrizione |
|---|---|---|
GET | /api/v1/admin/escalation-rules | Elenco regole |
POST | /api/v1/admin/escalation-rules | Crea regola |
PUT | /api/v1/admin/escalation-rules/{rule_id} | Aggiorna regola |
DELETE | /api/v1/admin/escalation-rules/{rule_id} | Elimina regola |
{
"name": "Escala allarmi critici",
"trigger": { "event_type": "alarm", "severity": "critical", "unattended_minutes": 30 },
"actions": [
{ "type": "notify", "target": "user_supervisor_id", "channel": "whatsapp" },
{ "type": "reassign", "target": "user_supervisor_id" }
]
}Le regole di escalation vengono valutate ogni minuto. Assicurati che i tempi di escalation siano ragionevoli per evitare notifiche eccessive.