Skip to main content

REST API Reference

AiSOC exposes a fully documented OpenAPI 3.1 REST API.

Base URL

EnvironmentURL
Local devhttp://localhost:8000/api/v1
Docker Composehttp://api:8000/api/v1
Kuberneteshttps://your-domain.com/api/v1

Authentication

JWT Bearer (User)

# Obtain a token
curl -X POST http://localhost:8000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@aisoc.local","password":"changeme"}'

# Use the token
curl http://localhost:8000/api/v1/cases \
-H "Authorization: Bearer <token>"

API Key (Service-to-Service)

curl http://localhost:8000/api/v1/alerts \
-H "X-API-Key: <api-key>"

API keys are created via POST /api/v1/api-keys and can be scoped to specific permissions.

Interactive Docs

When running locally, interactive Swagger UI is available at:

The full spec is also committed at docs/openapi.yaml.

Endpoint Groups

Identity & Access

MethodPathDescription
POST/auth/loginObtain JWT
POST/auth/refreshRefresh JWT
POST/auth/logoutRevoke token
POST/auth/saml/loginInitiate SAML SSO
GET/auth/saml/callbackSAML ACS endpoint
POST/auth/oidc/loginInitiate OIDC flow
GET/auth/oidc/callbackOIDC redirect handler
GET/users/meCurrent user profile
GET/POST/api-keysList / create API keys
DELETE/api-keys/{id}Revoke an API key
GET/POST/PUT/DELETE/rbac/rolesRole management
GET/POST/PUT/DELETE/rbac/permissionsPermission management

Detection & Hunting

MethodPathDescription
GET/POST/alertsList / ingest alerts
POST/alerts/submitFounder-flow direct-write submit — synthesises an Alert row directly from a batch of OCSF events, bypassing Kafka / services/ingest / services/fusion. Powers aisoc submit and the fresh-clone demo so the console at /alerts lights up immediately. See packages/aisoc-cli and examples/alerts/lateral-movement.json for the canonical payload.
GET/PATCH/DELETE/alerts/{id}Alert detail / update / delete
POST/alerts/{id}/assignAssign to analyst
GET/POST/rulesDetection rule catalog
PUT/DELETE/rules/{id}Update / delete a rule
POST/rules/{id}/enableEnable a rule
GET/POST/detectionsDetection events
GET/detections/statsAggregated detection metrics

Detection Proposals (Detection-as-Code)

The DAC lifecycle manages detection rule proposals from creation through eval-gated promotion into the live rule set.

MethodPathDescription
GET/detection-proposalsList proposals (filterable by status)
POST/detection-proposalsCreate a new proposal (title, description, logic, MITRE tags)
GET/detection-proposals/{id}Proposal detail
POST/detection-proposals/{id}/commentAdd a review comment
POST/detection-proposals/{id}/evalAttach eval result (metric deltas from scripts/run_evals.py)
POST/detection-proposals/{id}/decideApprove or reject the proposal
POST/detection-proposals/{id}/promotePromote an approved proposal to detection_rules
GET/detection-proposals/baselineCurrent eval baseline metrics
POST/detection-proposals/baselineReset eval baseline to latest harness run

Fan out a single query to connected SIEMs. The API translates the query into each target's native dialect (SPL for Splunk, KQL for Sentinel, ES|QL for Elastic).

MethodPathDescription
POST/federated/querySubmit a federated query (query, targets[], optional time_range)

Hunt-as-Code

YAML hunt definitions live in hunts/ and are loaded by the agents service. The API exposes read-only access for the UI.

MethodPathDescription
GET/huntsList loaded hunt definitions
GET/hunts/{hunt_id}Hunt detail (hypothesis, MITRE tags, indicators)
GET/hunts/{hunt_id}/resultsResults from the latest scheduled run

Entity Risk (Risk-Based Alerting)

Time-decayed risk scores per entity, computed by the fusion service.

MethodPathDescription
GET/entity-riskTop entities by risk score (descending)
GET/entity-risk/{entity}Risk detail for a specific entity

Cases & Response

MethodPathDescription
GET/POST/casesCase list / create
GET/PATCH/DELETE/cases/{id}Case detail / update / close
POST/cases/{id}/commentsAdd comment
POST/cases/{id}/timelineAdd timeline event
GET/POST/playbooksPlaybook catalog
POST/playbooks/{id}/executeExecute a playbook
GET/playbooks/{id}/runsExecution history
POST/actions/dry-runSimulate an action

Investigations & Ledger

Every prompt, response, evidence citation, and tool call the AI investigator emits is appended to the Investigation Ledger. See Cases — Investigation Ledger for the data model and rationale.

MethodPathDescription
GET/cases/{case_id}/investigationsList ledger entries for a case
GET/investigations/{id}Single ledger entry with full payload
POST/cases/{case_id}/investigations:replayReplay an investigation deterministically
POST/cases/{case_id}/investigations:startKick off a fresh agent investigation

Ambient Copilot

MethodPathDescription
GET/copilot/context/{resource_type}/{resource_id}Context-aware suggestions for an alert / case / rule / playbook
POST/copilot/actions/{action_id}:runRun a suggested action with the right agent tool

Marketplace

The marketplace surface is backed by the JSON index at marketplace/index.json and re-published to the web app at /marketplace/index.json.

MethodPathDescription
GET/marketplace/itemsList plugins, detections, and playbooks
GET/marketplace/items/{slug}Item detail with manifest + signature
POST/marketplace/items/{slug}:installInstall a plugin / detection / playbook into the tenant

Responder PWA

These endpoints back the mobile-first /responder/* route group.

MethodPathDescription
GET/POST/oncall/rotationsList / create on-call rotations
GET/oncall/whoisonCurrently on-call responder
GET/POST/passkeysList / register WebAuthn credentials
DELETE/passkeys/{id}Revoke a passkey
POST/passkeys/challengeBegin WebAuthn ceremony
POST/passkeys/verifyComplete WebAuthn ceremony
GET/POST/approvalsList / create approval requests
POST/approvals/{id}:approveApprove a request
POST/approvals/{id}:rejectReject a request
GET/POST/push/subscriptionsList / register Web Push subscriptions
DELETE/push/subscriptions/{id}Revoke a Web Push subscription
POST/push/testSend a test push to the calling user

Threat Intelligence

MethodPathDescription
GET/POST/intel/iocsIOC search / ingest
POST/intel/enrichEnrich an indicator
GET/intel/feedsConnected feed status
POST/intel/feeds/{id}/syncForce feed sync

UEBA

MethodPathDescription
GET/ueba/anomaliesList anomalies
GET/ueba/anomalies/{id}Anomaly detail
GET/ueba/baselinesUser baselines
GET/ueba/baselines/{entity_id}Per-entity baseline
DELETE/ueba/baselines/{entity_id}Reset baseline
GET/ueba/statsAggregate UEBA metrics

Honeytokens

MethodPathDescription
GET/POST/honeytokensList / create tokens
GET/DELETE/honeytokens/{id}Token detail / revoke
GET/honeytokens/{id}/eventsTouch events for a token
GET/honeytokens/eventsAll touch events
GET/honeytokens/statsDeployment statistics
GET/honeytokens/track/{token_id}Public tracking endpoint (triggers alert)

Purple Team

MethodPathDescription
GET/purple-team/atomic-testsAtomic Red Team test catalog
POST/purple-team/executionsRun an atomic test
GET/DELETE/purple-team/executions/{id}Execution status / cancel
GET/purple-team/coverageATT&CK coverage heatmap
GET/POST/purple-team/tabletopTabletop session list / create
POST/purple-team/tabletop/{id}/stepsAdd step to session
POST/purple-team/drift/snapshotTake an ATT&CK coverage snapshot
GET/purple-team/drift/snapshotsList drift snapshots
GET/purple-team/drift/diffDelta between two snapshots (added/dropped techniques)

Governance

MethodPathDescription
GET/compliance/frameworksAvailable compliance frameworks
GET/compliance/controlsControl library
GET/POST/compliance/evidenceEvidence list / upload
GET/compliance/dashboard/{framework}Framework dashboard data
GET/auditImmutable audit log
GET/sla/configsSLA configuration
PUT/sla/configs/{id}Update SLA thresholds
GET/sla/eventsSLA breach events

Rate Limits

CallerLimit
API key1000 req/min
User JWT100 req/min

Rate-limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Pagination

All list endpoints support cursor-based pagination:

GET /api/v1/alerts?limit=50&cursor=<opaque-cursor>

Response includes "next_cursor" when more pages exist.

Client SDKs

LanguagePackageNotes
Pythonpackages/sdk-pyAsync client built on httpx
TypeScriptpackages/sdk-tsBrowser + Node, fetch-based
Gopackages/sdk-goTyped models + thin client helpers

In addition, the Model Context Protocol server (@aisoc/mcp) exposes 11 of these endpoints as IDE-side tools for Claude / Cursor / Continue / Cody.