Skip to content

API Overview

LogSys exposes a REST + WebSocket API served by the FastAPI backend on port 8000 (default). All API paths are prefixed with /api (WebSocket endpoints under /ws).


Base URL

Environment URL
Local dev http://localhost:8000
Production https://logsys.dxc.com

OpenAPI docs: GET /docs (Swagger UI) and GET /openapi.json.


Router Map

Router Prefix Purpose
auth /api/auth Login, refresh, logout, current user
logs /api/logs Raw events, templates, time series, calendar
analytics /api/analytics Top sources, severity breakdown, DLQ vs stored
kpis /api/kpis Global KPI aggregates
ai_insights /api/ai-insights ML snapshot engine
incidents /api/incidents Incident lifecycle
alerts /api/alerts Alert rules & firing
sources /api/sources Data source CRUD + ephemeral upload
applications /api/applications Application grouping
monitoring /api/monitoring Health, collectors, clear-all
tasks /api/tasks Task/assignee management
users /api/users User & role management
ws /ws/kpis Real-time KPI push

Pagination

Logs endpoints use keyset (cursor) pagination — O(limit) instead of O(offset + limit):

{
  "items": [ … ],
  "next_cursor": "eyJ0cyI6IjIwMjYt…",
  "has_more": true
}

Pass next_cursor back as the cursor query parameter for the next page.


Rate Limiting

Rates are enforced with slowapi + Redis. Clients receive 429 Too Many Requests with a Retry-After header.

Limit Scope
login_limit /api/auth/login
refresh_limit /api/auth/refresh
source_create_limit /api/sources (create + ephemeral)
clear_all_limit /api/monitoring/clear-all
ws_limiter /ws/kpis (per IP)

Common Error Format

All errors share a consistent envelope:

{
  "detail": {
    "message": "Événement introuvable",
    "code": "not_found",
    "details": { "event_id": 42 }
  }
}
HTTP Common codes
401 invalid_credentials, invalid_refresh_token
403 forbidden, account_disabled
404 not_found
409 source_already_exists, application_name_conflict
413 file_too_large
422 file_parse_error, empty_file, validation errors
429 rate limit exceeded

WebSocket

/ws/kpis pushes live KPI snapshots. See WebSocket for auth and message format.