API — Overview
The SOCSuite API is a REST API (Go + Fiber v2) with a WebSocket endpoint for real-time events.
:::info [Interactive documentation] The full OpenAPI specification with request/response schemas, try-it-out and examples:
Swagger UI (Prod): https://socsuite.dev.imvee.de/api-docs/
# Local: start backend → Swagger UI at http://localhost:8080/api-docs/
make dev:::
Authentication
| Type | Usage | Credential |
|---|---|---|
| Session (BFF) | Browser user via Keycloak | httpOnly cookie (automatic) |
| API Key | Satellite agents (/v1/ingest/**) + public integration API (/v1/public/**) | Authorization: Bearer <API_KEY> (integration: imvk_…, or X-API-Key) |
| Enrollment Token | Agent first registration (/v1/ingest/enroll) | In request body |
All endpoints except /health/* and /v1/ingest/enroll require authentication.
The public integration API (/v1/public/**, DEV-441) accepts API keys only
(never sessions) and sits outside the license gates.
See Authentication for details on the BFF pattern and token handling.
URL Model & Routing
The API is reachable under two path forms (same endpoints):
| Path | Used by | Gateway behavior |
|---|---|---|
/api/v1/... | UI (browser, session) | HTTPRoute: /api is stripped (/api/v1/x → /v1/x at the service) |
/v1/... | Satellite agents, integration API (API key) | Passthrough, no strip |
Routing runs on Gateway-API HTTPRoutes (one per domain, longest prefix wins;
catch-all /api/v1 → core service). The legacy Ingress resource is a transition
state — details in the architecture docs. Live reference: dev cluster, verified
2026-11-07 (DEV-1219/1221).
Endpoint Domains
| Domain | Endpoints | Description |
|---|---|---|
| Auth & Sessions | 10 | PKCE login, logout, token refresh, session management |
| License | 3 | license status, activation (admin), history (DEV-440) → Licensing & Feature Gates |
| Users & Profile | 12 | User management, settings, avatar, password |
| Alerts | 9 | Alert CRUD, status, stats aggregation, OpenSearch webhook, Entity Flow (attacker → target system → asset, DEV-1257) |
| Cases & Incident Response | 22 | Cases, timeline, evidence, comments, post-incident review |
| Tasks | 5 | Task CRUD |
| Tickets & SLA | 21 | Ticket management (types: incident, approval, manual_task), approval workflow (approve/reject), assign/unassign (DEV-161), audit timeline, comments, SLA policies, SLA breaches |
| Vulnerability Management | 21 | Vulnerabilities (search/filter incl. status sub-tabs active/resolved/accepted, assets, categories), scans, CVE enrichment, risk scores, risk acceptance with expiry (DEV-184) |
| Assets (SecBase) | 14 | Asset inventory, metrics, applications, connections, security overview, open-ports/software aliases |
| Agent Lifecycle | 9 | Enrollment, heartbeat, status, restart, decommission |
| Agent Management | 11 | Agent details, error history, metrics, live status, open ports, installed software |
| Agent Enrollment Tokens | 4 | Token CRUD, statistics |
| Agent API Keys | 3 | Key rotation, status, auto-rotate |
| Agent Updates | 4 | Software updates, config updates, update history |
| Agent Data Ingestion | 5 | Logs, inventory, metrics, vulnerability scans |
| Agent EDR | 6 | Detections, quarantine, processes, isolation |
| Agent Device Control | 4 | USB events, policies, blocking |
| Agent FIM | 5 | File changes, baseline, watched paths |
| Missions | 9 | Mission CRUD, assignment, WebSocket events |
| Detection Rules | 7 | Rule CRUD, OpenSearch sync |
| Playbooks & Automation | 11 | Playbooks, templates, execution history, execution detail incl. node steps & decision chain (DEV-196) |
| Workflows | 5 | Workflow CRUD |
| Automation | 6 | Action catalogue, custom actions, scheduled jobs |
| Threat Intelligence | 9 | IOC CRUD, enrichment, STIX export |
| Threat Feeds | 6 | TAXII, MISP, custom feeds |
| MITRE ATT&CK | 6 | Tactics, techniques, alert mapping, coverage, active attack vectors |
| Threat Hunting | 11 | Campaigns, query library, AI generation |
| UBA | 7 | Baseline, anomalies, risk score, peer group |
| Compliance | 10 | Frameworks (ISO 27001, NIS2, GDPR, SOC2), reports, audit evidence |
| Dashboards & KPIs | 11 | Custom dashboards, widgets, MTTD, MTTR, SLA |
| Notifications | 5 | Notifications, settings, activity feed |
| Monitoring & Terminal | 7 | Services, container logs, health, WebSocket terminal |
| Settings | 13 | API tokens, connectors, security policy, SIEM |
| Integrations | 6 | EDR, firewall, SIEM, connector marketplace |
| AI Assistant | 8 | Alert triage, action recommendations, NL2SQL, Ollama models, AI-Situation (posture summary + chat, DEV-392) |
| Audit & System | 6 | Audit logs, health checks, Prometheus metrics |
| Demo (dev-only) | 1 | Curated demo story reset (development only, superadmin) |
| Public Integration API | 1 | /v1/public/instance — instance identity for customer tools (API-key auth, DEV-441 WP5) |
Counting method: The endpoint numbers are representative feature counts (as of 2026-11-07, DEV-1221), not exact route counts — the authoritative, complete list (incl. parameters & schemas) is the Swagger spec above. Verification: all domains probed live (admin session); endpoints exist and respond (exception: 4 endpoints with dev-DB schema drift → ticket DEV-1231).
Demo (dev-only)
POST /api/v1/demo/seed — resets the demo data to the curated demo story
("Ransomware on win-server", DEV-231). Only exists in the development
environment (env var DEMO_SEED_SQL_PATH set) and is restricted to
superadmin. Story timestamps are relative to the call (NOW()), so the
demo always stays "fresh".
Alert Stats — GET /v1/alerts/stats (Time Window + Topic Aggregation)
Server-side aggregation for the dashboard (DEV-1322): no list hydration,
scales to 10k+ alerts/month (index idx_alerts_timestamp).
| Parameter | Type | Meaning |
|---|---|---|
from | RFC3339 | Window start (inclusive), e.g. 2026-11-03T12:00:00Z |
to | RFC3339 | Window end (exclusive), default = now |
status, severity | CSV | Filters (new,in_progress / critical,high) |
Response (data): total, status counts (new, in_progress, resolved,
false_positive, auto_handled), severity counts (critical, high,
medium, low) plus:
byTopic: server-side multi-label domain classification (DEV-1363) (windows,unix,network,user,database,management,other) withalerts+ severity breakdown. Each alert is counted in EVERY one of its domains (max. 2: OS domain fromassets.os_nameviarelated_asset_id, role domain from source/asset name; name regex only as fallback when no asset is linked) — alerts without a label land inotherand are always visible in the radar (never silently filtered). Threat view: synthetic pipeline monitor alerts (alert_type=detection) are excluded. Server/client parity tests (SQL CASE ↔topicClassify.ts).daily: day buckets (YYYY-MM-DDUTC) withalerts+critical(trend series, same threat view).
Filter parameter domain (DEV-1363): restricts list/count/stats to
alerts whose domain assignment contains the value (?domain=windows).
The alert list (GET /alerts) additionally returns domains: string[]
per alert (server-side, same classification).
The dashboard uses this endpoint for the 7 d/1 m views and the KPI cards;
the threat radar's main view is the honest domain overview (all 7
domains, other = "Other" always visible), the spider chart with the
five threat domains (windows, unix, network, user, database)
is the secondary view (toggle).
curl -s "https://socsuite.dev.imvee.de/api/v1/alerts/stats?from=$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" \
-H "Cookie: <session>" | jq '.data | {total, byTopic, daily: (.daily | length)}'Error Handling & Status Codes
Error responses are JSON: {"error": "<message>", "code": "<machine-code>"}
(for validation/auth errors; plain 404s may respond without a code).
| HTTP | Meaning | Examples / codes |
|---|---|---|
| 400 | Bad request | missing fields (/v1/ingest/enroll without token), invalid IDs |
| 401 | Unauthenticated | session_missing (no BFF session), session_expired (session lapsed), Missing authorization header / Missing API key (API-key endpoints) |
| 403 | Authenticated but not authorized | permission/role checks (RBAC, e.g. missing settings.manage) · tenant (DEV-1372): tenant_denied (orphan/inactive tenant claim, fail-closed + audit), tenant_inactive (ingest for suspended/expired tenant), quota: agents (max_agents exceeded) |
| 404 | Unknown path or feature not licensed | license gates (DEV-440 E1) answer default-deny 404 for unlicensed features — deliberately not 403 (no feature disclosure) |
| 405 | Method not allowed | e.g. GET on POST-only endpoints |
| 429 | Rate limit / quota exceeded | quota_docs_per_min (tenant ingest quota, DEV-1372 — with Retry-After header) · login rate limit (10/min) |
| 500 | Internal server error | {"error":"internal error"} — details in the service log (dev cluster) |
| 503 | Service unavailable | gateway translation on timeout/service-down; app-internal Service Unavailable |
Rate limiting: login endpoints are rate-limited (10/min, 429 when exceeded);
global rate-limit middleware on API-key/ingest flows. Additionally (DEV-1372,
SaaS): tenant quota docs_per_min on /v1/ingest/* (60 s window per tenant,
429 quota_docs_per_min + Retry-After; the bootstrap tenant unassigned
is exempt).
Generate OpenAPI Spec
make generate-docs
# Result: apps/api/docs/swagger.yaml + swagger.jsonSee Also
- Orchestrator — Authoritative endpoint declarations, permissions, invariants
- Authentication — BFF pattern and token handling
- Domain Model — Entities and relationships