IMVEEDev Portal

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

TypeUsageCredential
Session (BFF)Browser user via KeycloakhttpOnly cookie (automatic)
API KeySatellite agents (/v1/ingest/**) + public integration API (/v1/public/**)Authorization: Bearer <API_KEY> (integration: imvk_…, or X-API-Key)
Enrollment TokenAgent 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):

PathUsed byGateway 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

DomainEndpointsDescription
Auth & Sessions10PKCE login, logout, token refresh, session management
License3license status, activation (admin), history (DEV-440) → Licensing & Feature Gates
Users & Profile12User management, settings, avatar, password
Alerts9Alert CRUD, status, stats aggregation, OpenSearch webhook, Entity Flow (attacker → target system → asset, DEV-1257)
Cases & Incident Response22Cases, timeline, evidence, comments, post-incident review
Tasks5Task CRUD
Tickets & SLA21Ticket management (types: incident, approval, manual_task), approval workflow (approve/reject), assign/unassign (DEV-161), audit timeline, comments, SLA policies, SLA breaches
Vulnerability Management21Vulnerabilities (search/filter incl. status sub-tabs active/resolved/accepted, assets, categories), scans, CVE enrichment, risk scores, risk acceptance with expiry (DEV-184)
Assets (SecBase)14Asset inventory, metrics, applications, connections, security overview, open-ports/software aliases
Agent Lifecycle9Enrollment, heartbeat, status, restart, decommission
Agent Management11Agent details, error history, metrics, live status, open ports, installed software
Agent Enrollment Tokens4Token CRUD, statistics
Agent API Keys3Key rotation, status, auto-rotate
Agent Updates4Software updates, config updates, update history
Agent Data Ingestion5Logs, inventory, metrics, vulnerability scans
Agent EDR6Detections, quarantine, processes, isolation
Agent Device Control4USB events, policies, blocking
Agent FIM5File changes, baseline, watched paths
Missions9Mission CRUD, assignment, WebSocket events
Detection Rules7Rule CRUD, OpenSearch sync
Playbooks & Automation11Playbooks, templates, execution history, execution detail incl. node steps & decision chain (DEV-196)
Workflows5Workflow CRUD
Automation6Action catalogue, custom actions, scheduled jobs
Threat Intelligence9IOC CRUD, enrichment, STIX export
Threat Feeds6TAXII, MISP, custom feeds
MITRE ATT&CK6Tactics, techniques, alert mapping, coverage, active attack vectors
Threat Hunting11Campaigns, query library, AI generation
UBA7Baseline, anomalies, risk score, peer group
Compliance10Frameworks (ISO 27001, NIS2, GDPR, SOC2), reports, audit evidence
Dashboards & KPIs11Custom dashboards, widgets, MTTD, MTTR, SLA
Notifications5Notifications, settings, activity feed
Monitoring & Terminal7Services, container logs, health, WebSocket terminal
Settings13API tokens, connectors, security policy, SIEM
Integrations6EDR, firewall, SIEM, connector marketplace
AI Assistant8Alert triage, action recommendations, NL2SQL, Ollama models, AI-Situation (posture summary + chat, DEV-392)
Audit & System6Audit logs, health checks, Prometheus metrics
Demo (dev-only)1Curated demo story reset (development only, superadmin)
Public Integration API1/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).

ParameterTypeMeaning
fromRFC3339Window start (inclusive), e.g. 2026-11-03T12:00:00Z
toRFC3339Window end (exclusive), default = now
status, severityCSVFilters (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) with alerts + severity breakdown. Each alert is counted in EVERY one of its domains (max. 2: OS domain from assets.os_name via related_asset_id, role domain from source/asset name; name regex only as fallback when no asset is linked) — alerts without a label land in other and 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-DD UTC) with alerts + 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).

HTTPMeaningExamples / codes
400Bad requestmissing fields (/v1/ingest/enroll without token), invalid IDs
401Unauthenticatedsession_missing (no BFF session), session_expired (session lapsed), Missing authorization header / Missing API key (API-key endpoints)
403Authenticated but not authorizedpermission/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)
404Unknown path or feature not licensedlicense gates (DEV-440 E1) answer default-deny 404 for unlicensed features — deliberately not 403 (no feature disclosure)
405Method not allowede.g. GET on POST-only endpoints
429Rate limit / quota exceededquota_docs_per_min (tenant ingest quota, DEV-1372 — with Retry-After header) · login rate limit (10/min)
500Internal server error{"error":"internal error"} — details in the service log (dev cluster)
503Service unavailablegateway 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.json

See Also

On this page