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 Space 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)

Spaces Router (/api)

MethodPathAuthPurpose
GET/api/spacesOBO → SPList Genie Spaces 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/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
POST/api/create/validateOBOValidate serialized space config (errors/warnings)
POST/api/createOBOCreate Genie Space 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 + Prompt Registry
POST/api/auto-optimize/triggerMixedStart GSO optimization job (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}/applyOBOApply optimization results to the Genie Space
POST/api/auto-optimize/runs/{run_id}/discardMixedDiscard run / rollback changes
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
GET/api/auto-optimize/runs/{run_id}/iterationsSPPer-iteration evaluation rows
GET/api/auto-optimize/runs/{run_id}/debug-dataSPDiagnostics for Lakebase vs Delta data
GET/api/auto-optimize/runs/{run_id}/asi-resultsSPASI judge results (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}/suggestionsSPStrategist suggestions for the run

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.