api referenceGET
POST
GET
POST
Organization
Org-wide settings and the "Ask with AI" (text-to-SQL) provider configuration. Admin only.
GET/api/organization
Read org settings. The AI sub-object's encrypted key is always stripped from the response.
Response
{ "id": 1, "name": "Acme", "slug": "acme", "settings": { "...": "..." }, "created_at": "2026-01-01T00:00:00Z", "updated_at": "2026-01-01T00:00:00Z" }POST/api/organization
Update the org's name and/or settings. The "ai" settings key is preserved untouched by this endpoint even if the caller sends one — use the dedicated AI endpoints below instead.
Request
{ "name": "Acme Inc." }GET/api/organization/ai
Whether a Gemini API key is configured for the organization, its source, and the effective generation rate limit.
Response
{ "key_configured": true, "key_source": "org", "rate_limit_org_value": 25, "rate_limit_env_default": 10, "rate_limit_effective": 25 }POST/api/organization/ai/test
Validate a Gemini API key (the one being saved, or the currently effective one if omitted) against Gemini's models list endpoint — no generation tokens spent.
Request
{ "gemini_api_key": "AIza..." }Response
{ "status": "ok", "message": "Key is valid and working." }