{"components":{"schemas":{"ChatRequest":{"properties":{"agent_config":{"additionalProperties":true,"type":"object"},"agent_id":{"description":"Optional override; defaults to saved preference.","type":"string"},"chat_message":{"description":"User message.","type":"string"},"client_hint":{},"collection_ids":{"description":"Optional collection UUIDs to scope retrieval.","items":{"type":"string"},"type":"array"},"llm_config_ref":{},"llm_route":{"default":"platform_llm","type":"string"}},"type":"object"},"ChatResponse":{"properties":{"agent_id":{"type":"string"},"answer":{"type":"string"},"citations":{"items":{},"type":"array"},"extra":{},"usage":{}},"type":"object"},"EmbedChatRequest":{"properties":{"agent_config":{"additionalProperties":true,"type":"object"},"agent_id":{"type":"string"},"chat_message":{"type":"string"},"client_hint":{},"collection_ids":{"items":{"type":"string"},"type":"array"},"llm_config_ref":{},"llm_route":{"type":"string"},"visitor_session":{"description":"Visitor id for memory partitioning.","type":"string"}},"type":"object"},"Error":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"}},"securitySchemes":{"EmbedBearer":{"bearerFormat":"nxemb_<prefix>_<secret>","description":"Embed API key; alternatively send `X-Nexura-Embed-Key: <full key>`.","scheme":"bearer","type":"http"},"SessionCookie":{"description":"Flask session cookie after successful `POST /login`.","in":"cookie","name":"session","type":"apiKey"}}},"info":{"description":"**Nexura** is a multi-tenant RAG platform: isolated collections per organisation, session-based console auth, RBAC, grounded chat with citations, embeddable widgets, and an agent marketplace.\n\n### Authentication\n- **Console / tenant APIs**: sign in via `POST /login` (browser cookie session). Same-origin `Try it out` requests from `/docs` (Swagger UI) reuse your session cookie.\n- **Embed chat**: send `Authorization: Bearer <nxemb_\u2026>` or header `X-Nexura-Embed-Key`.\n\n### Permissions\nTenant endpoints require the logged-in user to hold the relevant permission (e.g. `chat:query`, `documents:read`, `embed:keys`, `users:manage`). Admins typically have `*`.\n\nProduct overview and deployment guides: console \u2192 **Product & deployment** (`/super/guides`, superusers). Architecture and schema: **Technical reference** (`/super/technical`).","title":"Nexura HTTP API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/api/agents":{"get":{"operationId":"listAgents","responses":{"200":{"description":"`{ agents: [...] }`"}},"security":[{"SessionCookie":[]}],"summary":"Registered agent ids (console)","tags":["Knowledge base"]}},"/api/chunks":{"get":{"operationId":"previewChunks","parameters":[{"in":"query","name":"collection_name","required":true,"schema":{"type":"string"}},{"in":"query","name":"file_name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"`{ chunks: [...] }`"}},"security":[{"SessionCookie":[]}],"summary":"Preview retrieval chunks","tags":["Knowledge base"]}},"/api/collections":{"get":{"operationId":"listCollections","responses":{"200":{"description":"`{ collections: [...] }`"}},"security":[{"SessionCookie":[]}],"summary":"List collections","tags":["Knowledge base"]}},"/api/documents":{"get":{"operationId":"listDocuments","parameters":[{"in":"query","name":"collection_name","required":true,"schema":{"type":"string"}}],"responses":{"200":{},"400":{}},"security":[{"SessionCookie":[]}],"summary":"List documents in collection","tags":["Knowledge base"]}},"/api/embed/chat":{"post":{"operationId":"embedChat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedChatRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"EmbedBearer":[]}],"summary":"Grounded chat (embed key)","tags":["Embed"]}},"/api/marketplace/agents":{"get":{"operationId":"listMarketplaceAgents","responses":{"200":{"description":"Agent cards"}},"summary":"Marketplace agents (metadata)","tags":["Public"]}},"/api/public/plans":{"get":{"operationId":"listPublicPlans","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"plans":{"items":{},"type":"array"}},"type":"object"}}},"description":"Plans payload"}},"summary":"Public plan catalog","tags":["Public"]}},"/api/v1/embed-keys":{"get":{"operationId":"listEmbedKeys","responses":{"200":{"description":"`{ keys: [...] }`"}},"security":[{"SessionCookie":[]}],"summary":"List embed keys","tags":["Embed"]},"post":{"operationId":"createEmbedKey","requestBody":{"content":{"application/json":{"schema":{"properties":{"allowed_collection_ids":{"items":{"type":"string"},"type":"array"},"default_agent_config":{"type":"object"},"default_agent_id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"type":"object"}}}},"responses":{"201":{"description":"Returns full secret once"}},"security":[{"SessionCookie":[]}],"summary":"Create embed key","tags":["Embed"]}},"/api/v1/embed-keys/{key_id}":{"delete":{"operationId":"revokeEmbedKey","parameters":[{"in":"path","name":"key_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked"},"404":{"description":"Not found"}},"security":[{"SessionCookie":[]}],"summary":"Revoke embed key","tags":["Embed"]}},"/api/v1/me/agent-preference":{"get":{"operationId":"getAgentPreference","responses":{"200":{"description":"Preference object"}},"security":[{"SessionCookie":[]}],"summary":"Get my agent preference","tags":["Tenant \u00b7 Subscription & preferences"]},"put":{"operationId":"putAgentPreference","requestBody":{"content":{"application/json":{"schema":{"properties":{"agent_id":{"type":"string"},"config":{"additionalProperties":true,"type":"object"}},"required":["agent_id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Saved preference"}},"security":[{"SessionCookie":[]}],"summary":"Set my agent preference","tags":["Tenant \u00b7 Subscription & preferences"]}},"/api/v1/roles":{"get":{"operationId":"listTenantRoles","responses":{"200":{"description":"`{ roles: [\"Admin\", ...] }`"}},"security":[{"SessionCookie":[]}],"summary":"List role names for tenant","tags":["Users"]}},"/api/v1/tenant/subscription":{"get":{"operationId":"getTenantSubscription","responses":{"200":{"description":"Plan, usage, limits"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"}},"security":[{"SessionCookie":[]}],"summary":"Current tenant subscription / limits","tags":["Tenant \u00b7 Subscription & preferences"]}},"/api/v1/users":{"get":{"operationId":"listUsers","responses":{"200":{"description":"Array of users"}},"security":[{"SessionCookie":[]}],"summary":"List tenant users","tags":["Users"]},"post":{"operationId":"createUser","requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"type":"string"},"password":{"type":"string"},"roles":{"items":{"type":"string"},"type":"array"},"username":{"type":"string"}},"required":["username","password"],"type":"object"}}}},"responses":{"201":{},"400":{},"409":{}},"security":[{"SessionCookie":[]}],"summary":"Create user","tags":["Users"]}},"/api/v1/users/{user_id}":{"patch":{"operationId":"patchUser","parameters":[{"in":"path","name":"user_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"is_active":{"type":"boolean"}},"type":"object"}}}},"responses":{"200":{},"404":{}},"security":[{"SessionCookie":[]}],"summary":"Patch user (e.g. is_active)","tags":["Users"]}},"/api/v1/users/{user_id}/roles":{"put":{"operationId":"putUserRoles","parameters":[{"in":"path","name":"user_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"roles":{"items":{"type":"string"},"type":"array"}},"required":["roles"],"type":"object"}}},"required":true},"responses":{"200":{},"400":{},"404":{}},"security":[{"SessionCookie":[]}],"summary":"Replace user roles","tags":["Users"]}},"/chat":{"post":{"operationId":"sessionChat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}},"description":"Answer + citations"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan / agent not allowed"},"429":{"description":"Quota exceeded"}},"security":[{"SessionCookie":[]}],"summary":"Grounded chat (session)","tags":["Chat"]}},"/delete-document":{"delete":{"operationId":"deleteDocument","requestBody":{"content":{"application/json":{"schema":{"properties":{"collection_name":{"type":"string"},"file_name":{"type":"string"}},"required":["collection_name","file_name"],"type":"object"}}}},"responses":{"200":{},"404":{}},"security":[{"SessionCookie":[]}],"summary":"Delete document from collection","tags":["Knowledge base"]}},"/health":{"get":{"operationId":"healthCheck","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"example":"ok","type":"string"}},"type":"object"}}},"description":"OK"}},"summary":"Health check","tags":["Health"]}},"/upload-document":{"post":{"operationId":"uploadDocument","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"collection_name":{"type":"string"},"file":{"format":"binary","type":"string"},"module":{"default":"DEFAULT","type":"string"}},"required":["file","collection_name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Indexed"},"400":{},"403":{},"500":{}},"security":[{"SessionCookie":[]}],"summary":"Upload PDF or TXT","tags":["Knowledge base"]}}},"servers":[{"description":"This deployment","url":"https://app.venturedynamics.in"}],"tags":[{"description":"Unauthenticated catalogue and health probes.","name":"Public"},{"description":"Liveness check.","name":"Health"},{"description":"Plan limits and per-user agent preference (session auth).","name":"Tenant \u00b7 Subscription & preferences"},{"description":"Grounded chat with retrieval (`chat:query`).","name":"Chat"},{"description":"Cross-origin widget chat (`nxemb_\u2026` key) and tenant embed-key CRUD (`embed:keys`).","name":"Embed"},{"description":"Collections, documents, chunk previews (`documents:*`, `collections:manage` where noted).","name":"Knowledge base"},{"description":"Tenant user administration (`users:manage`).","name":"Users"}]}
