{"openapi":"3.1.0","info":{"title":"AetherBot API","version":"0.1.0"},"paths":{"/api/auth/magic-link":{"post":{"tags":["auth"],"summary":"Request Magic Link","operationId":"request_magic_link_api_auth_magic_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/verify":{"post":{"tags":["auth"],"summary":"Verify Magic Link","operationId":"verify_magic_link_api_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh Tokens","operationId":"refresh_tokens_api_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_api_auth_me_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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_auth_logout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/role":{"get":{"tags":["auth"],"summary":"Get Role","operationId":"get_role_api_auth_role_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/profile":{"post":{"tags":["users"],"summary":"Complete Profile","operationId":"complete_profile_users_me_profile_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/UserProfileCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["users"],"summary":"Get Me","operationId":"get_me_users_me_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/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Delete My Account","description":"Cascade hard-delete the authenticated user's account (GDPR Art. 17).\n\nDeletion is wrapped in a single DB transaction.  See\n``account_service.delete_user_account`` for the exact per-table strategy.\n\nReturns HTTP 204 on success, HTTP 404 if the account was already removed.","operationId":"delete_my_account_users_me_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/export":{"get":{"tags":["users"],"summary":"Export My Data","description":"Return a downloadable JSON archive of all personal data (GDPR Art. 20).\n\n- Requires valid JWT (Bearer token).\n- Enforces a 30-second server-side timeout; returns HTTP 504 on breach.\n- Response carries Content-Disposition: attachment so browsers download it.","operationId":"export_my_data_users_me_export_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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/get-name/{organization_id}":{"get":{"tags":["organizations"],"summary":"Get Name","operationId":"get_name_organizations_get_name__organization_id__get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/link-or-create":{"post":{"tags":["organizations"],"summary":"Link Or Create Org","operationId":"link_or_create_org_organizations_link_or_create_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/OrganizationLinkOrCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members":{"get":{"tags":["organizations"],"summary":"List Members","operationId":"list_members_organizations__organization_id__members_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationMemberOut"},"title":"Response List Members Organizations  Organization Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/{member_user_id}/role":{"patch":{"tags":["organizations"],"summary":"Update Member Role","operationId":"update_member_role_organizations__organization_id__members__member_user_id__role_patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Member Role Organizations  Organization Id  Members  Member User Id  Role Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/{member_user_id}":{"delete":{"tags":["organizations"],"summary":"Remove Member","operationId":"remove_member_organizations__organization_id__members__member_user_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}":{"delete":{"tags":["organizations"],"summary":"Delete Organization","description":"Soft delete an organization and all its users.\n\n- Requires Owner role in the organization.\n- Marks Organization.deleted_at, all Memberships.deleted_at for the org,\n  and sets User.deleted_at for users belonging to the org.","operationId":"delete_organization_organizations__organization_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/leave":{"post":{"tags":["organizations"],"summary":"Leave Organization","description":"Leave an organization. If this was the user's last organization, soft-delete the user.\n\nRules:\n- Requires membership in the organization.\n- OWNER cannot leave; they must transfer ownership or delete the organization.\n- Soft-deletes the membership. If no memberships remain, soft-deletes the user.","operationId":"leave_organization_organizations__organization_id__leave_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/invite":{"post":{"tags":["organizations"],"summary":"Invite Member","operationId":"invite_member_organizations__organization_id__members_invite_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/invitations":{"get":{"tags":["organizations"],"summary":"List Invitations","operationId":"list_invitations_organizations__organization_id__invitations_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"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/InvitationListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/invitations/{invitation_id}":{"delete":{"tags":["organizations"],"summary":"Cancel Invitation","operationId":"cancel_invitation_organizations__organization_id__invitations__invitation_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/invitations/{token}":{"get":{"tags":["organizations"],"summary":"Get Invitation By Token","operationId":"get_invitation_by_token_organizations_invitations__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/invitations/{token}/check":{"get":{"tags":["organizations"],"summary":"Check Invitation","operationId":"check_invitation_organizations_invitations__token__check_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/invitations/{token}/accept":{"post":{"tags":["organizations"],"summary":"Accept Invitation","operationId":"accept_invitation_organizations_invitations__token__accept_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"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/MembershipOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/invitations/{token}/accept-anon":{"post":{"tags":["organizations"],"summary":"Accept Invitation Anonymously","operationId":"accept_invitation_anonymously_organizations_invitations__token__accept_anon_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/invitations/{token}/signup":{"post":{"tags":["organizations"],"summary":"Signup From Invitation","operationId":"signup_from_invitation_organizations_invitations__token__signup_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/chats/internal":{"get":{"tags":["organizations"],"summary":"List Internal Chats","operationId":"list_internal_chats_organizations__organization_id__chats_internal_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"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/ExternalChatListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/chats/external":{"get":{"tags":["organizations"],"summary":"List External Chats","operationId":"list_external_chats_organizations__organization_id__chats_external_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"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/ExternalChatListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/chats/{chat_id}":{"get":{"tags":["organizations"],"summary":"Get Chat History","description":"Fetch a chat's messages with cursor pagination (scrolling).","operationId":"get_chat_history_organizations__organization_id__chats__chat_id__get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Before Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/activity":{"get":{"tags":["organizations"],"summary":"Get Org Activity","operationId":"get_org_activity_organizations__organization_id__activity_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/stats":{"get":{"tags":["organizations"],"summary":"Get Org Stats","description":"Return aggregate counts for an organization.\n\n- avatars: total avatars in the organization\n- knowledge_bases: total knowledge bases in the organization\n- conversations: total chat sessions (internal + public) scoped to the org\n- active_contact_requests: PENDING or ON_HOLD contact requests scoped to the org","operationId":"get_org_stats_organizations__organization_id__stats_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/docs/{job_id}/{filename}":{"get":{"tags":["knowledge-base"],"summary":"Get Uploaded Document","description":"Serve an uploaded document by job and filename.\n\n- Authorization: user must belong to the job's KB organization.\n- Safety: restrict to base filename within data/uploads/{job_id}/.","operationId":"get_uploaded_document_kb_docs__job_id___filename__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/jobs":{"post":{"tags":["knowledge-base"],"summary":"Start Kb Ingestion Job","operationId":"start_kb_ingestion_job_kb_jobs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_start_kb_ingestion_job_kb_jobs_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBCreateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/jobs/{job_id}":{"get":{"tags":["knowledge-base"],"summary":"Get Kb Job Status","operationId":"get_kb_job_status_kb_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"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/KBJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/jobs/{job_id}/stream":{"get":{"tags":["knowledge-base"],"summary":"Stream Kb Job Progress","description":"Real-time Server-Sent Events (SSE) stream for job progress.\n\nPrefers the Authorization Bearer header (set by\n@microsoft/fetch-event-source on the frontend) so the access token\nnever appears in query-strings / Referer / proxy logs. The ?token=\nquery parameter remains supported for legacy clients but is\ndeprecated and will be removed in a future revision.","operationId":"stream_kb_job_progress_kb_jobs__job_id__stream_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb":{"get":{"tags":["knowledge-base"],"summary":"List Kbs","description":"Optimized Knowledge Base listing:\nReturns summary data only (no docs, no sources).\n- Aggregates document counts and vector totals\n- Includes latest & active job statuses\n- Executes as a single SQL query","operationId":"list_kbs_kb_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"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/KBListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/query":{"post":{"tags":["knowledge-base"],"summary":"Query Kb By Id","operationId":"query_kb_by_id_kb__kb_id__query_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/info":{"get":{"tags":["knowledge-base"],"summary":"Get Kb Info","description":"Returns detailed info about one KB:\n- Paginated document list\n- All source URLs\n- No expensive vector info calls","operationId":"get_kb_info_kb__kb_id__info_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/update":{"post":{"tags":["knowledge-base"],"summary":"Update Kb Documents","operationId":"update_kb_documents_kb__kb_id__update_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_kb_documents_kb__kb_id__update_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/upload-text":{"post":{"tags":["knowledge-base"],"summary":"Upload Text To Kb","description":"Upload raw text content into a KB via LightRAG bridge.\n\nSprint A3 / KB v3.0 — replaces the broken ChromaDB-cloud flow.\n\nBody schema: {\"content\": str, \"filename\": str (optional), \"mime_type\": str (optional)}\nResponse:    {\"track_id\": str, \"status\": \"queued\"}","operationId":"upload_text_to_kb_kb__kb_id__upload_text_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/track/{track_id}":{"get":{"tags":["knowledge-base"],"summary":"Track Upload Status","description":"Poll LightRAG for the processing status of an upload.","operationId":"track_upload_status_kb__kb_id__track__track_id__get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/wiki":{"get":{"tags":["knowledge-base"],"summary":"Get Kb Wiki","description":"Sprint C4 (v3.2) — render the auto-generated wiki for a KB as HTML.\n\nReads entity markdown files from /home/marco/wikis/aetherbot/<slug>/\n(mounted in this container) and concatenates them into a single HTML\ndocument for browser display.","operationId":"get_kb_wiki_kb__kb_id__wiki_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}":{"delete":{"tags":["knowledge-base"],"summary":"Delete Kb","description":"Hard delete the Knowledge Base and purge its Chroma collection.\n\n- Authorization: user must belong to the KB's organization.\n- Behavior: best-effort delete of Chroma collection, then hard-delete DB rows.\n- Response: `{ kb_id, deleted: true, collection_deleted: bool }`","operationId":"delete_kb_kb__kb_id__delete","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/active-job":{"get":{"tags":["knowledge-base"],"summary":"Get Active Job For Kb","operationId":"get_active_job_for_kb_kb__kb_id__active_job_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"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/KBActiveJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/sources/{source_id}/download":{"get":{"tags":["knowledge-base"],"summary":"Download the original source file for an org-owned KB document","description":"Stream the original uploaded file for a KB document back to the caller.\n\n- 403 if the calling user's org does not own this KB\n- 404 if KB or document does not exist\n- 410 if the document has been soft-deleted\n- Only FILE/CSV/TEXT category documents that have a resolvable path on disk\n  are served; URL-sourced documents have no file to download.","operationId":"download_kb_source_kb__kb_id__sources__source_id__download_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/enable":{"post":{"tags":["knowledge-base"],"summary":"Enable Kb","operationId":"enable_kb_kb__kb_id__enable_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb/{kb_id}/disable":{"post":{"tags":["knowledge-base"],"summary":"Disable Kb","operationId":"disable_kb_kb__kb_id__disable_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars-chat/{avatar_id}/query":{"post":{"tags":["avatars-chat"],"summary":"Query Avatar","operationId":"query_avatar_avatars_chat__avatar_id__query_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars-chat/chats":{"get":{"tags":["avatars-chat"],"summary":"List User Chats","operationId":"list_user_chats_avatars_chat_chats_get","parameters":[{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars-chat/chats/{chat_id}":{"get":{"tags":["avatars-chat"],"summary":"Get Chat History","operationId":"get_chat_history_avatars_chat_chats__chat_id__get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Load messages older than this message ID","title":"Before Id"},"description":"Load messages older than this message ID"},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Load messages before this timestamp (used if before_id missing)","title":"Before"},"description":"Load messages before this timestamp (used if before_id missing)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of messages to fetch","default":30,"title":"Limit"},"description":"Number of messages to fetch"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["avatars-chat"],"summary":"Delete Chat","operationId":"delete_chat_avatars_chat_chats__chat_id__delete","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars-chat/chats/{chat_id}/save":{"post":{"tags":["avatars-chat"],"summary":"Save Chat","operationId":"save_chat_avatars_chat_chats__chat_id__save_post","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"saved","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Saved"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars":{"get":{"tags":["avatars"],"summary":"List Avatars","description":"Fast and lightweight avatar listing.\n\n- Skips KB data entirely for maximum speed.\n- Supports pagination and optional name-based search.\n- Uses a single indexed query.","operationId":"list_avatars_avatars_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional search by avatar name","title":"Search"},"description":"Optional search by avatar name"},{"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/AvatarListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["avatars"],"summary":"Create Avatar","operationId":"create_avatar_avatars_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/AvatarCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars/{avatar_id}":{"get":{"tags":["avatars"],"summary":"Get Avatar","operationId":"get_avatar_avatars__avatar_id__get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"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/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["avatars"],"summary":"Update Avatar","operationId":"update_avatar_avatars__avatar_id__put","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["avatars"],"summary":"Delete Avatar","operationId":"delete_avatar_avatars__avatar_id__delete","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars/{avatar_id}/banner-image":{"post":{"tags":["avatars"],"summary":"Upload Banner","operationId":"upload_banner_avatars__avatar_id__banner_image_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_banner_avatars__avatar_id__banner_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarBannerUploadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars/{avatar_id}/disable":{"post":{"tags":["avatars"],"summary":"Disable Avatar","operationId":"disable_avatar_avatars__avatar_id__disable_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars/{avatar_id}/enable":{"post":{"tags":["avatars"],"summary":"Enable Avatar","operationId":"enable_avatar_avatars__avatar_id__enable_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/api-keys":{"get":{"tags":["api-keys"],"summary":"List Api Keys","operationId":"list_api_keys_organizations__organization_id__api_keys_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyOut"},"title":"Response List Api Keys Organizations  Organization Id  Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api-keys"],"summary":"Create Api Key","operationId":"create_api_key_organizations__organization_id__api_keys_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/api-keys/{api_key_id}":{"get":{"tags":["api-keys"],"summary":"Get Api Key","operationId":"get_api_key_organizations__organization_id__api_keys__api_key_id__get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Api Key Id"}},{"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/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["api-keys"],"summary":"Update Api Key","operationId":"update_api_key_organizations__organization_id__api_keys__api_key_id__patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Api Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api-keys"],"summary":"Delete Api Key","operationId":"delete_api_key_organizations__organization_id__api_keys__api_key_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Api Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars/{avatar_id}/domains":{"get":{"tags":["avatars"],"summary":"List Domains","operationId":"list_domains_avatars__avatar_id__domains_get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"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/AvatarDomainListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["avatars"],"summary":"Add Domain","operationId":"add_domain_avatars__avatar_id__domains_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarDomainIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarDomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/avatars/{avatar_id}/domains/{domain_id}":{"delete":{"tags":["avatars"],"summary":"Delete Domain","operationId":"delete_domain_avatars__avatar_id__domains__domain_id__delete","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training/avatars/{avatar_id}/examples":{"post":{"tags":["training"],"summary":"Create Training Example","operationId":"create_training_example_training_avatars__avatar_id__examples_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingExampleCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingExampleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["training"],"summary":"List Training Examples","operationId":"list_training_examples_training_avatars__avatar_id__examples_get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"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/TrainingExamplesListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training/examples/{entry_id}":{"patch":{"tags":["training"],"summary":"Update Training Example","operationId":"update_training_example_training_examples__entry_id__patch","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingExampleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["training"],"summary":"Delete Training Example","operationId":"delete_training_example_training_examples__entry_id__delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training/avatars/{avatar_id}/info":{"get":{"tags":["training"],"summary":"Get Training Info","operationId":"get_training_info_training_avatars__avatar_id__info_get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"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/TrainingInfoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/training/avatars/{avatar_id}/reindex":{"post":{"tags":["training"],"summary":"Reindex Training","operationId":"reindex_training_training_avatars__avatar_id__reindex_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/contacts":{"get":{"tags":["contacts"],"summary":"List Contacts","operationId":"list_contacts_organizations__organization_id__contacts_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}},{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"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/ContactListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/contacts/{contact_id}/status":{"patch":{"tags":["contacts"],"summary":"Update Contact Status","operationId":"update_contact_status_organizations__organization_id__contacts__contact_id__status_patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/current-plan":{"get":{"tags":["plans"],"summary":"Get Current Plan","operationId":"get_current_plan_current_plan_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/PlanStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/plans":{"get":{"tags":["billing"],"summary":"List Plans","description":"List all available subscription plans with their features and pricing.","operationId":"list_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlanResponse"},"type":"array","title":"Response List Plans Billing Plans Get"}}}}}}},"/billing/create-checkout-session":{"post":{"tags":["billing"],"summary":"Create Checkout Session","operationId":"create_checkout_session_billing_create_checkout_session_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/CheckoutSessionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout-session/{session_id}":{"get":{"tags":["billing"],"summary":"Get Checkout Session Status","operationId":"get_checkout_session_status_billing_checkout_session__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"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/CheckoutSessionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/create-portal-session":{"post":{"tags":["billing"],"summary":"Create Portal Session","operationId":"create_portal_session_billing_create_portal_session_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalSessionRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/cancel-subscription":{"post":{"tags":["billing"],"summary":"Cancel Subscription","operationId":"cancel_subscription_billing_cancel_subscription_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subscription/period-end":{"get":{"tags":["subscription"],"summary":"Get Subscription Period End","description":"Get the current period end date for the user's active subscription.\nReturns the date in a human-readable format (ISO 8601).","operationId":"get_subscription_period_end_subscription_period_end_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/SubscriptionPeriodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/organizations":{"get":{"tags":["admin"],"summary":"List All Organizations","operationId":"list_all_organizations_admin_organizations_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":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrganizationOut"},"title":"Response List All Organizations Admin Organizations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sendgrid-health":{"get":{"tags":["admin"],"summary":"Sendgrid Health","description":"Check whether the SendGrid API key is configured and reachable.\n\nReturns 200 with ``{\"configured\": true, \"reachable\": true}`` on success.\nReturns 200 with ``{\"configured\": false, \"reachable\": false}`` when no key\nis set (mock mode). Returns 502 when the key is set but SendGrid rejects\nthe auth check.","operationId":"sendgrid_health_admin_sendgrid_health_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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/stripe":{"post":{"tags":["webhooks"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events.\n\nVerifies the Stripe signature header against STRIPE_WEBHOOK_SECRET and\nprocesses valid events (checkout.session.completed,\ncustomer.subscription.updated, invoice.payment_*).\n\nThe /stripe_v2 path is retained as a deprecated alias for 7 days to\nallow Stripe console to be updated to /webhooks/stripe without an\noutage. Both paths point at this same handler.","operationId":"stripe_webhook_webhooks_stripe_post","parameters":[{"name":"stripe-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/workspace-connections":{"get":{"tags":["workspace-connectors"],"summary":"List Connections","operationId":"list_connections_organizations__organization_id__workspace_connections_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"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/WorkspaceConnectionListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/workspace-connections/{provider}/auth-url":{"post":{"tags":["workspace-connectors"],"summary":"Get Auth Url","description":"Get OAuth authorization URL for connecting a workspace provider.","operationId":"get_auth_url_organizations__organization_id__workspace_connections__provider__auth_url_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceAuthUrlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/callback/ms365":{"get":{"tags":["workspace-connectors"],"summary":"Ms365 Callback","description":"OAuth redirect — exchanges code, stores org-level connection, closes popup.","operationId":"ms365_callback_organizations_callback_ms365_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/callback/google":{"get":{"tags":["workspace-connectors"],"summary":"Google Callback","description":"OAuth redirect — exchanges code, stores org-level connection, closes popup.","operationId":"google_callback_organizations_callback_google_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/workspace-connections/{connection_id}":{"delete":{"tags":["workspace-connectors"],"summary":"Delete Connection","operationId":"delete_connection_organizations__organization_id__workspace_connections__connection_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/kb/{kb_id}/workspace-syncs":{"get":{"tags":["workspace-connectors"],"summary":"List Kb Syncs","description":"List workspace syncs configured for this KB.","operationId":"list_kb_syncs_organizations__organization_id__kb__kb_id__workspace_syncs_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{connection_id}":{"post":{"tags":["workspace-connectors"],"summary":"Create Kb Sync","description":"Link a workspace connection to this KB (create sync config).","operationId":"create_kb_sync_organizations__organization_id__kb__kb_id__workspace_syncs__connection_id__post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}":{"delete":{"tags":["workspace-connectors"],"summary":"Delete Kb Sync","description":"Remove a workspace sync from this KB.","operationId":"delete_kb_sync_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}/folders":{"get":{"tags":["workspace-connectors"],"summary":"List Folders","description":"List files and folders from the connected workspace for the picker UI.","operationId":"list_folders_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__folders_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"parent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"}},{"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/WorkspaceFolderListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workspace-connectors"],"summary":"Select Folders","description":"Save folder selection for this KB sync.","operationId":"select_folders_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__folders_patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceFolderSelectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}/sync":{"post":{"tags":["workspace-connectors"],"summary":"Trigger Sync","description":"Trigger a sync: download files + process through standard KB pipeline.","operationId":"trigger_sync_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__sync_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"full_sync","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Full Sync"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}/sync-records":{"get":{"tags":["workspace-connectors"],"summary":"List Sync Records","operationId":"list_sync_records_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__sync_records_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/modules":{"get":{"tags":["modules"],"summary":"List Modules","description":"List all active modules with their features and pricing.","operationId":"list_modules_modules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModuleResponse"},"type":"array","title":"Response List Modules Modules Get"}}}}}}},"/modules/packages":{"get":{"tags":["modules"],"summary":"List Packages","description":"List all active packages with their included modules.","operationId":"list_packages_modules_packages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PackageResponse"},"type":"array","title":"Response List Packages Modules Packages Get"}}}}}}},"/modules/pricing/calculate":{"get":{"tags":["modules"],"summary":"Calculate Pricing","description":"Calculate pricing for a set of modules with bundle discounts.","operationId":"calculate_pricing_modules_pricing_calculate_get","parameters":[{"name":"module_slugs","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated module slugs, e.g. CORE,WEBSITE_WIDGET","title":"Module Slugs"},"description":"Comma-separated module slugs, e.g. CORE,WEBSITE_WIDGET"},{"name":"billing_interval","in":"query","required":false,"schema":{"type":"string","description":"monthly or annual","default":"monthly","title":"Billing Interval"},"description":"monthly or annual"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingCalculationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/module-billing/checkout":{"post":{"tags":["module-billing"],"summary":"Checkout Modules","description":"Create a Stripe Checkout Session for selected modules.","operationId":"checkout_modules_module_billing_checkout_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/ModuleCheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/module-billing/add-module":{"post":{"tags":["module-billing"],"summary":"Add Module","description":"Add a module to an existing subscription.","operationId":"add_module_module_billing_add_module_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/AddModuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/module-billing/remove-module":{"post":{"tags":["module-billing"],"summary":"Remove Module","description":"Remove a module from the subscription.","operationId":"remove_module_module_billing_remove_module_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/RemoveModuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/module-billing/current":{"get":{"tags":["module-billing"],"summary":"Get Current Modules","description":"Returns current module subscriptions, usage, and pricing for the org.","operationId":"get_current_modules_module_billing_current_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/ModuleSubscriptionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/module-billing/switch-interval":{"post":{"tags":["module-billing"],"summary":"Switch Billing Interval","description":"Switch all modules between monthly and annual billing.","operationId":"switch_billing_interval_module_billing_switch_interval_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/SwitchIntervalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/profile":{"post":{"tags":["users"],"summary":"Complete Profile","operationId":"complete_profile_api_users_me_profile_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/UserProfileCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me":{"get":{"tags":["users"],"summary":"Get Me","operationId":"get_me_api_users_me_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/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Delete My Account","description":"Cascade hard-delete the authenticated user's account (GDPR Art. 17).\n\nDeletion is wrapped in a single DB transaction.  See\n``account_service.delete_user_account`` for the exact per-table strategy.\n\nReturns HTTP 204 on success, HTTP 404 if the account was already removed.","operationId":"delete_my_account_api_users_me_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/export":{"get":{"tags":["users"],"summary":"Export My Data","description":"Return a downloadable JSON archive of all personal data (GDPR Art. 20).\n\n- Requires valid JWT (Bearer token).\n- Enforces a 30-second server-side timeout; returns HTTP 504 on breach.\n- Response carries Content-Disposition: attachment so browsers download it.","operationId":"export_my_data_api_users_me_export_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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/get-name/{organization_id}":{"get":{"tags":["organizations"],"summary":"Get Name","operationId":"get_name_api_organizations_get_name__organization_id__get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/link-or-create":{"post":{"tags":["organizations"],"summary":"Link Or Create Org","operationId":"link_or_create_org_api_organizations_link_or_create_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/OrganizationLinkOrCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/members":{"get":{"tags":["organizations"],"summary":"List Members","operationId":"list_members_api_organizations__organization_id__members_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationMemberOut"},"title":"Response List Members Api Organizations  Organization Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/members/{member_user_id}/role":{"patch":{"tags":["organizations"],"summary":"Update Member Role","operationId":"update_member_role_api_organizations__organization_id__members__member_user_id__role_patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Member Role Api Organizations  Organization Id  Members  Member User Id  Role Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/members/{member_user_id}":{"delete":{"tags":["organizations"],"summary":"Remove Member","operationId":"remove_member_api_organizations__organization_id__members__member_user_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}":{"delete":{"tags":["organizations"],"summary":"Delete Organization","description":"Soft delete an organization and all its users.\n\n- Requires Owner role in the organization.\n- Marks Organization.deleted_at, all Memberships.deleted_at for the org,\n  and sets User.deleted_at for users belonging to the org.","operationId":"delete_organization_api_organizations__organization_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/leave":{"post":{"tags":["organizations"],"summary":"Leave Organization","description":"Leave an organization. If this was the user's last organization, soft-delete the user.\n\nRules:\n- Requires membership in the organization.\n- OWNER cannot leave; they must transfer ownership or delete the organization.\n- Soft-deletes the membership. If no memberships remain, soft-deletes the user.","operationId":"leave_organization_api_organizations__organization_id__leave_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/members/invite":{"post":{"tags":["organizations"],"summary":"Invite Member","operationId":"invite_member_api_organizations__organization_id__members_invite_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/invitations":{"get":{"tags":["organizations"],"summary":"List Invitations","operationId":"list_invitations_api_organizations__organization_id__invitations_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"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/InvitationListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/invitations/{invitation_id}":{"delete":{"tags":["organizations"],"summary":"Cancel Invitation","operationId":"cancel_invitation_api_organizations__organization_id__invitations__invitation_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/invitations/{token}":{"get":{"tags":["organizations"],"summary":"Get Invitation By Token","operationId":"get_invitation_by_token_api_organizations_invitations__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/invitations/{token}/check":{"get":{"tags":["organizations"],"summary":"Check Invitation","operationId":"check_invitation_api_organizations_invitations__token__check_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/invitations/{token}/accept":{"post":{"tags":["organizations"],"summary":"Accept Invitation","operationId":"accept_invitation_api_organizations_invitations__token__accept_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"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/MembershipOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/invitations/{token}/accept-anon":{"post":{"tags":["organizations"],"summary":"Accept Invitation Anonymously","operationId":"accept_invitation_anonymously_api_organizations_invitations__token__accept_anon_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/invitations/{token}/signup":{"post":{"tags":["organizations"],"summary":"Signup From Invitation","operationId":"signup_from_invitation_api_organizations_invitations__token__signup_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/chats/internal":{"get":{"tags":["organizations"],"summary":"List Internal Chats","operationId":"list_internal_chats_api_organizations__organization_id__chats_internal_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"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/ExternalChatListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/chats/external":{"get":{"tags":["organizations"],"summary":"List External Chats","operationId":"list_external_chats_api_organizations__organization_id__chats_external_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"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/ExternalChatListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/chats/{chat_id}":{"get":{"tags":["organizations"],"summary":"Get Chat History","description":"Fetch a chat's messages with cursor pagination (scrolling).","operationId":"get_chat_history_api_organizations__organization_id__chats__chat_id__get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Before Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/activity":{"get":{"tags":["organizations"],"summary":"Get Org Activity","operationId":"get_org_activity_api_organizations__organization_id__activity_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/stats":{"get":{"tags":["organizations"],"summary":"Get Org Stats","description":"Return aggregate counts for an organization.\n\n- avatars: total avatars in the organization\n- knowledge_bases: total knowledge bases in the organization\n- conversations: total chat sessions (internal + public) scoped to the org\n- active_contact_requests: PENDING or ON_HOLD contact requests scoped to the org","operationId":"get_org_stats_api_organizations__organization_id__stats_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/docs/{job_id}/{filename}":{"get":{"tags":["knowledge-base"],"summary":"Get Uploaded Document","description":"Serve an uploaded document by job and filename.\n\n- Authorization: user must belong to the job's KB organization.\n- Safety: restrict to base filename within data/uploads/{job_id}/.","operationId":"get_uploaded_document_api_kb_docs__job_id___filename__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/jobs":{"post":{"tags":["knowledge-base"],"summary":"Start Kb Ingestion Job","operationId":"start_kb_ingestion_job_api_kb_jobs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_start_kb_ingestion_job_api_kb_jobs_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBCreateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/jobs/{job_id}":{"get":{"tags":["knowledge-base"],"summary":"Get Kb Job Status","operationId":"get_kb_job_status_api_kb_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"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/KBJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/jobs/{job_id}/stream":{"get":{"tags":["knowledge-base"],"summary":"Stream Kb Job Progress","description":"Real-time Server-Sent Events (SSE) stream for job progress.\n\nPrefers the Authorization Bearer header (set by\n@microsoft/fetch-event-source on the frontend) so the access token\nnever appears in query-strings / Referer / proxy logs. The ?token=\nquery parameter remains supported for legacy clients but is\ndeprecated and will be removed in a future revision.","operationId":"stream_kb_job_progress_api_kb_jobs__job_id__stream_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb":{"get":{"tags":["knowledge-base"],"summary":"List Kbs","description":"Optimized Knowledge Base listing:\nReturns summary data only (no docs, no sources).\n- Aggregates document counts and vector totals\n- Includes latest & active job statuses\n- Executes as a single SQL query","operationId":"list_kbs_api_kb_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"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/KBListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/query":{"post":{"tags":["knowledge-base"],"summary":"Query Kb By Id","operationId":"query_kb_by_id_api_kb__kb_id__query_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/info":{"get":{"tags":["knowledge-base"],"summary":"Get Kb Info","description":"Returns detailed info about one KB:\n- Paginated document list\n- All source URLs\n- No expensive vector info calls","operationId":"get_kb_info_api_kb__kb_id__info_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/update":{"post":{"tags":["knowledge-base"],"summary":"Update Kb Documents","operationId":"update_kb_documents_api_kb__kb_id__update_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_kb_documents_api_kb__kb_id__update_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/upload-text":{"post":{"tags":["knowledge-base"],"summary":"Upload Text To Kb","description":"Upload raw text content into a KB via LightRAG bridge.\n\nSprint A3 / KB v3.0 — replaces the broken ChromaDB-cloud flow.\n\nBody schema: {\"content\": str, \"filename\": str (optional), \"mime_type\": str (optional)}\nResponse:    {\"track_id\": str, \"status\": \"queued\"}","operationId":"upload_text_to_kb_api_kb__kb_id__upload_text_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/track/{track_id}":{"get":{"tags":["knowledge-base"],"summary":"Track Upload Status","description":"Poll LightRAG for the processing status of an upload.","operationId":"track_upload_status_api_kb__kb_id__track__track_id__get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/wiki":{"get":{"tags":["knowledge-base"],"summary":"Get Kb Wiki","description":"Sprint C4 (v3.2) — render the auto-generated wiki for a KB as HTML.\n\nReads entity markdown files from /home/marco/wikis/aetherbot/<slug>/\n(mounted in this container) and concatenates them into a single HTML\ndocument for browser display.","operationId":"get_kb_wiki_api_kb__kb_id__wiki_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}":{"delete":{"tags":["knowledge-base"],"summary":"Delete Kb","description":"Hard delete the Knowledge Base and purge its Chroma collection.\n\n- Authorization: user must belong to the KB's organization.\n- Behavior: best-effort delete of Chroma collection, then hard-delete DB rows.\n- Response: `{ kb_id, deleted: true, collection_deleted: bool }`","operationId":"delete_kb_api_kb__kb_id__delete","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/active-job":{"get":{"tags":["knowledge-base"],"summary":"Get Active Job For Kb","operationId":"get_active_job_for_kb_api_kb__kb_id__active_job_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"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/KBActiveJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/sources/{source_id}/download":{"get":{"tags":["knowledge-base"],"summary":"Download the original source file for an org-owned KB document","description":"Stream the original uploaded file for a KB document back to the caller.\n\n- 403 if the calling user's org does not own this KB\n- 404 if KB or document does not exist\n- 410 if the document has been soft-deleted\n- Only FILE/CSV/TEXT category documents that have a resolvable path on disk\n  are served; URL-sourced documents have no file to download.","operationId":"download_kb_source_api_kb__kb_id__sources__source_id__download_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/enable":{"post":{"tags":["knowledge-base"],"summary":"Enable Kb","operationId":"enable_kb_api_kb__kb_id__enable_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/{kb_id}/disable":{"post":{"tags":["knowledge-base"],"summary":"Disable Kb","operationId":"disable_kb_api_kb__kb_id__disable_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars-chat/{avatar_id}/query":{"post":{"tags":["avatars-chat"],"summary":"Query Avatar","operationId":"query_avatar_api_avatars_chat__avatar_id__query_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars-chat/chats":{"get":{"tags":["avatars-chat"],"summary":"List User Chats","operationId":"list_user_chats_api_avatars_chat_chats_get","parameters":[{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars-chat/chats/{chat_id}":{"get":{"tags":["avatars-chat"],"summary":"Get Chat History","operationId":"get_chat_history_api_avatars_chat_chats__chat_id__get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Load messages older than this message ID","title":"Before Id"},"description":"Load messages older than this message ID"},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Load messages before this timestamp (used if before_id missing)","title":"Before"},"description":"Load messages before this timestamp (used if before_id missing)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of messages to fetch","default":30,"title":"Limit"},"description":"Number of messages to fetch"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["avatars-chat"],"summary":"Delete Chat","operationId":"delete_chat_api_avatars_chat_chats__chat_id__delete","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars-chat/chats/{chat_id}/save":{"post":{"tags":["avatars-chat"],"summary":"Save Chat","operationId":"save_chat_api_avatars_chat_chats__chat_id__save_post","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"saved","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Saved"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars":{"get":{"tags":["avatars"],"summary":"List Avatars","description":"Fast and lightweight avatar listing.\n\n- Skips KB data entirely for maximum speed.\n- Supports pagination and optional name-based search.\n- Uses a single indexed query.","operationId":"list_avatars_api_avatars_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional search by avatar name","title":"Search"},"description":"Optional search by avatar name"},{"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/AvatarListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["avatars"],"summary":"Create Avatar","operationId":"create_avatar_api_avatars_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/AvatarCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}":{"get":{"tags":["avatars"],"summary":"Get Avatar","operationId":"get_avatar_api_avatars__avatar_id__get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"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/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["avatars"],"summary":"Update Avatar","operationId":"update_avatar_api_avatars__avatar_id__put","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["avatars"],"summary":"Delete Avatar","operationId":"delete_avatar_api_avatars__avatar_id__delete","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}/banner-image":{"post":{"tags":["avatars"],"summary":"Upload Banner","operationId":"upload_banner_api_avatars__avatar_id__banner_image_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_banner_api_avatars__avatar_id__banner_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarBannerUploadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}/disable":{"post":{"tags":["avatars"],"summary":"Disable Avatar","operationId":"disable_avatar_api_avatars__avatar_id__disable_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}/enable":{"post":{"tags":["avatars"],"summary":"Enable Avatar","operationId":"enable_avatar_api_avatars__avatar_id__enable_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/api-keys":{"get":{"tags":["api-keys"],"summary":"List Api Keys","operationId":"list_api_keys_api_organizations__organization_id__api_keys_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyOut"},"title":"Response List Api Keys Api Organizations  Organization Id  Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api-keys"],"summary":"Create Api Key","operationId":"create_api_key_api_organizations__organization_id__api_keys_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/api-keys/{api_key_id}":{"get":{"tags":["api-keys"],"summary":"Get Api Key","operationId":"get_api_key_api_organizations__organization_id__api_keys__api_key_id__get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Api Key Id"}},{"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/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["api-keys"],"summary":"Update Api Key","operationId":"update_api_key_api_organizations__organization_id__api_keys__api_key_id__patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Api Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api-keys"],"summary":"Delete Api Key","operationId":"delete_api_key_api_organizations__organization_id__api_keys__api_key_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Api Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}/domains":{"get":{"tags":["avatars"],"summary":"List Domains","operationId":"list_domains_api_avatars__avatar_id__domains_get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"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/AvatarDomainListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["avatars"],"summary":"Add Domain","operationId":"add_domain_api_avatars__avatar_id__domains_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarDomainIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarDomainOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}/domains/{domain_id}":{"delete":{"tags":["avatars"],"summary":"Delete Domain","operationId":"delete_domain_api_avatars__avatar_id__domains__domain_id__delete","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/avatars/{avatar_id}/examples":{"post":{"tags":["training"],"summary":"Create Training Example","operationId":"create_training_example_api_training_avatars__avatar_id__examples_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingExampleCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingExampleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["training"],"summary":"List Training Examples","operationId":"list_training_examples_api_training_avatars__avatar_id__examples_get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"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/TrainingExamplesListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/examples/{entry_id}":{"patch":{"tags":["training"],"summary":"Update Training Example","operationId":"update_training_example_api_training_examples__entry_id__patch","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingExampleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["training"],"summary":"Delete Training Example","operationId":"delete_training_example_api_training_examples__entry_id__delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/avatars/{avatar_id}/info":{"get":{"tags":["training"],"summary":"Get Training Info","operationId":"get_training_info_api_training_avatars__avatar_id__info_get","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"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/TrainingInfoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/avatars/{avatar_id}/reindex":{"post":{"tags":["training"],"summary":"Reindex Training","operationId":"reindex_training_api_training_avatars__avatar_id__reindex_post","parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/contacts":{"get":{"tags":["contacts"],"summary":"List Contacts","operationId":"list_contacts_api_organizations__organization_id__contacts_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}},{"name":"avatar_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"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/ContactListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/contacts/{contact_id}/status":{"patch":{"tags":["contacts"],"summary":"Update Contact Status","operationId":"update_contact_status_api_organizations__organization_id__contacts__contact_id__status_patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/current-plan":{"get":{"tags":["plans"],"summary":"Get Current Plan","operationId":"get_current_plan_api_current_plan_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/PlanStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/plans":{"get":{"tags":["billing"],"summary":"List Plans","description":"List all available subscription plans with their features and pricing.","operationId":"list_plans_api_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlanResponse"},"type":"array","title":"Response List Plans Api Billing Plans Get"}}}}}}},"/api/billing/create-checkout-session":{"post":{"tags":["billing"],"summary":"Create Checkout Session","operationId":"create_checkout_session_api_billing_create_checkout_session_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/CheckoutSessionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/checkout-session/{session_id}":{"get":{"tags":["billing"],"summary":"Get Checkout Session Status","operationId":"get_checkout_session_status_api_billing_checkout_session__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"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/CheckoutSessionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/create-portal-session":{"post":{"tags":["billing"],"summary":"Create Portal Session","operationId":"create_portal_session_api_billing_create_portal_session_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalSessionRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/cancel-subscription":{"post":{"tags":["billing"],"summary":"Cancel Subscription","operationId":"cancel_subscription_api_billing_cancel_subscription_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/period-end":{"get":{"tags":["subscription"],"summary":"Get Subscription Period End","description":"Get the current period end date for the user's active subscription.\nReturns the date in a human-readable format (ISO 8601).","operationId":"get_subscription_period_end_api_subscription_period_end_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/SubscriptionPeriodResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/organizations":{"get":{"tags":["admin"],"summary":"List All Organizations","operationId":"list_all_organizations_api_admin_organizations_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":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrganizationOut"},"title":"Response List All Organizations Api Admin Organizations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/sendgrid-health":{"get":{"tags":["admin"],"summary":"Sendgrid Health","description":"Check whether the SendGrid API key is configured and reachable.\n\nReturns 200 with ``{\"configured\": true, \"reachable\": true}`` on success.\nReturns 200 with ``{\"configured\": false, \"reachable\": false}`` when no key\nis set (mock mode). Returns 502 when the key is set but SendGrid rejects\nthe auth check.","operationId":"sendgrid_health_api_admin_sendgrid_health_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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/workspace-connections":{"get":{"tags":["workspace-connectors"],"summary":"List Connections","operationId":"list_connections_api_organizations__organization_id__workspace_connections_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"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/WorkspaceConnectionListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/workspace-connections/{provider}/auth-url":{"post":{"tags":["workspace-connectors"],"summary":"Get Auth Url","description":"Get OAuth authorization URL for connecting a workspace provider.","operationId":"get_auth_url_api_organizations__organization_id__workspace_connections__provider__auth_url_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceAuthUrlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/callback/ms365":{"get":{"tags":["workspace-connectors"],"summary":"Ms365 Callback","description":"OAuth redirect — exchanges code, stores org-level connection, closes popup.","operationId":"ms365_callback_api_organizations_callback_ms365_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/callback/google":{"get":{"tags":["workspace-connectors"],"summary":"Google Callback","description":"OAuth redirect — exchanges code, stores org-level connection, closes popup.","operationId":"google_callback_api_organizations_callback_google_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/workspace-connections/{connection_id}":{"delete":{"tags":["workspace-connectors"],"summary":"Delete Connection","operationId":"delete_connection_api_organizations__organization_id__workspace_connections__connection_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/kb/{kb_id}/workspace-syncs":{"get":{"tags":["workspace-connectors"],"summary":"List Kb Syncs","description":"List workspace syncs configured for this KB.","operationId":"list_kb_syncs_api_organizations__organization_id__kb__kb_id__workspace_syncs_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{connection_id}":{"post":{"tags":["workspace-connectors"],"summary":"Create Kb Sync","description":"Link a workspace connection to this KB (create sync config).","operationId":"create_kb_sync_api_organizations__organization_id__kb__kb_id__workspace_syncs__connection_id__post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}":{"delete":{"tags":["workspace-connectors"],"summary":"Delete Kb Sync","description":"Remove a workspace sync from this KB.","operationId":"delete_kb_sync_api_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__delete","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}/folders":{"get":{"tags":["workspace-connectors"],"summary":"List Folders","description":"List files and folders from the connected workspace for the picker UI.","operationId":"list_folders_api_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__folders_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"parent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"}},{"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/WorkspaceFolderListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workspace-connectors"],"summary":"Select Folders","description":"Save folder selection for this KB sync.","operationId":"select_folders_api_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__folders_patch","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceFolderSelectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}/sync":{"post":{"tags":["workspace-connectors"],"summary":"Trigger Sync","description":"Trigger a sync: download files + process through standard KB pipeline.","operationId":"trigger_sync_api_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__sync_post","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"full_sync","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Full Sync"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organizations/{organization_id}/kb/{kb_id}/workspace-syncs/{sync_id}/sync-records":{"get":{"tags":["workspace-connectors"],"summary":"List Sync Records","operationId":"list_sync_records_api_organizations__organization_id__kb__kb_id__workspace_syncs__sync_id__sync_records_get","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Kb Id"}},{"name":"sync_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sync Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/modules":{"get":{"tags":["modules"],"summary":"List Modules","description":"List all active modules with their features and pricing.","operationId":"list_modules_api_modules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModuleResponse"},"type":"array","title":"Response List Modules Api Modules Get"}}}}}}},"/api/modules/packages":{"get":{"tags":["modules"],"summary":"List Packages","description":"List all active packages with their included modules.","operationId":"list_packages_api_modules_packages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PackageResponse"},"type":"array","title":"Response List Packages Api Modules Packages Get"}}}}}}},"/api/modules/pricing/calculate":{"get":{"tags":["modules"],"summary":"Calculate Pricing","description":"Calculate pricing for a set of modules with bundle discounts.","operationId":"calculate_pricing_api_modules_pricing_calculate_get","parameters":[{"name":"module_slugs","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated module slugs, e.g. CORE,WEBSITE_WIDGET","title":"Module Slugs"},"description":"Comma-separated module slugs, e.g. CORE,WEBSITE_WIDGET"},{"name":"billing_interval","in":"query","required":false,"schema":{"type":"string","description":"monthly or annual","default":"monthly","title":"Billing Interval"},"description":"monthly or annual"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingCalculationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/module-billing/checkout":{"post":{"tags":["module-billing"],"summary":"Checkout Modules","description":"Create a Stripe Checkout Session for selected modules.","operationId":"checkout_modules_api_module_billing_checkout_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/ModuleCheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/module-billing/add-module":{"post":{"tags":["module-billing"],"summary":"Add Module","description":"Add a module to an existing subscription.","operationId":"add_module_api_module_billing_add_module_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/AddModuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/module-billing/remove-module":{"post":{"tags":["module-billing"],"summary":"Remove Module","description":"Remove a module from the subscription.","operationId":"remove_module_api_module_billing_remove_module_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/RemoveModuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/module-billing/current":{"get":{"tags":["module-billing"],"summary":"Get Current Modules","description":"Returns current module subscriptions, usage, and pricing for the org.","operationId":"get_current_modules_api_module_billing_current_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/ModuleSubscriptionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/module-billing/switch-interval":{"post":{"tags":["module-billing"],"summary":"Switch Billing Interval","description":"Switch all modules between monthly and annual billing.","operationId":"switch_billing_interval_api_module_billing_switch_interval_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/SwitchIntervalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/deep":{"get":{"summary":"Health Deep","operationId":"health_deep_health_deep_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AddModuleRequest":{"properties":{"module_slug":{"type":"string","title":"Module Slug"}},"type":"object","required":["module_slug"],"title":"AddModuleRequest"},"AdminOrganizationOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"$ref":"#/components/schemas/OrganizationStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"owner":{"anyOf":[{"$ref":"#/components/schemas/AdminOrganizationOwner"},{"type":"null"}]}},"type":"object","required":["id","name","status","created_at"],"title":"AdminOrganizationOut"},"AdminOrganizationOwner":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"AdminOrganizationOwner"},"ApiKeyCreate":{"properties":{"name":{"type":"string","title":"Name"},"allow_all_avatars":{"type":"boolean","title":"Allow All Avatars","default":true},"avatar_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Avatar Ids"},"default_top_k":{"type":"integer","title":"Default Top K","default":8}},"type":"object","required":["name"],"title":"ApiKeyCreate"},"ApiKeyOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"created_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By User Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"allow_all_avatars":{"type":"boolean","title":"Allow All Avatars"},"avatar_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Avatar Ids"},"default_top_k":{"type":"integer","title":"Default Top K"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","name","key_prefix","allow_all_avatars","default_top_k","created_at","updated_at"],"title":"ApiKeyOut"},"ApiKeyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"allow_all_avatars":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Allow All Avatars"},"avatar_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Avatar Ids"},"default_top_k":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Top K"}},"type":"object","title":"ApiKeyUpdate"},"ApiKeyWithSecret":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"created_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By User Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"allow_all_avatars":{"type":"boolean","title":"Allow All Avatars"},"avatar_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Avatar Ids"},"default_top_k":{"type":"integer","title":"Default Top K"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["id","organization_id","name","key_prefix","allow_all_avatars","default_top_k","created_at","updated_at","api_key"],"title":"ApiKeyWithSecret"},"AvatarBannerUploadOut":{"properties":{"avatar_id":{"type":"string","title":"Avatar Id"},"banner_path":{"type":"string","title":"Banner Path"},"banner_url":{"type":"string","title":"Banner Url"}},"type":"object","required":["avatar_id","banner_path","banner_url"],"title":"AvatarBannerUploadOut"},"AvatarCreateRequest":{"properties":{"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"name":{"type":"string","title":"Name"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"kbs":{"items":{"$ref":"#/components/schemas/AvatarKBLinkIn"},"type":"array","title":"Kbs"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"avatar_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Image"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"}},"type":"object","required":["name"],"title":"AvatarCreateRequest"},"AvatarDomainIn":{"properties":{"domain":{"type":"string","title":"Domain"}},"type":"object","required":["domain"],"title":"AvatarDomainIn"},"AvatarDomainListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AvatarDomainOut"},"type":"array","title":"Items"}},"type":"object","title":"AvatarDomainListOut"},"AvatarDomainOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"domain":{"type":"string","title":"Domain"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","domain","created_at","updated_at"],"title":"AvatarDomainOut"},"AvatarKBLinkIn":{"properties":{"kb_id":{"type":"string","format":"uuid","title":"Kb Id"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"type":"object","required":["kb_id"],"title":"AvatarKBLinkIn"},"AvatarKBLinkOut":{"properties":{"kb_id":{"type":"string","format":"uuid","title":"Kb Id"},"kb_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Name"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"type":"object","required":["kb_id"],"title":"AvatarKBLinkOut"},"AvatarListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AvatarSummaryOut"},"type":"array","title":"Items"}},"type":"object","title":"AvatarListOut"},"AvatarOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"name":{"type":"string","title":"Name"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"avatar_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Image"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"},"kbs":{"items":{"$ref":"#/components/schemas/AvatarKBLinkOut"},"type":"array","title":"Kbs"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","name","created_at","updated_at"],"title":"AvatarOut"},"AvatarQueryRequest":{"properties":{"query":{"type":"string","title":"Query"},"k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"K","default":8},"chat_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Chat Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","required":["query"],"title":"AvatarQueryRequest"},"AvatarSummaryOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"name":{"type":"string","title":"Name"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"avatar_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Image"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","name","is_enabled","created_at","updated_at"],"title":"AvatarSummaryOut"},"AvatarUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"kbs":{"anyOf":[{"items":{"$ref":"#/components/schemas/AvatarKBLinkIn"},"type":"array"},{"type":"null"}],"title":"Kbs"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"avatar_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Image"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"}},"type":"object","title":"AvatarUpdateRequest"},"Body_start_kb_ingestion_job_api_kb_jobs_post":{"properties":{"kb_name":{"type":"string","title":"Kb Name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"files":{"anyOf":[{"items":{"type":"string","format":"binary"},"type":"array"},{"type":"null"}],"title":"Files"},"urls_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urls Json","description":"JSON list of URLs"},"csv_urls_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Urls Json","description":"JSON list of CSV feed URLs to ingest as files"},"texts_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Texts Json","description":"JSON list of static text strings"},"url_options_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Options Json","description":"JSON list of dicts, one per URL, e.g. `[{\"mode\":\"scrape\"},{\"mode\":\"crawl\",\"limit\":5}]`"}},"type":"object","required":["kb_name"],"title":"Body_start_kb_ingestion_job_api_kb_jobs_post"},"Body_start_kb_ingestion_job_kb_jobs_post":{"properties":{"kb_name":{"type":"string","title":"Kb Name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"files":{"anyOf":[{"items":{"type":"string","format":"binary"},"type":"array"},{"type":"null"}],"title":"Files"},"urls_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urls Json","description":"JSON list of URLs"},"csv_urls_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Urls Json","description":"JSON list of CSV feed URLs to ingest as files"},"texts_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Texts Json","description":"JSON list of static text strings"},"url_options_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Options Json","description":"JSON list of dicts, one per URL, e.g. `[{\"mode\":\"scrape\"},{\"mode\":\"crawl\",\"limit\":5}]`"}},"type":"object","required":["kb_name"],"title":"Body_start_kb_ingestion_job_kb_jobs_post"},"Body_update_kb_documents_api_kb__kb_id__update_post":{"properties":{"files_to_add":{"anyOf":[{"items":{"type":"string","format":"binary"},"type":"array"},{"type":"null"}],"title":"Files To Add"},"urls_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urls Json To Add"},"csv_urls_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Urls Json To Add"},"texts_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Texts Json To Add"},"remove_documents_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remove Documents Json"},"url_options_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Options Json To Add","description":"JSON list of dicts for URLs added, one per URL, e.g. `[{\"mode\":\"scrape\"},{\"mode\":\"crawl\",\"limit\":5}]`"}},"type":"object","title":"Body_update_kb_documents_api_kb__kb_id__update_post"},"Body_update_kb_documents_kb__kb_id__update_post":{"properties":{"files_to_add":{"anyOf":[{"items":{"type":"string","format":"binary"},"type":"array"},{"type":"null"}],"title":"Files To Add"},"urls_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urls Json To Add"},"csv_urls_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Urls Json To Add"},"texts_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Texts Json To Add"},"remove_documents_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remove Documents Json"},"url_options_json_to_add":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Options Json To Add","description":"JSON list of dicts for URLs added, one per URL, e.g. `[{\"mode\":\"scrape\"},{\"mode\":\"crawl\",\"limit\":5}]`"}},"type":"object","title":"Body_update_kb_documents_kb__kb_id__update_post"},"Body_upload_banner_api_avatars__avatar_id__banner_image_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_upload_banner_api_avatars__avatar_id__banner_image_post"},"Body_upload_banner_avatars__avatar_id__banner_image_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_upload_banner_avatars__avatar_id__banner_image_post"},"CheckoutSessionRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"success_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Cancel Url"},"mode":{"type":"string","enum":["payment","subscription"],"title":"Mode","default":"subscription"}},"type":"object","required":["plan"],"title":"CheckoutSessionRequest"},"CheckoutSessionResponse":{"properties":{"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"action":{"type":"string","enum":["redirect","updated"],"title":"Action","default":"redirect"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},"type":"object","title":"CheckoutSessionResponse"},"CheckoutSessionStatusResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"payment_status":{"type":"string","title":"Payment Status"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanType"},{"type":"string"},{"type":"null"}],"title":"Plan"}},"type":"object","required":["session_id","payment_status"],"title":"CheckoutSessionStatusResponse"},"ContactListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContactOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"pages":{"type":"integer","title":"Pages"}},"type":"object","required":["total","page","page_size","pages"],"title":"ContactListOut"},"ContactOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"avatar_id":{"type":"string","format":"uuid","title":"Avatar Id"},"avatar_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Name"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Message Id"},"api_key_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Api Key Id"},"name":{"type":"string","title":"Name"},"contact_method":{"type":"string","title":"Contact Method"},"contact_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Value"},"concern_text":{"type":"string","title":"Concern Text"},"status":{"type":"string","title":"Status"},"email_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Sent At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","avatar_id","chat_id","name","contact_method","concern_text","status","created_at","updated_at"],"title":"ContactOut"},"ContactStatusUpdate":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"ContactStatusUpdate"},"ExternalChatListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalChatSummaryOut"},"type":"array","title":"Items"}},"type":"object","title":"ExternalChatListOut"},"ExternalChatSummaryOut":{"properties":{"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"avatar_id":{"type":"string","format":"uuid","title":"Avatar Id"},"external_user_id":{"type":"string","title":"External User Id"},"external_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Name"},"project_name":{"type":"string","title":"Project Name"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"last_ai_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Ai Message"},"last_user_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last User Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["chat_id","avatar_id","external_user_id","project_name","created_at","updated_at"],"title":"ExternalChatSummaryOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvitationCheckOut":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"organization_name":{"type":"string","title":"Organization Name"},"role":{"$ref":"#/components/schemas/RoleType"},"is_user":{"type":"boolean","title":"Is User"}},"type":"object","required":["email","organization_id","organization_name","role","is_user"],"title":"InvitationCheckOut"},"InvitationCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"$ref":"#/components/schemas/RoleType","default":"MEMBER"}},"type":"object","required":["email"],"title":"InvitationCreate"},"InvitationListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvitationOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"InvitationListOut"},"InvitationOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","format":"email","title":"Email"},"role":{"$ref":"#/components/schemas/RoleType"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"canceled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Canceled At"}},"type":"object","required":["id","email","role","created_at","expires_at"],"title":"InvitationOut"},"KBActiveJobOut":{"properties":{"kb_id":{"type":"string","format":"uuid","title":"Kb Id"},"active_job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Active Job Id"},"active_job_status":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeJobStatus"},{"type":"null"}]}},"type":"object","required":["kb_id"],"title":"KBActiveJobOut"},"KBCreateJobResponse":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id"},"kb_id":{"type":"string","format":"uuid","title":"Kb Id"},"kb_name":{"type":"string","title":"Kb Name"},"status":{"$ref":"#/components/schemas/KnowledgeJobStatus"}},"type":"object","required":["job_id","kb_id","kb_name","status"],"title":"KBCreateJobResponse"},"KBJobItemOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"source_type":{"$ref":"#/components/schemas/KnowledgeSourceType"},"input_label":{"type":"string","title":"Input Label"},"document_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Name"},"status":{"$ref":"#/components/schemas/KnowledgeJobItemStatus"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step"},"indexed":{"type":"integer","title":"Indexed"},"vectors":{"type":"integer","title":"Vectors"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","source_type","input_label","status","indexed","vectors"],"title":"KBJobItemOut"},"KBJobOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kb_id":{"type":"string","format":"uuid","title":"Kb Id"},"status":{"$ref":"#/components/schemas/KnowledgeJobStatus"},"total_items":{"type":"integer","title":"Total Items"},"processed_items":{"type":"integer","title":"Processed Items"},"total_indexed":{"type":"integer","title":"Total Indexed"},"total_vectors":{"type":"integer","title":"Total Vectors"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"items":{"items":{"$ref":"#/components/schemas/KBJobItemOut"},"type":"array","title":"Items"}},"type":"object","required":["id","kb_id","status","total_items","processed_items","total_indexed","total_vectors"],"title":"KBJobOut"},"KBListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/KBOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"KBListOut"},"KBOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"name":{"type":"string","title":"Name"},"collection":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection"},"documents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Documents","default":0},"total_indexed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Indexed","default":0},"total_vectors":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Vectors","default":0},"active_job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Active Job Id"},"active_job_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Job Status"},"last_job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Last Job Id"},"last_job_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Job Status"},"kb_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Status"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","name","collection","is_enabled","created_at","updated_at"],"title":"KBOut"},"KBQueryRequest":{"properties":{"q":{"type":"string","title":"Q"},"k":{"type":"integer","title":"K","default":8},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"}},"type":"object","required":["q"],"title":"KBQueryRequest"},"KBQueryResponse":{"properties":{"ids":{"anyOf":[{"items":{"items":{"type":"string"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Ids"},"distances":{"anyOf":[{"items":{"items":{"type":"number"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Distances"},"documents":{"anyOf":[{"items":{"items":{"type":"string"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Documents"},"metadatas":{"anyOf":[{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Metadatas"}},"type":"object","title":"KBQueryResponse"},"KnowledgeJobItemStatus":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED","FAILED"],"title":"KnowledgeJobItemStatus"},"KnowledgeJobStatus":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED","FAILED"],"title":"KnowledgeJobStatus"},"KnowledgeSourceType":{"type":"string","enum":["FILE","TEXT","URL","CSV"],"title":"KnowledgeSourceType"},"MagicLinkRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}},"type":"object","required":["email"],"title":"MagicLinkRequest"},"MemberRoleUpdate":{"properties":{"role":{"$ref":"#/components/schemas/RoleType"}},"type":"object","required":["role"],"title":"MemberRoleUpdate"},"MembershipOut":{"properties":{"organization":{"$ref":"#/components/schemas/OrganizationOut"},"role":{"$ref":"#/components/schemas/RoleType"}},"type":"object","required":["organization","role"],"title":"MembershipOut"},"ModuleCheckoutRequest":{"properties":{"module_slugs":{"items":{"type":"string"},"type":"array","title":"Module Slugs"},"billing_interval":{"type":"string","title":"Billing Interval","default":"monthly"},"package_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Slug"},"success_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","required":["module_slugs"],"title":"ModuleCheckoutRequest"},"ModuleFeatureResponse":{"properties":{"feature_key":{"type":"string","title":"Feature Key"},"included_limit":{"type":"integer","title":"Included Limit"},"is_boolean":{"type":"boolean","title":"Is Boolean","default":false},"overage_unit_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Overage Unit Size"},"overage_price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Overage Price Cents"}},"type":"object","required":["feature_key","included_limit"],"title":"ModuleFeatureResponse"},"ModuleResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"price_cents_monthly":{"type":"integer","title":"Price Cents Monthly"},"price_cents_annual":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Annual"},"currency":{"type":"string","title":"Currency","default":"eur"},"is_active":{"type":"boolean","title":"Is Active","default":true},"features":{"items":{"$ref":"#/components/schemas/ModuleFeatureResponse"},"type":"array","title":"Features","default":[]}},"type":"object","required":["id","slug","name","price_cents_monthly"],"title":"ModuleResponse"},"ModuleSubscriptionDetail":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"price_cents":{"type":"integer","title":"Price Cents"},"billing_interval":{"type":"string","title":"Billing Interval"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false}},"type":"object","required":["slug","name","status","price_cents","billing_interval"],"title":"ModuleSubscriptionDetail"},"ModuleSubscriptionStatusResponse":{"properties":{"billing_interval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Interval"},"modules":{"items":{"$ref":"#/components/schemas/ModuleSubscriptionDetail"},"type":"array","title":"Modules","default":[]},"bundle_discount_rate":{"type":"string","title":"Bundle Discount Rate","default":"0"},"total_monthly_cents":{"type":"integer","title":"Total Monthly Cents","default":0},"usage":{"items":{"$ref":"#/components/schemas/ModuleUsageDetail"},"type":"array","title":"Usage","default":[]}},"type":"object","title":"ModuleSubscriptionStatusResponse"},"ModuleUsageDetail":{"properties":{"feature_key":{"type":"string","title":"Feature Key"},"used":{"type":"integer","title":"Used"},"included":{"type":"integer","title":"Included"},"overage_quantity":{"type":"integer","title":"Overage Quantity","default":0},"overage_cost_cents":{"type":"integer","title":"Overage Cost Cents","default":0}},"type":"object","required":["feature_key","used","included"],"title":"ModuleUsageDetail"},"OrganizationLinkOrCreate":{"properties":{"name":{"type":"string","title":"Name"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"team_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Team Size"}},"type":"object","required":["name"],"title":"OrganizationLinkOrCreate"},"OrganizationMemberOut":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"email":{"type":"string","format":"email","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"$ref":"#/components/schemas/RoleType"},"joined_at":{"type":"string","format":"date-time","title":"Joined At"}},"type":"object","required":["user_id","email","role","joined_at"],"title":"OrganizationMemberOut"},"OrganizationOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"team_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Team Size"},"status":{"$ref":"#/components/schemas/OrganizationStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","status","created_at","updated_at"],"title":"OrganizationOut"},"OrganizationStatus":{"type":"string","enum":["ACTIVE","SUSPENDED","DELETED"],"title":"OrganizationStatus"},"PackageModuleResponse":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"}},"type":"object","required":["slug","name"],"title":"PackageModuleResponse"},"PackageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"price_cents_monthly":{"type":"integer","title":"Price Cents Monthly"},"price_cents_annual":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Annual"},"currency":{"type":"string","title":"Currency","default":"eur"},"is_active":{"type":"boolean","title":"Is Active","default":true},"modules":{"items":{"$ref":"#/components/schemas/PackageModuleResponse"},"type":"array","title":"Modules","default":[]}},"type":"object","required":["id","slug","name","price_cents_monthly"],"title":"PackageResponse"},"PlanFeatureResponse":{"properties":{"feature_key":{"type":"string","title":"Feature Key"},"default_limit":{"type":"integer","title":"Default Limit"},"overage_unit_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Overage Unit Size"},"overage_price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Overage Price Cents"}},"type":"object","required":["feature_key","default_limit"],"title":"PlanFeatureResponse"},"PlanResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"price_cents":{"type":"integer","title":"Price Cents","default":0},"currency":{"type":"string","title":"Currency","default":"eur"},"features":{"items":{"$ref":"#/components/schemas/PlanFeatureResponse"},"type":"array","title":"Features","default":[]},"is_default":{"type":"boolean","title":"Is Default","default":false}},"type":"object","required":["id","slug","name"],"title":"PlanResponse"},"PlanSlug":{"type":"string","enum":["FREE","BASIC","PRO","ENTERPRISE"],"title":"PlanSlug"},"PlanStatusResponse":{"properties":{"plan":{"type":"string","title":"Plan"},"plan_slug":{"$ref":"#/components/schemas/PlanSlug"},"features":{"additionalProperties":true,"type":"object","title":"Features"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"upcoming_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upcoming Plan"}},"type":"object","required":["plan","plan_slug","features"],"title":"PlanStatusResponse"},"PlanType":{"type":"string","enum":["FREE","BASIC","PRO","ENTERPRISE","CUSTOM"],"title":"PlanType"},"PortalSessionRequest":{"properties":{"return_url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Return Url"}},"type":"object","title":"PortalSessionRequest"},"PortalSessionResponse":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"type":"object","required":["portal_url"],"title":"PortalSessionResponse"},"PricingCalculationResponse":{"properties":{"subtotal_cents":{"type":"integer","title":"Subtotal Cents"},"bundle_discount_rate":{"type":"string","title":"Bundle Discount Rate"},"bundle_discount_cents":{"type":"integer","title":"Bundle Discount Cents"},"total_cents":{"type":"integer","title":"Total Cents"},"billing_interval":{"type":"string","title":"Billing Interval"},"per_module":{"items":{"$ref":"#/components/schemas/PricingModuleBreakdown"},"type":"array","title":"Per Module"}},"type":"object","required":["subtotal_cents","bundle_discount_rate","bundle_discount_cents","total_cents","billing_interval","per_module"],"title":"PricingCalculationResponse"},"PricingModuleBreakdown":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"base_price_cents":{"type":"integer","title":"Base Price Cents"},"discounted_cents":{"type":"integer","title":"Discounted Cents"}},"type":"object","required":["slug","name","base_price_cents","discounted_cents"],"title":"PricingModuleBreakdown"},"RemoveModuleRequest":{"properties":{"module_slug":{"type":"string","title":"Module Slug"}},"type":"object","required":["module_slug"],"title":"RemoveModuleRequest"},"RoleType":{"type":"string","enum":["OWNER","ADMIN","MEMBER","VIEWER","SUPERADMIN"],"title":"RoleType"},"SubscriptionPeriodResponse":{"properties":{"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"}},"type":"object","required":["current_period_end"],"title":"SubscriptionPeriodResponse"},"SwitchIntervalRequest":{"properties":{"billing_interval":{"type":"string","title":"Billing Interval"}},"type":"object","required":["billing_interval"],"title":"SwitchIntervalRequest"},"TrainingExampleCreate":{"properties":{"chat_id":{"type":"string","title":"Chat Id"},"message_id":{"type":"string","title":"Message Id"},"corrected_answer":{"type":"string","title":"Corrected Answer"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["chat_id","message_id","corrected_answer"],"title":"TrainingExampleCreate"},"TrainingExampleOut":{"properties":{"entry_id":{"type":"string","title":"Entry Id"},"status":{"type":"string","title":"Status"},"canonical_query":{"type":"string","title":"Canonical Query"},"corrected_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Answer"},"original_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Answer"},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"},"snippet":{"additionalProperties":true,"type":"object","title":"Snippet"}},"type":"object","required":["entry_id","status","canonical_query","corrected_answer","original_answer","chat_id","message_id","snippet"],"title":"TrainingExampleOut"},"TrainingExampleUpdate":{"properties":{"corrected_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Answer"},"canonical_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Query"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"TrainingExampleUpdate"},"TrainingExamplesListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TrainingExampleOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"TrainingExamplesListOut"},"TrainingInfoOut":{"properties":{"avatar_id":{"type":"string","title":"Avatar Id"},"collection_name":{"type":"string","title":"Collection Name"},"counts":{"additionalProperties":true,"type":"object","title":"Counts"},"chroma":{"additionalProperties":true,"type":"object","title":"Chroma"}},"type":"object","required":["avatar_id","collection_name","counts","chroma"],"title":"TrainingInfoOut"},"UserOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","format":"email","title":"Email"},"status":{"$ref":"#/components/schemas/UserStatus"},"email_verified":{"type":"boolean","title":"Email Verified"},"current_plan":{"$ref":"#/components/schemas/PlanType"},"profile":{"anyOf":[{"$ref":"#/components/schemas/UserProfileOut"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","email","status","email_verified","current_plan","created_at","updated_at"],"title":"UserOut"},"UserProfileCreate":{"properties":{"full_name":{"type":"string","title":"Full Name"},"job_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Title"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["full_name"],"title":"UserProfileCreate"},"UserProfileOut":{"properties":{"full_name":{"type":"string","title":"Full Name"},"job_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Title"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"language":{"type":"string","title":"Language"}},"type":"object","required":["full_name"],"title":"UserProfileOut"},"UserStatus":{"type":"string","enum":["ACTIVE","SUSPENDED","DELETED","PENDING_VERIFICATION"],"title":"UserStatus"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WorkspaceAuthUrlRequest":{"properties":{"display_name":{"type":"string","title":"Display Name"}},"type":"object","required":["display_name"],"title":"WorkspaceAuthUrlRequest"},"WorkspaceConnectionListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkspaceConnectionOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["total"],"title":"WorkspaceConnectionListOut"},"WorkspaceConnectionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"provider":{"type":"string","title":"Provider"},"status":{"type":"string","title":"Status"},"display_name":{"type":"string","title":"Display Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","provider","status","display_name","created_at","updated_at"],"title":"WorkspaceConnectionOut"},"WorkspaceFolderListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkspaceFolderOut"},"type":"array","title":"Items"}},"type":"object","title":"WorkspaceFolderListOut"},"WorkspaceFolderOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},"type":"object","required":["id","name"],"title":"WorkspaceFolderOut"},"WorkspaceFolderSelectRequest":{"properties":{"folder_ids":{"items":{"type":"string"},"type":"array","title":"Folder Ids"}},"type":"object","required":["folder_ids"],"title":"WorkspaceFolderSelectRequest"}}}}