AISOCin‑a‑box

API Reference

Three documents describe three different things — keep them straight:

Document What it is
This page, §Live surfaces The two REST services that actually run in deploy/compose, verified request/response examples included
This page, §Contract The frozen Phase-3 portal API (spec §4.5): 65 paths / 77 operations, generated into openapi.json. Mostly not implemented in the reference stack — the markers say which parts are
openapi.json (next to this page) The machine-readable §4.5 contract, rendered as an interactive console by the docs build

The reference stack is a split control plane: the Phase-0 single orchestrator at :8117 was split into the control-plane API (state, RLS-bound) and the agent orchestrator (graph, OPA gate, audit chains).

Surface Base URL (host) Role
control-plane-api http://127.0.0.1:8117 REST + WebSocket control plane: ingest, cases, approvals, actions, ES|QL, fleet, audit mirror, metrics. Every business query RLS-scoped (multi-tenancy.md)
agent-orchestrator http://127.0.0.1:8130 The triage graph, OPA autonomy gate, per-tenant hash-chained audit. Called by the control plane; a few read routes are directly useful

Live surface 1 — control-plane-api :8117

Dev-mode authentication

The reference stack authenticates by header (production is the §4.3 portal session — bearer JWT minted by the portal BFF, 60 s TTL, act=user):

X-Tenant-Id: tnt_acme_01          # tnt_acme_01 | tnt_globex_02 | platform
X-Actor-Subject: analyst:m.reyes  # seeded users-table subject
  • Ingest (edge tunnel credential, not a user session): X-Actor-Subject: edge-agent — alerts:ingest is a public-to-tenant permission.
  • Analyst work (queue, decisions, audit, ES|QL): X-Actor-Subject: analyst:m.reyes (roles analyst + concierge_lead, MFA-enrolled — see the seeded matrix in multi-tenancy.md §3).
  • No/unknown tenant or subject → 401 before any DB access (fail closed). Role without the permission → 403. Out-of-scope resource → 404, byte-identical to missing (§1.3.2: never a 403 that confirms existence — test_cross_tenant.py::test_api_404_identical).

Calling the live API

The two moves you'll actually make against :8117 — ingest an alert, then decide the approval it opens — in three languages. All examples assume the stack is up (./up.sh), the seeded tenant tnt_acme_01, and the alert body shape from detection-rules.md §4 (fields at top level; window_start/window_end are load-bearing). Ingest is synchronous — it blocks up to 180 s for the graph run.

# 1. Ingest one alert (X-Actor-Subject: edge-agent — the tunnel credential)
curl -s http://127.0.0.1:8117/api/alerts/ingest \
  -H 'Content-Type: application/json' \
  -H 'X-Tenant-Id: tnt_acme_01' -H 'X-Actor-Subject: edge-agent' \
  -d '{
    "edge_id": "edge-acme-01",
    "local_alert_id": "myrule-2026-11-25-0001",
    "trigger": {"type": "edr_rule", "severity": 4, "rule_id": "myrule-c2-beacon"},
    "title": "C2 beacon from WS-ACME-0117",
    "ecs": {"@timestamp": "2026-11-25T10:03:55.9Z",
            "event": {"kind": "alert", "category": "network", "severity": 4},
            "host": {"hostname": "WS-ACME-0117"},
            "user": {"name": "corp-j.doe"}},
    "asset": {"hostname": "WS-ACME-0117", "os": "windows", "criticality": "high"},
    "context_pointers": {"index": "soc-box-ecs-tnt_acme_01-*",
                         "window_start": "2026-11-25T09:58:55Z",
                         "window_end": "2026-11-25T10:08:55Z",
                         "doc_ids": []},
    "redaction": {"profile": "gdpr-standard", "fields_redacted": 0}
  }'
# → {"alert_id": "alr_…", "case_id": "case-…", "triage": {…}}

# 2. Find the pending approval (analyst headers)
curl -s http://127.0.0.1:8117/api/approvals \
  -H 'X-Tenant-Id: tnt_acme_01' -H 'X-Actor-Subject: analyst:m.reyes'

# 3. Decide it — justification is mandatory; mfa_verified is what the gate checks
curl -s http://127.0.0.1:8117/api/approvals/appr-…/decision -X POST \
  -H 'Content-Type: application/json' \
  -H 'X-Tenant-Id: tnt_acme_01' -H 'X-Actor-Subject: analyst:m.reyes' \
  -d '{"decision": "approve",
       "justification": "Isolate; forensic image first.",
       "mfa_verified": true}'

Standard library only — no dependencies to install:

import json, urllib.request

BASE = "http://127.0.0.1:8117"
EDGE    = {"X-Tenant-Id": "tnt_acme_01", "X-Actor-Subject": "edge-agent"}
ANALYST = {"X-Tenant-Id": "tnt_acme_01",
           "X-Actor-Subject": "analyst:m.reyes"}

def post(path, body, headers):
    req = urllib.request.Request(
        BASE + path, data=json.dumps(body).encode(),
        headers={"Content-Type": "application/json", **headers})
    with urllib.request.urlopen(req, timeout=200) as r:
        return json.load(r)

# 1. Ingest — blocks up to 180 s (the triage run is synchronous)
res = post("/api/alerts/ingest", {
    "edge_id": "edge-acme-01",
    "local_alert_id": "myrule-2026-11-25-0002",
    "trigger": {"type": "edr_rule", "severity": 4,
                "rule_id": "myrule-c2-beacon"},
    "title": "C2 beacon from WS-ACME-0117",
    "ecs": {"@timestamp": "2026-11-25T10:03:55.9Z",
            "event": {"kind": "alert", "category": "network",
                      "severity": 4},
            "host": {"hostname": "WS-ACME-0117"},
            "user": {"name": "corp-j.doe"}},
    "asset": {"hostname": "WS-ACME-0117", "os": "windows",
              "criticality": "high"},
    "context_pointers": {"index": "soc-box-ecs-tnt_acme_01-*",
                         "window_start": "2026-11-25T09:58:55Z",
                         "window_end": "2026-11-25T10:08:55Z",
                         "doc_ids": []},
    "redaction": {"profile": "gdpr-standard", "fields_redacted": 0},
}, EDGE)
case_id = res["case_id"]

# 2. The pending approval on that case
req = urllib.request.Request(BASE + "/api/approvals", headers=ANALYST)
pending = json.load(urllib.request.urlopen(req, timeout=30))["items"]
appr = next(a for a in pending
            if a["case_id"] == case_id and a["decision"] == "pending")

# 3. Decide it
print(post(f"/api/approvals/{appr['id']}/decision",
           {"decision": "approve",
            "justification": "Isolate; forensic image first.",
            "mfa_verified": True}, ANALYST))

Node ≥ 18 (fetch is global); run as an ES module (.mjs) for the top-level await. A browser page on another origin can't reach 127.0.0.1 — this runs on the box or a tailnet client:

const BASE = "http://127.0.0.1:8117";
const EDGE    = { "X-Tenant-Id": "tnt_acme_01",
                  "X-Actor-Subject": "edge-agent" };
const ANALYST = { "X-Tenant-Id": "tnt_acme_01",
                  "X-Actor-Subject": "analyst:m.reyes" };

const post = (path: string, body: unknown,
              headers: Record<string, string>) =>
  fetch(BASE + path, {
    method: "POST",
    headers: { "Content-Type": "application/json", ...headers },
    body: JSON.stringify(body),
  }).then((r) => r.json());

// 1. Ingest — blocks up to 180 s (the triage run is synchronous)
const res = await post("/api/alerts/ingest", {
  edge_id: "edge-acme-01",
  local_alert_id: "myrule-2026-11-25-0003",
  trigger: { type: "edr_rule", severity: 4, rule_id: "myrule-c2-beacon" },
  title: "C2 beacon from WS-ACME-0117",
  ecs: { "@timestamp": "2026-11-25T10:03:55.9Z",
         event: { kind: "alert", category: "network", severity: 4 },
         host: { hostname: "WS-ACME-0117" },
         user: { name: "corp-j.doe" } },
  asset: { hostname: "WS-ACME-0117", os: "windows", criticality: "high" },
  context_pointers: { index: "soc-box-ecs-tnt_acme_01-*",
                      window_start: "2026-11-25T09:58:55Z",
                      window_end: "2026-11-25T10:08:55Z",
                      doc_ids: [] },
  redaction: { profile: "gdpr-standard", fields_redacted: 0 },
}, EDGE) as { alert_id: string; case_id: string; triage: unknown };

// 2. The pending approval on that case
const pending = await (
  await fetch(BASE + "/api/approvals", { headers: ANALYST })
).json() as {
  items: { id: string; case_id: string; decision: string }[];
};
const appr = pending.items.find(
  (a) => a.case_id === res.case_id && a.decision === "pending",
)!;

// 3. Decide it
console.log(
  await post(`/api/approvals/${appr.id}/decision`,
    { decision: "approve",
      justification: "Isolate; forensic image first.",
      mfa_verified: true },
    ANALYST),
);

Endpoints

All responses JSON. limit/offset pagination on list endpoints (limit capped at 200). Times are ISO-8601 UTC.

Health

Method & path What
GET /healthz Thin liveness: {status, service, version} (the compose healthcheck contract)
GET /health · GET /api/health Full: adds pg reachability + orchestrator status

Ingest

Method & path What
POST /api/alerts/ingest AlertMetadataPush-shaped alert (top-level fields — see detection-rules.md §2) → dedupe by (tenant, local_alert_id) → durable alerts row → synchronous triage run (blocks up to 180 s) → case/timeline/approval projection. Response: {alert_id, case_id, triage} where triage is the run view, or the string "deferred: orchestrator unreachable …" when the alert landed but the run didn't happen

Cases

Method & path What
GET /api/cases Queue. Filters: state, severity, from/to (opened window), sort ∈ opened_at|severity|state|number (+- desc), limit (default 25), offset. Response {total, limit, offset, items[]}
POST /api/cases Manual case (analyst-opened investigation): title, severity (int 1–5, else 422 VALIDATION)
GET /api/cases/{case_id} Case row + meta (outcome, pending hitl request). 404-identical to missing/foreign
PATCH /api/cases/{case_id} Analyst updates (state, assignee, queue, title, …)
GET /api/cases/{case_id}/timeline Kill-chain projection, seq-ordered; each row carries audit_event_hash linking it to the §3.4 chain (provenance)
GET /api/cases/{case_id}/evidence Raw alert JSON + ECS + context pointers
GET /api/cases/{case_id}/approvals The case's HITL approval rows
GET /api/cases/{case_id}/actions The case's containment action rows (status, mode, receipt)

HITL approvals (the accountability ledger)

Method & path What
GET /api/approvals Pending decisions first (200-row cap); ?include_decided=true for all. Rows carry expired computed against expires_at (default window 900 s)
GET /api/approvals/{approval_id} One row
POST /api/approvals/{approval_id}/decision The decision endpoint — body {"decision": "approve"|"deny", "justification": "…", "mfa_verified": true}. justification is mandatory (422). Sequence: ledger row updated → graph resumed through the orchestrator's raw HITL resume → PG case state re-synced (_sync_case) → cases bus event. Errors: 404 no such approval, 409 already decided, 410 window expired, 422 bad body. D-V1: an approve with mfa_verified false/absent is forwarded — the graph + OPA policy refuse it and the audit records why; it is never silently dropped

Why decisions go through the ledger, not the raw resume — the orchestrator exposes POST /v1/cases/{case_id}/hitl (the graph's own resume, §Live surface 2). The portal and any API client must use /api/approvals/{approval_id}/decision: the ledger endpoint is what writes the accountability row (decided_by, justification, mfa_verified), then forwards to the raw resume, then re-projects the case into PG (state, resolved_at, actions). Hitting the raw resume directly skips the PG projection — the case queue then disagrees with the graph.

Actions

Method & path What
GET /api/actions Tenant-wide containment ledger (200-row cap)
GET /api/actions/{action_id} One row incl. receipt + directive_id

Fleet

Method & path What
GET /api/edges · GET /api/edges/{edge_id} Edge box status (health, eps, disk/heap, Vector drop counter, tunnel latency, cert expiry)
POST /api/edges/{edge_id}/heartbeat Heartbeat update (the reference's stand-in for the tunnel heartbeat)
GET /api/connectors · POST /api/connectors Connector inventory (sysmon/auditd/suricata/crowdstrike/entra/okta)
GET /api/connectors/{connector_id} · PATCH /api/connectors/{connector_id} Read / update (non-secret config only — §4 N3/N6)

ES|QL (federated investigation queries)

Method & path What
POST /api/esql/validate Pre-flight only: {esql, parameters} → {ok, reasons, allowed_indices}. The §3.5 validator: 5 rules, index allow-list from the tenant registry, caps (max 200 rows), verb allow-list
POST /api/esql/execute Validate → run against the tenant's registry ES endpoint (the simulated tunnel leg, §1.2) → audit the run (esql_runs + chain event) → return {query_id, status, columns, values, row_count, simulated_tunnel, note}. Named parameters go on the wire as an array of single-key objects (ES 9 requirement)
GET /api/esql/saved · POST /api/esql/saved Saved queries (name, esql, parameters, last validation verdict)
GET /api/esql/saved/{query_id} · PATCH … · DELETE … Read / update / delete a saved query

Working example (ES 9.1.4 engine — no SELECT verb; named params):

curl -s http://127.0.0.1:8117/api/esql/execute \
  -H 'Content-Type: application/json' -H 'X-Tenant-Id: tnt_acme_01' \
  -H 'X-Actor-Subject: analyst:m.reyes' \
  -d '{"esql": "FROM soc-box-ecs-tnt_acme_01-* | WHERE event.kind == \"event\" | SORT @timestamp DESC | LIMIT 2"}'

Audit (PG mirror of the §3.4 hash chain)

Method & path What
GET /api/audit Browse the tenant's chain mirror; filters event_type, case_id
GET /api/audit/verify Re-verify the authoritative chain (sqlite writer) → {ok, count, head_hash, …}
GET /api/audit/export Self-verifying export bundle (§3.4.3): events + verification + statement of scope

Metrics

Method & path What
GET /api/metrics ?window_days= (default 7): case counts, MTTD/MTTR, alert volume, autonomous/approval/forbidden decision ratios, approvals pending
POST /api/metrics/recompute Recompute the metrics_daily materialization

Reference-scope admin (tenant-registry CRUD the reference needs to run)

GET /api/tenants · POST /api/tenants · PATCH /api/tenants/{tenant_id} · GET /api/users · POST /api/users · GET /api/users/{user_id} · PATCH /api/users/{user_id} — the platform GUC scope serves platform_admin; everything else is tenant-scoped like the rest.

Realtime (WebSocket)

/ws/logs · /ws/alerts · /ws/cases — subscribe with ?tenant=tnt_… (browsers cannot set WS headers). A missing/invalid tenant closes with code 4401 (fail closed); every frame is tenant-filtered server-side — an RLS-equivalent scope on the wire.

Internal (orchestrator→control-plane, not client-facing): POST /internal/case-event, POST /internal/action-result.

Verified examples (live captures, trimmed)

Ingest — POST /api/alerts/ingest (headers X-Tenant-Id: tnt_acme_01, X-Actor-Subject: edge-agent; body = one alert's fields at top level):

{"alert_id": "alr_4e7765534a59", "case_id": "case-38abe9c5fe",
 "triage": {"case_id": "case-38abe9c5fe", "tenant_id": "tnt_acme_01",
   "state": "finished", "outcome": "remediated",
   "verdict": {"outcome": "true_positive", "confidence": 0.88,
               "mitre_techniques": ["T1078"],
               "narrative": "Suspicious interactive logon; revoke the session token.",
               "proposed_actions": [{"action_type": "token_revoke",
                                     "target": "corp-session", ...}]},
   ...}}

Queue — GET /api/cases?limit=3 (analyst headers):

{"total": 38, "limit": 3, "offset": 0,
 "items": [{"case_id": "case-cfcefd9ead", "number": "TGT-9EAD",
   "title": "Lateral movement followed by ransomware staging …",
   "state": "escalated", "severity": 3, "queue": "my_book",
   "mitre_techniques": ["T1489", "T1021.001"],
   "detection_source": "agent:triage-v1/phaseb",
   "meta": {"outcome": "escalated_to_analyst",
             "hitl_request": {"pending": ["host_isolate"],
                              "request_id": "hitl_a5933af27…"}}, ...}]}

Timeline — GET /api/cases/{case_id}/timeline:

{"case_id": "case-cfcefd9ead", "items": [
  {"seq": 445, "ts": "…", "kind": "alert_ingested",
   "actor": "orchestrator/ingest_alert",
   "detail": {"source": "edr_rule", "alert_id": "seed-01-data_exfil-19-…"},
   "audit_event_hash": "cfd843db3d…"},
  {"seq": 446, "kind": "llm_prompt", "actor": "lane/hypothesis", ...}]}

Pending approval — GET /api/approvals:

{"items": [{"id": "appr-1afe208c20d4", "case_id": "case-5f2f27f473",
  "request_id": "hitl_f45cf12cfe834eb0", "action_kind": "host_isolate",
  "target_json": {"target": "ACME-SRV-DC01", "confidence": 0.93, ...},
  "policy_digest": "sha256:soc.hitl.v1/human_approval/host_isolate",
  "decision": "pending", "mfa_verified": false,
  "expires_at": "…", "expired": false}], "count": 1}

Decision — POST /api/approvals/{approval_id}/decision (analyst:m.reyes headers):

{"decision": "approve", "justification": "Isolate; forensic image first.",
 "mfa_verified": true}

→ {"approval_id": "appr-…", "case": <run view>}; PG case state becomes contained and the action row executed. A deny lands the case as escalated.

Audit mirror — GET /api/audit (chain rows carry prev_hash / event_hash; GET /v1/audit/{tenant}/chain on :8130 adds the verification block — see §Live surface 2).

Metrics — GET /api/metrics?window_days=7:

{"tenant_id": "tnt_acme_01", "window_days": 7,
 "cases": {"cases_total": 35, "cases_closed": 27, "mttr_seconds": 6480},
 "mttd_seconds": 36,
 "decisions": {"autonomous": 34, "approval": 10, "forbidden": 2,
               "ratios": {"autonomous": 0.739, "approval": 0.217,
                          "forbidden": 0.043}},
 "approvals_pending": 2}

Error wire format (honest)

Contract (§4.5): RFC 9457 application/problem+json with a machine-readable error_code. Reference today: FastAPI's {"detail": …} — either a plain string or the object form {"detail": {"error_code": …, "message": …}}. The machine-readable code exists; the problem+json envelope does not yet.

Verified live:

Status Body
401 {"detail": {"error_code": "NO_TENANT", "message": "X-Tenant-Id required (tnt_…)"}} — also UNKNOWN_SUBJECT ("…'nobody:x' not in tenant tnt_acme_01") and AUTH_STORE_UNAVAILABLE
403 {"detail": {"error_code": "FORBIDDEN", "message": "role(s) ['client_exec'] lack actions:approve"}}
404 {"detail": "no such case in tenant tnt_acme_01"} — identical for a foreign-tenant id and a missing one (tested)
409 decision on an already-decided approval: already approved / already rejected
410 decision past expires_at: approval window expired (row marked expired)
422 {"error_code": "VALIDATION", …} (bad severity, missing justification, non-integer trigger.numeric_severity, …)
502 ES|QL execute for a tenant with no registry ES endpoint

Live surface 2 — agent-orchestrator :8130

The graph runtime. Mostly called by the control plane; these routes are useful directly:

Method & path What
GET /healthz Rich liveness: llm_backend (stub in the reference), OPA bundle sha + version, PG reachability, per-tenant audit-chain verification {tenant: {ok, count, head_hash, …}}
GET /v1/graph Static projection of the §3.2.1 topology (nodes/edges) — the portal timeline skin
POST /v1/triage {tenant_id, alert} → synchronous triage run → run view. Called by ingest, not by clients (clients POST to /api/alerts/ingest)
GET /v1/status/{case_id} The case's run view (below)
POST /v1/cases/{case_id}/hitl Raw graph resume: {request_id, decision, sub, roles, justification, mfa_verified, approval_row_id}. Use the ledger endpoint instead (§above) unless you are the control plane
GET /v1/audit/{tenant_id}/chain The tenant's hash chain: items[] of {seq, prev_hash, event_hash, ts, tenant_id, case_id, event_type, actor, payload} + verification: {ok, count, head_hash, …}
GET /v1/audit/{tenant_id}/verify Verification block only

The run view (returned by /v1/triage, /v1/status/{id}, and nested under triage in the ingest response):

{"case_id": "case-…", "tenant_id": "tnt_…", "node": "<current graph node>",
 "status": "finished | awaiting_approval | …",
 "state": "…",                  // portal-facing alias of status
 "outcome": "remediated | escalated_to_analyst | … | null",
 "verdict": {"outcome", "confidence", "mitre_techniques", "narrative",
             "proposed_actions"},
 "proposed_actions": [...], "gate_decision": {...},
 "hitl_request": {...} | null,  // what the analyst is being asked
 "interrupt": {"kind": "hitl", "request_id": "hitl_…",
               "action": {…}, "policy": {…}, "evidence_pack": {…}} | null,
 "action_results": [{"action", "mode", "policy_id", "receipt"}],
 "audit_refs": [...]}

The §4.5 contract — 65 paths / 77 operations

The frozen Phase-3 portal API (docs/developer/api/generate_openapi.py distills spec §4.5 into openapi.json — regenerate, never hand-edit). Status column: ✅ live on a reference surface · ≈ live equivalent (different path/shape) · — not implemented in the reference stack. RBAC values are the contract's x-rbac markers.

Auth (6) — all not live: the reference authenticates with X-Tenant-Id/X-Actor-Subject headers against the seeded users table; OIDC exchange / OTP / view-switch are the production path (spec §4.1).

Method & path x-rbac Status
POST /v1/auth/exchange — —
GET /v1/auth/me — — (dev: the header is the identity)
POST /v1/auth/view-switch — —
POST /v1/auth/logout — —
POST /v1/auth/otp/start · POST /v1/auth/otp/verify — — (D-V1 MFA is enforced as the mfa_verified decision flag today)

M1 — Investigations (18)

Method & path x-rbac Status
GET /v1/cases cases:read ≈ GET /api/cases (:8117)
POST /v1/cases cases:update ✅ POST /api/cases
GET /v1/cases/{case_id} cases:read ✅ GET /api/cases/{id} (+ run view at :8130 /v1/status/{id})
PATCH /v1/cases/{case_id} cases:update ✅ PATCH /api/cases/{id}
GET /v1/cases/{case_id}/events cases:read ≈ GET /api/cases/{id}/timeline
POST /v1/cases/{case_id}/comments cases:update — (timeline comment kind exists in the schema)
GET /v1/cases/{case_id}/summary cases:read —
POST /v1/cases/{case_id}/summary:regenerate internal —
GET /v1/cases/{case_id}/evidence/{ref_id} cases:read:evidence ≈ GET /api/cases/{id}/evidence (list, not per-ref)
GET /v1/actions actions:read ✅ GET /api/actions
POST /v1/actions actions:request_containment ≈ via approval decision (requests originate from the verdict)
GET /v1/actions/{action_id} actions:read ✅ GET /api/actions/{id}
POST /v1/actions/{action_id}/decision actions:approve ✅ POST /api/approvals/{id}/decision
POST /v1/actions/{action_id}/cancel requester —
POST /v1/esql/federate cases:esql ≈ POST /api/esql/execute (synchronous; the tunnel leg is simulated)
GET /v1/esql/jobs/{job_id} cases:esql — (runs are audited in esql_runs, not job-tracked)
GET /v1/esql/jobs/{job_id}/stream cases:esql —
POST /v1/kibana/deeplink cases:kibana_link —

M2 — Observation pipeline (13)

Method & path x-rbac Status
GET /v1/boxes pipeline:read ≈ GET /api/edges
GET /v1/boxes/{box_id} pipeline:read ✅ GET /api/edges/{id}
GET /v1/boxes/{box_id}/metrics pipeline:read — (edge rows carry eps/disk/heap/drops/latency fields)
GET /v1/tunnels pipeline:read (internal: cross-tenant) — (no tunnel in the reference)
GET /v1/connectors pipeline:read ✅ GET /api/connectors
POST /v1/connectors connectors:create ✅ POST /api/connectors
GET /v1/connector-templates pipeline:read —
PATCH /v1/connectors/{id} connectors:update ✅ PATCH /api/connectors/{id}
DELETE /v1/connectors/{id} connectors:update —
POST /v1/connectors/{id}:test connectors:update —
POST /v1/connectors/{id}:rotate-secret connectors:credentials:write —
GET /v1/connectors/{id}/runs pipeline:read —
POST /v1/connectors/{id}/oauth-callback public->bind —

M3 — Security posture (8) — all not live (spec-only): GET /v1/posture/score, GET /v1/posture/findings, GET /v1/posture/findings/{finding_id}, POST /v1/posture/findings/{finding_id}:link-case (cases:update), GET/POST /v1/assistant/threads, GET/POST /v1/assistant/threads/{thread_id}/messages (all assistant:chat).

M4 — Journey (8) — all not live (spec-only): GET/POST /v1/journey/roadmap (journey:read / journey:roadmap:manage), PATCH /v1/journey/roadmap/{item_id}, GET /v1/journey/compliance, GET /v1/journey/compliance/{framework_id}, POST …/controls/{control_id}/evidence (compliance:manage), GET/POST /v1/journey/meetings.

M5 — Reporting & audit (8)

Method & path x-rbac Status
GET /v1/metrics reports:read ✅ GET /api/metrics
GET /v1/reports reports:read —
POST /v1/reports reports:export:schedule —
PATCH /v1/reports/{report_id} reports:export:schedule —
POST /v1/reports/{report_id}:run-now reports:export:schedule —
GET /v1/reports/{report_id}/deliveries reports:read —
GET /v1/audit/events audit:read ✅ GET /api/audit
POST /v1/audit/export audit:read ≈ GET /api/audit/export (self-verifying bundle; GET, not POST)

Admin (11)

Method & path x-rbac Status
GET /v1/admin/tenants · POST /v1/admin/tenants admin:tenants:* ✅ GET/POST /api/tenants
GET /v1/admin/tenants/{tenant_id} admin:tenants:* ≈ GET /api/tenants (list)
PATCH /v1/admin/tenants/{tenant_id} admin:tenants:* ✅ PATCH /api/tenants/{id}
GET /v1/admin/tenants/{tenant_id}/users admin:tenants:* (client_admin: own tenant) ≈ GET /api/users (tenant-scoped)
POST /v1/admin/tenants/{tenant_id}/invites same —
PATCH /v1/admin/tenants/{tenant_id}/users/{id} same ✅ PATCH /api/users/{user_id}
GET /v1/admin/agents/runs admin:policies:read —
GET /v1/admin/policies read all internal / write admin — (OPA bundle is build-mounted; :8130 /healthz exposes its sha)
PUT /v1/admin/policies/{pack} write admin —
GET /v1/admin/connector-templates admin:tenants:* —

Health (2)

Method & path Status
GET /healthz ✅ live (thin on :8117; rich on :8130)
GET /readyz — (the rich GET /health fills the role)

Reference-stack markers (3) — contract paths the reference stack implements (or implemented), x-reference-stack: true:

Contract path Reference implementation
POST /v1/alerts POST /api/alerts/ingest on :8117 — the path moved in Phase B (the split control plane); seeder + portal scenario engine target the new path (verified)
POST /v1/cases/{case_id}/hitl ✅ live on :8130 — the raw resume; clients use the ledger (/api/approvals/{id}/decision)
GET /v1/audit/{tenant_id} ≈ GET /v1/audit/{tenant_id}/chain on :8130 (path gained the /chain segment; adds verification)

Contract conventions vs. reference behavior

Contract (§4.5) Reference today
Bearer service JWT from the portal BFF (60 s, act=user) X-Tenant-Id + X-Actor-Subject headers; roles from the seeded users table
RFC 9457 problem+json errors FastAPI {"detail": …} with error_code inside (see §Error wire format)
Cursor pagination ?cursor=&limit≤200 Offset pagination ?limit≤200&offset=
Idempotency-Key (UUID) on every mutating endpoint + outbox audit write Not checked; the load-bearing idempotency is the ingest dedupe key (tenant, local_alert_id) and the approval ledger's 409 on re-decision
Long operations → 202 + JobRef (nothing holds a connection across the tunnel) Ingest is synchronous (blocks up to 180 s for the graph run; the single-box reference has no tunnel to cross)
502 GW_TUNNEL_DOWN for tunnel-dependent ops while the box is offline No tunnel; the closest is 502 from ES|QL execute when the tenant has no registry ES endpoint

The OpenAPI console

openapi.json (this directory) is the committed generated artifact — regenerate after any §4.5 spec edit, never patch by hand:

python3 docs/developer/api/generate_openapi.py   # → "65 paths, 77 operations"
python3 docs-site/build.py                       # re-inlines the console into /api/

The docs build renders it as an interactive console on this page's dist build (/api/index.html). Try-it executes only against endpoints that exist on a live surface (GET /healthz on both); the rest are documented-only — the console does not pretend to hit unimplemented routes.