Skip to main content

API Reference

All API endpoints are prefixed with /api and served by FastAPI routers. This reference lists every endpoint with its HTTP method, auth identity, and purpose.

Auth identity key:

  • OBO — uses the signed-in user's On-Behalf-Of token
  • SP — uses the app's Service Principal
  • OBO → SP — tries OBO first, falls back to SP on scope error
  • Mixed — uses both identities for different parts of the operation

Analysis Router (/api)​

MethodPathAuthPurpose
POST/api/space/fetchOBO → SPFetch serialized Genie Agent by ID
POST/api/space/parseNoneParse pasted Genie API JSON (client-side data, no auth needed)
GET/api/debug/authOBODev-only auth debug endpoint (404 on Databricks Apps)
GET/api/settingsNoneRead-only app settings (LLM model, warehouse, host)
GET/api/modelsNoneCurated chat serving endpoints selectable per Create Agent / Auto-Optimize run

Spaces Router (/api)​

MethodPathAuthPurpose
GET/api/spacesOBO → SPList Genie Agents with IQ scores, starred sort, filters
GET/api/spaces/{space_id}OBOSpace metadata + latest scan + star status
POST/api/spaces/{space_id}/scanOBORun IQ scan and persist result to Lakebase
GET/api/spaces/{space_id}/historyOBOScan + auto-optimize run history for a space
PUT/api/spaces/{space_id}/starOBOToggle starred status (Lakebase)

Admin Router (/api/admin)​

MethodPathAuthPurpose
GET/api/admin/dashboardOBOOrg-wide stats: space count, scan count, avg score, maturity distribution
GET/api/admin/leaderboardOBOTop/bottom spaces by IQ score (top_n param)
GET/api/admin/alertsOBOSpaces with "Not Ready" maturity (max 20)

Auth Router (/api/auth)​

MethodPathAuthPurpose
GET/api/auth/meOBOCurrent user info from OBO headers, dev env, or SDK
GET/api/auth/statusOBOLightweight health check with workspace client / auth type

Create Router (/api/create)​

MethodPathAuthPurpose
GET/api/create/preflightOBOPre-check that the user can create Genie Agents
GET/api/create/discover/catalogsOBOList Unity Catalog catalogs
GET/api/create/discover/schemasOBOList schemas in a catalog
GET/api/create/discover/tablesOBOList tables in a catalog.schema
GET/api/create/discover/columnsOBOList columns for a table
GET/api/create/discover/searchOBOKeyword search for candidate tables across Unity Catalog
POST/api/create/validateOBOValidate serialized space config (errors/warnings)
POST/api/createOBOCreate Genie Agent from wizard payload
POST/api/create/agent/chatOBOSSE — Create agent conversational flow
GET/api/create/agent/sessions/{session_id}OBOLoad agent session for refresh/reconnect
DELETE/api/create/agent/sessions/{session_id}OBODelete agent session

Auto-Optimize Router (/api/auto-optimize)​

MethodPathAuthPurpose
GET/api/auto-optimize/healthSPGSO health check: job/warehouse configuration status
GET/api/auto-optimize/permissions/{space_id}MixedPre-check SP manage + UC read
POST/api/auto-optimize/triggerMixedStart GSO optimization job; benchmark_policy is review_only or repair_allowed (OBO for auth, SP for job submission)
GET/api/auto-optimize/runs/{run_id}SPFull run detail: stages, steps, levers, links
GET/api/auto-optimize/runs/{run_id}/statusSPLightweight status poll: steps, scores
GET/api/auto-optimize/leversNoneList optimization lever definitions
POST/api/auto-optimize/runs/{run_id}/applyOBOMark an already-published result APPLIED for integration compatibility; the post-run UI does not require this step
POST/api/auto-optimize/runs/{run_id}/discardMixedDiscard run / rollback changes
GET/api/auto-optimize/runs/{run_id}/revert-optionsMixedPreview champion/baseline availability and live-to-snapshot benchmark diffs
POST/api/auto-optimize/runs/{run_id}/revertMixedRevert with independent config_target=champion|baseline and benchmark_target=current|champion|baseline query parameters
GET/api/auto-optimize/spaces/{space_id}/active-runSPCheck for QUEUED/IN_PROGRESS run
GET/api/auto-optimize/spaces/{space_id}/runsSPList optimization runs for a space
DELETE/api/auto-optimize/runs/{run_id}/history-entryMixedHide a terminal run from Workbench history after OBO CAN_EDIT/CAN_MANAGE authorization; preserves the workflow run and GSO audit data
GET/api/auto-optimize/spaces/{space_id}/current-versionMixedMatch live config and benchmarks independently to history-visible captured baselines/champions; report matched, mixed, component drift, or incomplete history (refresh=true bypasses the live-state cache)
GET/api/auto-optimize/runs/{run_id}/iterationsSPPer-iteration evaluation rows
GET/api/auto-optimize/runs/{run_id}/loop-stateSPOptimizer controller loop state for the run
GET/api/auto-optimize/runs/{run_id}/publishSPPublish record and champion outcome
GET/api/auto-optimize/runs/{run_id}/debug-dataSPDiagnostics for Lakebase vs Delta data
GET/api/auto-optimize/runs/{run_id}/eval-resultsSPNative Eval-Run rows (requires iteration param)
GET/api/auto-optimize/runs/{run_id}/question-resultsSPPer-question results (requires iteration param)
GET/api/auto-optimize/runs/{run_id}/patchesSPAll patches for the run
GET/api/auto-optimize/runs/{run_id}/benchmark-changesSPBenchmark mutation ledger plus QC window, structured quality findings, semantic-review coverage, and proposed repairs

GenieWatch Routers (/api/watch)​

Most GenieWatch metrics read Databricks system tables, which are not OBO-readable, so those routes execute as the service principal and use an in-process TTL cache. The traffic-gap route is user-authorized and does not persist traffic: it requires CAN_MANAGE, reads all conversation pages transiently, and fails instead of returning partial results. It is OBO-only — it never falls back to the service principal and returns 401 without user authorization. See OBO-only routes. These routers are registered separately in main.py.

MethodPathAuthPurpose
GET/api/watch/spacesSPList watched Genie Agents with cost/usage summaries
GET/api/watch/spaces/{space_id}SPWatch detail for one Agent
GET/api/watch/spaces/{space_id}/traffic-gapsOBO onlyManager-only, reviewable benchmark candidate gaps; no SP fallback, and no raw question or user identity in the response
POST/api/watch/spaces/refreshSPRefresh the watched-space cache
GET/api/watch/overviewSPOrg-wide cost overview
GET/api/watch/cost/topSPHighest-cost Agents
GET/api/watch/spaces/{space_id}/costSPPer-Agent cost breakdown
GET/api/watch/spaces/{space_id}/cost/top-queriesSPMost expensive queries for an Agent
GET/api/watch/spaces/{space_id}/cost/conversationsSPCost attributed per conversation
GET/api/watch/spaces/{space_id}/usageSPQuery volume and usage trend
GET/api/watch/feedbackSPOrg-wide feedback signals
GET/api/watch/feedback/commentsSPFeedback comment text
GET/api/watch/spaces/{space_id}/feedbackSPPer-Agent feedback
GET/api/watch/spaces/{space_id}/resourcesSPTables actually executed by an Agent
GET/api/watch/resources/rollupSPExecuted-resource rollup
GET/api/watch/resources/spacesSPAgents grouped by executed resource
GET/api/watch/resources/graphSPAgent-to-resource lineage graph
GET/api/watch/settings/healthSPWatch health: system-table access and cache state
POST/api/watch/settings/cache/refreshSPForce a cache refresh
POST/api/watch/admin/refresh-rollupSPRebuild usage rollups (admin-gated via require_admin)

Static File Serving (main.py)​

MethodPathAuthPurpose
GET/NoneServe index.html (React SPA)
GET/{full_path:path}NoneServe static assets from frontend/dist/, fallback to SPA

SSE Streaming Endpoints​

One endpoint uses Server-Sent Events:

EndpointKeepaliveEvents
POST /api/create/agent/chat15ssession, step, thinking, tool_call, tool_result, message_delta, message, created, updated, heartbeat, error, done

The frontend consumes SSE via manual fetch + ReadableStream in lib/api.ts (not EventSource). Buffers are split on \n\n.