Skip to content

API overview

The SARC portal exposes a REST API at /api/*, an MCP server at /api/mcp/*, and webhook ingest endpoints at /api/webhooks/*.

Three authentication paths, depending on caller:

CallerAuthHeader
Browser session (operator using the portal)NextAuth session cookieCookie: next-auth.session-token=...
External AI client (Claude Desktop, Cursor)Portal Access Token (PAT)Authorization: Bearer karc_pat_...
External AI client via OAuth 2.1OAuth bearerAuthorization: Bearer eyJ...
CI webhookHMAC-SHA256 over bodyx-karc-signature: <hex>

PATs are issued at /t/<tenant>/settings/api-tokens. OAuth issuer config is at /t/<tenant>/settings/mcp-oauth. Webhook secrets are rotated from /t/<tenant>/settings/webhooks.

PathReturns
GET /api/dashboardPer-env release health, latest deploys, pending CRs
GET /api/compliance/statusPer-framework summary (pass/fail/skipped counts)
GET /api/compliance/controlsAll controls for the tenant (global + overrides)
GET /api/servicesService catalogue
GET /api/services/[slug]Service detail + dependencies
GET /api/cmdb/{ci_type}ServiceNow CMDB browse
GET /api/change-requestsServiceNow CRs (paginated)
GET /api/change-requests/[id]CR detail incl. 5-axis risk + Kosli evidence chain
GET /api/timelineSSE stream of every deploy/CR/Kosli/ArgoCD event
GET /api/auditHash-chained audit log
GET /api/vulnerabilitiesAggregated vuln list
GET /api/sbom/[id]SBOM document
GET /api/costs/servicesPer-service cost from Cost Explorer / Cost Management / Billing
GET /api/costs/chargebackPer-team chargeback report
GET /api/argocd/[cluster]ArgoCD application list per cluster
GET /api/tekton/[cluster]Tekton PipelineRun list per cluster
GET /api/doraDORA metrics for the tenant
PathPurposeGate
POST /api/compliance/evidence/generateGenerate evidence pack (JSON + PDF)ADMIN; rate-limited 5/h/tenant
POST /api/agents/runDispatch an agent recipeADMIN; per-tenant rate-limit
POST /api/mcp/proposeMCP gateway — propose a write (dry-run)non-AUDITOR; mcp.gateway flag
POST /api/mcp/executeMCP gateway — ADMIN-approved writeADMIN; argsSha anti-tamper
POST /api/audit/verify-chainVerify the hash chain over the AuditLogany role
POST /api/webhooks/agent-dispatchReceive CI state transition for an AgentDispatchHMAC-SHA256
POST /api/webhooks/policy-resultReceive Kyverno PreSync policy resultper-tenant secret

/api/mcp is the MCP server for external AI clients. Exposes 12 read tools + 3 prompts. Tools list:

  • get_compliance_status
  • get_change_request
  • list_change_requests
  • get_problem
  • list_problems
  • get_service
  • list_services
  • get_sla_compliance
  • list_deployments
  • list_audit_log
  • list_release_notes
  • list_vulnerabilities

Use mcp_protocol_version: 2024-11-05. See MCP Gateway runbook for the write-path equivalent (Phase 1: GitHub issue_write only).

None today. The portal API surface follows REST conventions; any HTTP client works. The MCP server speaks standard Model Context Protocol so any MCP client library works — Claude Desktop, Cursor, the Anthropic SDK, etc.

The API surface is not versioned today. Breaking changes are announced in release notes (/releases). Customer engagements pin to a specific portal image SHA, so the API for a given install never changes underneath the customer mid-engagement.

  • MCP Gateway — write-path API for human-approved AI writes
  • Configuration — what to set up before calling these endpoints
  • The OpenAPI spec is generated per release and lives in the repo at karc-portal/openapi.yaml (planned; not yet shipped — see followups under #418)