{"openapi":"3.1.0","info":{"title":"chat-bi-backend","description":"Natural-language questions over a connected analytics database.","version":"0.1.0"},"paths":{"/auth/login":{"get":{"tags":["auth"],"summary":"Login","operationId":"login_auth_login_get","parameters":[{"name":"next","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/callback":{"get":{"tags":["auth"],"summary":"Auth Callback","operationId":"auth_callback_auth_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Me","description":"Who am I? The SPA calls this on load to decide login vs. app.","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}}}}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"Liveness: always 200 so a not-yet-ready runtime (e.g. unreachable DB at\nboot) doesn't fail health checks and trigger restart loops. `ready` reports\nwhether the schema-backed runtime is loaded; schema fields are present only\nwhen ready.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/schema":{"get":{"summary":"Schema","description":"Human-facing table catalog -- lets a front-end show what can be asked.","operationId":"schema_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TableSummary"},"type":"array","title":"Response Schema Schema Get"}}}}}}},"/suggestions":{"get":{"summary":"Suggestions","description":"Smart session starters: the most frequent recent questions from the\nresolved tenant's own chat log, never another tenant's. When history has\nfewer than a full set, the rest are questions generated from the tenant's\nschema (PRO-101), so a new tenant still gets relevant starters.","operationId":"suggestions_suggestions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/capabilities":{"get":{"summary":"Capabilities","operationId":"capabilities_capabilities_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dashboard/pins":{"get":{"summary":"Dashboard Pins","operationId":"dashboard_pins_dashboard_pins_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-invertropy-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invertropy-User-Id"}},{"name":"x-lumen-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Lumen-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPinsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Dashboard Pin","operationId":"create_dashboard_pin_dashboard_pins_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-invertropy-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invertropy-User-Id"}},{"name":"x-lumen-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Lumen-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPin"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPin"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dashboard/pins/reorder":{"post":{"summary":"Reorder Pins","description":"Persist the user's card arrangement, sent whole rather than per card.","operationId":"reorder_pins_dashboard_pins_reorder_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-invertropy-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invertropy-User-Id"}},{"name":"x-lumen-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Lumen-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPinReorder"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Reorder Pins Dashboard Pins Reorder Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dashboard/pins/{pin_id}":{"patch":{"summary":"Patch Dashboard Pin","operationId":"patch_dashboard_pin_dashboard_pins__pin_id__patch","parameters":[{"name":"pin_id","in":"path","required":true,"schema":{"type":"string","title":"Pin Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-invertropy-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invertropy-User-Id"}},{"name":"x-lumen-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Lumen-User-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPinPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPin"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Remove Dashboard Pin","operationId":"remove_dashboard_pin_dashboard_pins__pin_id__delete","parameters":[{"name":"pin_id","in":"path","required":true,"schema":{"type":"string","title":"Pin Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-invertropy-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invertropy-User-Id"}},{"name":"x-lumen-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Lumen-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Remove Dashboard Pin Dashboard Pins  Pin Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dashboard/pins/{pin_id}/refresh":{"post":{"summary":"Refresh Dashboard Pin","description":"Refresh one pin's data by re-running its stored SQL, without the model.\n\nA pin's chart spec is fixed once saved, so a refresh only needs fresh rows:\nvalidate and re-execute the stored query and swap them in. When no SQL is\nstored (an older pin, or the chat log write had not landed at pin time) we\nrecover it from the log and backfill the pin; if even that misses we fall\nback to the full pipeline once so the card still refreshes.","operationId":"refresh_dashboard_pin_dashboard_pins__pin_id__refresh_post","parameters":[{"name":"pin_id","in":"path","required":true,"schema":{"type":"string","title":"Pin Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-invertropy-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invertropy-User-Id"}},{"name":"x-lumen-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Lumen-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPinRefresh"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ask":{"post":{"summary":"Ask","operationId":"ask_ask_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/whoami":{"get":{"summary":"Admin Whoami","operationId":"admin_whoami_admin_whoami_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}}}}},"/admin/widget-key":{"get":{"summary":"Admin Widget Key","description":"Hand the admin chat tab its /ask key at runtime (never in the bundle).\n\nReturns ADMIN_TENANT_API_KEY — the key whose hash is on the `lumen` tenant\nrow — so admin chat resolves to the lumen tenant and answers over our own\ndata (chat_sessions in Neon), not a customer's DB. Falls back to the legacy\nenv API_KEY until the lumen row + secret are configured.","operationId":"admin_widget_key_admin_widget_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Response Admin Widget Key Admin Widget Key Get"}}}}}}},"/admin/tenants":{"get":{"summary":"List Tenants","operationId":"list_tenants_admin_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TenantSummary"},"type":"array","title":"Response List Tenants Admin Tenants Get"}}}}}},"post":{"summary":"Create Tenant","operationId":"create_tenant_admin_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{slug}":{"get":{"summary":"Get Tenant","operationId":"get_tenant_admin_tenants__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Tenant","operationId":"update_tenant_admin_tenants__slug__patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{slug}/rotate-key":{"post":{"summary":"Rotate Tenant Key","operationId":"rotate_tenant_key_admin_tenants__slug__rotate_key_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AdminUser":{"properties":{"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"}},"type":"object","required":["email"],"title":"AdminUser"},"AnalysisSection":{"properties":{"heading":{"type":"string","title":"Heading"},"question":{"type":"string","title":"Question"},"conclusion":{"type":"string","title":"Conclusion"},"chart":{"anyOf":[{"$ref":"#/components/schemas/ChartSpec"},{"type":"null"}]},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"}},"type":"object","required":["heading","question","conclusion"],"title":"AnalysisSection","description":"One section of a multi-query analysis report."},"AskRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question"},"history":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","maxItems":20,"title":"History"},"include_sql":{"type":"boolean","title":"Include Sql","default":false}},"type":"object","required":["question"],"title":"AskRequest"},"AskResponse":{"properties":{"question":{"type":"string","title":"Question"},"status":{"type":"string","enum":["ok","analysis","needs_clarification","cannot_answer","invalid_sql","db_error","query_timeout","model_error"],"title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"conclusion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conclusion"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"},"chart":{"anyOf":[{"$ref":"#/components/schemas/ChartSpec"},{"type":"null"}]},"clarification_options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Clarification Options"},"follow_ups":{"items":{"$ref":"#/components/schemas/FollowUp"},"type":"array","title":"Follow Ups"},"timeout_hints":{"items":{"$ref":"#/components/schemas/IndexHint"},"type":"array","title":"Timeout Hints"},"exchange_rates":{"items":{"$ref":"#/components/schemas/ExchangeRateUsed"},"type":"array","title":"Exchange Rates"},"analysis_sections":{"items":{"$ref":"#/components/schemas/AnalysisSection"},"type":"array","title":"Analysis Sections"},"sql":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sql"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["question","status"],"title":"AskResponse","description":"Public response for ``POST /ask``.\n\nDeliberately narrower than ``PipelineResult``: it omits the debug ``meta`` (model\nname, rationale, confidence, ...) and replaces raw error reasons for internal\nfailures with a generic message, so the LLM provider and database never leak to the\nclient. The generated SQL is opt-in transparency: it is included only when the\nrequest sets ``include_sql`` and the tenant grants ``expose_sql`` (otherwise\n``sql`` is ``None``). The CLI and eval paths keep using ``PipelineResult``\ndirectly."},"CapabilitiesResponse":{"properties":{"enable_dashboard":{"type":"boolean","title":"Enable Dashboard","default":false},"expose_sql":{"type":"boolean","title":"Expose Sql","default":false},"enable_analysis":{"type":"boolean","title":"Enable Analysis","default":false}},"type":"object","title":"CapabilitiesResponse","description":"Feature flags for the resolved tenant."},"ChartSpec":{"properties":{"type":{"type":"string","enum":["bar","line","pie","scatter","table","none"],"title":"Type"},"x":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X"},"y":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Y"},"series":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Series"},"title":{"type":"string","title":"Title"},"x_type":{"anyOf":[{"type":"string","enum":["temporal","category","number"]},{"type":"null"}],"title":"X Type"},"value_format":{"type":"string","enum":["number","currency","percent"],"title":"Value Format","default":"number"},"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Code"},"stacked":{"type":"boolean","title":"Stacked","default":false},"x_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Label"},"y_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Y Label"},"series_labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Series Labels"},"max_categories":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Categories"}},"type":"object","required":["type","title"],"title":"ChartSpec"},"ConversationTurn":{"properties":{"role":{"type":"string","enum":["user","assistant"],"title":"Role"},"content":{"type":"string","maxLength":4000,"minLength":1,"title":"Content"}},"type":"object","required":["role","content"],"title":"ConversationTurn","description":"One prior turn of the conversation, supplied by the client for context."},"DashboardPin":{"properties":{"id":{"type":"string","maxLength":200,"minLength":1,"title":"Id"},"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question"},"chart":{"$ref":"#/components/schemas/ChartSpec"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"session":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Session"},"pinned_at":{"type":"integer","title":"Pinned At"},"refreshed_at":{"type":"integer","title":"Refreshed At"}},"type":"object","required":["id","question","chart","pinned_at","refreshed_at"],"title":"DashboardPin","description":"A dashboard chart saved for later sessions."},"DashboardPinPatch":{"properties":{"chart":{"anyOf":[{"$ref":"#/components/schemas/ChartSpec"},{"type":"null"}]},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"},"session":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Session"},"refreshed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Refreshed At"}},"type":"object","title":"DashboardPinPatch"},"DashboardPinRefresh":{"properties":{"id":{"type":"string","title":"Id"},"chart":{"$ref":"#/components/schemas/ChartSpec"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"refreshed_at":{"type":"integer","title":"Refreshed At"}},"type":"object","required":["id","chart","refreshed_at"],"title":"DashboardPinRefresh","description":"Fresh data for one pin after re-running its stored query.\n\nCarries the chart (unchanged from the pin) and the new rows so the widget can\nswap a card's data in one call. Deliberately omits the SQL: refreshing re-runs\nthe query server side and never discloses it to the client."},"DashboardPinReorder":{"properties":{"ids":{"items":{"type":"string"},"type":"array","title":"Ids"}},"type":"object","title":"DashboardPinReorder","description":"A new card order for one dashboard: the pin ids, first to last.\n\nThe whole arrangement travels in one request rather than a position per card, so\na drag cannot half apply and two quick drags cannot race into an incoherent\norder. Ids that are not the caller's pins are ignored."},"DashboardPinsResponse":{"properties":{"pins":{"items":{"$ref":"#/components/schemas/DashboardPin"},"type":"array","title":"Pins"}},"type":"object","title":"DashboardPinsResponse"},"ExchangeRateUsed":{"properties":{"base_currency":{"type":"string","title":"Base Currency"},"quote_currency":{"type":"string","title":"Quote Currency"},"rate":{"type":"number","title":"Rate"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"},"source":{"type":"string","title":"Source"}},"type":"object","required":["base_currency","quote_currency","rate","fetched_at","source"],"title":"ExchangeRateUsed","description":"One FX quote a converted answer relied on (PRO-71).\n\nReturned with the answer so a converted figure is never an unattributed\nnumber: the user sees which pair was converted, at what rate, and when that\nrate was read from the source. `fetched_at` is the real read time, including\nwhen a stale quote was served because the upstream feed was unreachable."},"FollowUp":{"properties":{"kind":{"type":"string","const":"drilldown","title":"Kind","default":"drilldown"},"message":{"type":"string","title":"Message"},"label":{"type":"string","title":"Label","default":"Try this"},"question":{"type":"string","title":"Question"}},"type":"object","required":["message","question"],"title":"FollowUp"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status"},"ready":{"type":"boolean","title":"Ready","default":true},"schema_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Hash"},"table_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Table Count"}},"type":"object","required":["status"],"title":"HealthResponse"},"IndexHint":{"properties":{"table":{"type":"string","title":"Table"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"}},"type":"object","required":["table","columns"],"title":"IndexHint","description":"One table a timed-out query filtered, with the filtered columns.\n\nDerived from the failing SQL (see pipeline/timeout_hints.py) so the client\ncan show the customer's engineering team exactly what to index. Names come\nfrom the customer's own catalog, which /schema already exposes, so this is\nsafe to return."},"SuggestionsResponse":{"properties":{"suggestions":{"items":{"type":"string"},"type":"array","title":"Suggestions"}},"type":"object","title":"SuggestionsResponse","description":"Starter questions for the empty chat state: recent successful questions from\nthe chat log first, topped up with questions generated from the tenant's schema.\nEmpty only when both sources come up empty."},"TableSummary":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"synonyms":{"items":{"type":"string"},"type":"array","title":"Synonyms"}},"type":"object","required":["name"],"title":"TableSummary"},"TenantCreate":{"properties":{"slug":{"type":"string","maxLength":100,"minLength":1,"title":"Slug"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"db_url_readonly":{"type":"string","minLength":1,"title":"Db Url Readonly"},"allowed_origins":{"type":"string","title":"Allowed Origins","default":"*"},"enrichment_path":{"type":"string","minLength":1,"title":"Enrichment Path"},"schema_cache_path":{"type":"string","minLength":1,"title":"Schema Cache Path"},"expose_sql":{"type":"boolean","title":"Expose Sql","default":false},"dashboard_enabled":{"type":"boolean","title":"Dashboard Enabled","default":false},"analysis_enabled":{"type":"boolean","title":"Analysis Enabled","default":false}},"type":"object","required":["slug","name","db_url_readonly","enrichment_path","schema_cache_path"],"title":"TenantCreate"},"TenantCreateResponse":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"status":{"type":"string","enum":["active","disabled"],"title":"Status"},"expose_sql":{"type":"boolean","title":"Expose Sql"},"dashboard_enabled":{"type":"boolean","title":"Dashboard Enabled"},"analysis_enabled":{"type":"boolean","title":"Analysis Enabled"},"allowed_origins":{"type":"string","title":"Allowed Origins"},"enrichment_path":{"type":"string","title":"Enrichment Path"},"schema_cache_path":{"type":"string","title":"Schema Cache Path"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["slug","name","status","expose_sql","dashboard_enabled","analysis_enabled","allowed_origins","enrichment_path","schema_cache_path","api_key"],"title":"TenantCreateResponse","description":"The new tenant plus its plaintext API key, shown once. Only the hash is\never persisted, so this is the only time the key is retrievable."},"TenantDetail":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"status":{"type":"string","enum":["active","disabled"],"title":"Status"},"expose_sql":{"type":"boolean","title":"Expose Sql"},"dashboard_enabled":{"type":"boolean","title":"Dashboard Enabled"},"analysis_enabled":{"type":"boolean","title":"Analysis Enabled"},"allowed_origins":{"type":"string","title":"Allowed Origins"},"enrichment_path":{"type":"string","title":"Enrichment Path"},"schema_cache_path":{"type":"string","title":"Schema Cache Path"}},"type":"object","required":["slug","name","status","expose_sql","dashboard_enabled","analysis_enabled","allowed_origins","enrichment_path","schema_cache_path"],"title":"TenantDetail","description":"Full tenant config for the admin edit view.\n\nDeliberately carries NO `db_url_readonly`. The customer's connection string\nis write only: it is decrypted for exactly one purpose, opening the read only\nconnection that answers a question, and never to be looked at. An admin can\nreplace it (see `TenantUpdate`) but cannot read it back, so it never leaves\nthe server, never reaches a browser, and never sits in a response body."},"TenantKeyResponse":{"properties":{"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["api_key"],"title":"TenantKeyResponse","description":"Response to a key rotation: the new plaintext key, shown once."},"TenantSummary":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"status":{"type":"string","enum":["active","disabled"],"title":"Status"},"expose_sql":{"type":"boolean","title":"Expose Sql"},"dashboard_enabled":{"type":"boolean","title":"Dashboard Enabled"},"analysis_enabled":{"type":"boolean","title":"Analysis Enabled"}},"type":"object","required":["slug","name","status","expose_sql","dashboard_enabled","analysis_enabled"],"title":"TenantSummary","description":"One row of the admin tenant list -- no secrets, cheap to fetch in bulk."},"TenantUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"db_url_readonly":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Db Url Readonly"},"allowed_origins":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allowed Origins"},"enrichment_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrichment Path"},"schema_cache_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Cache Path"},"status":{"anyOf":[{"type":"string","enum":["active","disabled"]},{"type":"null"}],"title":"Status"},"expose_sql":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Expose Sql"},"dashboard_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dashboard Enabled"},"analysis_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Analysis Enabled"}},"type":"object","title":"TenantUpdate","description":"PATCH body: every field optional, only what's set is written.\n\n`db_url_readonly` is write only. Send it to replace the stored connection\nstring; omit it to leave the current one untouched. There is no read path,\nso an admin who wants to know the current URL has to set a new one."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}