{"openapi":"3.1.0","info":{"title":"Casper API","description":"Casper - Report AI Search Assistant","version":"1.0.0"},"paths":{"/api/v1/signup":{"post":{"tags":["Chat"],"summary":"Signup","description":"User signup endpoint","operationId":"signup_api_v1_signup_post","parameters":[{"name":"chat_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResponse"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/login":{"post":{"tags":["Chat"],"summary":"Login","description":"User login endpoint","operationId":"login_api_v1_login_post","parameters":[{"name":"chat_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/logout":{"post":{"tags":["Chat"],"summary":"Logout","description":"User logout endpoint.\nInvalidates the user's token by clearing it from the database.","operationId":"logout_api_v1_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/update-tc-verified":{"patch":{"tags":["Chat"],"summary":"Update Tc Verified","description":"Update user's Terms and Conditions verification status.\nThis endpoint allows updating the t_c_verified field for a user.","operationId":"update_tc_verified_api_v1_update_tc_verified_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTCVerifiedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTCVerifiedResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/get-tc-verified":{"get":{"tags":["Chat"],"summary":"Get Tc Verified","description":"Get user's Terms and Conditions verification status.\nReturns the current t_c_verified status from the users table.","operationId":"get_tc_verified_api_v1_get_tc_verified_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTCVerifiedResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/get-walkover-status":{"get":{"tags":["Chat"],"summary":"Get Walkover Status","description":"Return whether the authenticated user has finished the in-app walkover.\n\nDefaults to ``False`` from account creation and stays that way until the\nfrontend calls ``POST /complete-walkover`` after the user finishes the\nwalkthrough. Frontend should call this on every authenticated session and\nshow the walkover whenever it is ``False``.","operationId":"get_walkover_status_api_v1_get_walkover_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWalkoverStatusResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/complete-walkover":{"post":{"tags":["Chat"],"summary":"Complete Walkover","description":"Mark the authenticated user's walkover as completed.\n\nIdempotent — calling this multiple times is safe; the flag will simply\nstay ``True``. The frontend should hit this once the user finishes (or\nexplicitly skips) the in-app walkthrough.","operationId":"complete_walkover_api_v1_complete_walkover_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteWalkoverResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscribe":{"post":{"tags":["Chat"],"summary":"Subscribe to newsletter","description":"Subscribe to newsletter with email address","operationId":"subscribe_api_v1_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__resources__schemas__subscription__SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__resources__schemas__subscription__SubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/request":{"post":{"tags":["Chat"],"summary":"Submit a request for Caspr.","description":"Submit a request for Caspr. with client details","operationId":"submit_request_api_v1_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/book-call":{"post":{"tags":["Chat"],"summary":"Book a call","description":"Submit a call booking request with name, email, phone and optional brief","operationId":"book_call_api_v1_book_call_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookCallRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-sources":{"get":{"tags":["Chat"],"summary":"Get live sources count","description":"Get the current count of live sources","operationId":"live_sources_api_v1_live_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveSourcesResponse"}}}}}}},"/api/v1/create-session":{"post":{"tags":["Chat"],"summary":"Create a new session","description":"Create a new session","operationId":"create_session_api_v1_create_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__resources__schemas__chat__CreateSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/chat-stream/{session_id}":{"get":{"tags":["Chat"],"summary":"Get chat events from redis stream","description":"Get chat events from redis stream","operationId":"chat_stream_api_v1_chat_stream__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"chat_id","in":"query","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"event_id","in":"query","required":false,"schema":{"type":"string","default":"0","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat":{"post":{"tags":["Chat"],"summary":"Request for processing chat","description":"Request for processing chat","operationId":"chat_api_v1_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/create-temp-session":{"post":{"tags":["Chat"],"summary":"Create a new temporary session","description":"Create a new temporary session","operationId":"create_temp_session_api_v1_create_temp_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTempSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/temp-chat-stream/{session_id}":{"get":{"tags":["Chat"],"summary":"Get temporary chat events from redis stream","description":"Get temporary chat events from redis stream","operationId":"temp_chat_stream_api_v1_temp_chat_stream__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"chat_id","in":"query","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"event_id","in":"query","required":false,"schema":{"type":"string","default":"0","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/temp-chat":{"post":{"tags":["Chat"],"summary":"Request for processing temporary chat","description":"Request for processing temporary chat","operationId":"temp_chat_api_v1_temp_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TempChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/temp-chat/{chat_id}":{"get":{"tags":["Chat"],"summary":"Get Temp Chat Messages","description":"Get temporary chat messages endpoint","operationId":"get_temp_chat_messages_api_v1_temp_chat__chat_id__get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TempChatMessagesResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/generate-report":{"post":{"tags":["Chat"],"summary":"Generate Report","description":"Generate report endpoint - handles both initial generation (v1) and regeneration (v2+).\n\n**Auto-Detection:**\n- If active version not generated → Generates v1\n- If active version already generated → Creates new version automatically, then generates\n\nFrontend always calls this single endpoint - no need to know about versions!","operationId":"generate_report_api_v1_generate_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateReportResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/chat/{chat_id}":{"get":{"tags":["Chat"],"summary":"Get Chat Messages","description":"Get chat messages endpoint","operationId":"get_chat_messages_api_v1_chat__chat_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviousChatMessagesResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/chat-list":{"get":{"tags":["Chat"],"summary":"Chat List","description":"Get user chats endpoint with optional status filtering and search\n\nQuery Parameters:\n- status: Optional comma-separated list of status values to filter by\n- search: Optional search term to filter chat titles (case-insensitive)\n- is_mcp: Optional boolean to filter by MCP origin (true/false)\n\nExamples:\n- /chat-list (returns all chats)\n- /chat-list?status=draft (returns only draft chats)\n- /chat-list?search=AI (returns chats with \"AI\" in title)\n- /chat-list?is_mcp=true (returns only MCP-originated chats)\n- /chat-list?search=wealth&status=draft,analysis-completed (returns chats matching both filters)\n\nValid status values:\n- draft\n- awaiting-confirmation\n- analysis-in-progress\n- analysis-completed\n- generating-output\n- output-generated\n- updates-available\n- redo-analysis\n- error-generation-report","operationId":"chat_list_api_v1_chat_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated status values to filter by (e.g., 'draft,analysis-completed')","title":"Status"},"description":"Comma-separated status values to filter by (e.g., 'draft,analysis-completed')"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term to filter chat titles (case-insensitive substring match)","title":"Search"},"description":"Search term to filter chat titles (case-insensitive substring match)"},{"name":"is_mcp","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by MCP origin: true for MCP-only, false for non-MCP-only, omit for all","title":"Is Mcp"},"description":"Filter by MCP origin: true for MCP-only, false for non-MCP-only, omit for all"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserChatsResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/delete-chat":{"post":{"tags":["Chat"],"summary":"Delete Chat","description":"Mark a chat as deleted","operationId":"delete_chat_api_v1_delete_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteChatResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/rename-chat-title":{"post":{"tags":["Chat"],"summary":"Rename Chat Endpoint","description":"Rename a chat by updating its title","operationId":"rename_chat_endpoint_api_v1_rename_chat_title_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameChatResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/report":{"get":{"tags":["Chat"],"summary":"Get Report Presigned Url","description":"Get report presigned url endpoint","operationId":"get_report_presigned_url_api_v1_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","title":"Id"}},{"name":"file_type","in":"query","required":true,"schema":{"type":"string","title":"File Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportPresignedUrlResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/presigned-urls":{"post":{"tags":["Chat"],"summary":"Batch Presigned Urls","description":"Generate presigned URLs for a batch of S3 visualization URIs.\n\nIntended for refreshing expired visualization URLs on long-lived pages.\nRate-limited to 10 requests per minute per user, max 20 URIs per call.","operationId":"batch_presigned_urls_api_v1_presigned_urls_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPresignedUrlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPresignedUrlResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/list-version-outputs":{"get":{"tags":["Chat"],"summary":"List Version Outputs","description":"List all available output files (non-null) across all versions of a report.\nReturns a simple list for frontend to display all available downloads.\n\nArgs:\n    report_id: The report ID\n    user_id: Authenticated user ID (from token)\n\nReturns:\n    List of all available outputs with version, file_type, and generated_at","operationId":"list_version_outputs_api_v1_list_version_outputs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"query","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListVersionOutputsResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/report-version-history/{report_id}":{"get":{"tags":["Chat"],"summary":"Get Report Version History","description":"Get version history for a report.\nReturns all versions with their generated outputs status.\nUsed by frontend to populate the version history dropdown.","operationId":"get_report_version_history_api_v1_report_version_history__report_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportVersionHistoryResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/report-info":{"get":{"tags":["Chat"],"summary":"Get Report Info","description":"Get report info for a specific version, including cards.\nReturns data in the same format as reports in previous chat messages endpoint.\n\nArgs:\n    report_id: The ID of the report\n    report_version_id: The ID of the specific report version\n    user_id: Authenticated user ID (from token)\n\nReturns:\n    Report data with cards for the specified version","operationId":"get_report_info_api_v1_report_info_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"query","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"report_version_id","in":"query","required":true,"schema":{"type":"string","title":"Report Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportInfoResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/download-version":{"get":{"tags":["Chat"],"summary":"Download Version File","description":"Download a specific file type from a specific version of a report.\nReturns a presigned URL for direct download.\n\nArgs:\n    report_id: The ID of the report\n    version: The version number to download\n    file_type: The type of file to download (pdf, html, md, pptx, info_pdf)\n    user_id: Authenticated user ID (from token)\n\nReturns:\n    Presigned URL for downloading the file (valid for 1 hour)","operationId":"download_version_file_api_v1_download_version_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"query","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"version","in":"query","required":true,"schema":{"type":"integer","title":"Version"}},{"name":"file_type","in":"query","required":true,"schema":{"type":"string","title":"File Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionDownloadResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/user-logs":{"post":{"tags":["Chat"],"summary":"User Logs","description":"User logs endpoint","operationId":"user_logs_api_v1_user_logs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/google-login":{"post":{"tags":["Chat"],"summary":"Google Login","description":"Google login endpoint","operationId":"google_login_api_v1_google_login_post","parameters":[{"name":"chat_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginResponse"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/forgot-password":{"post":{"tags":["Chat"],"summary":"Forgot Password","description":"Forgot password endpoint","operationId":"forgot_password_api_v1_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/verify-reset-token":{"get":{"tags":["Chat"],"summary":"Verify Reset Token","description":"Verify reset token endpoint","operationId":"verify_reset_token_api_v1_verify_reset_token_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResetTokenResponse"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/reset-password":{"post":{"tags":["Chat"],"summary":"Reset Password","description":"Reset password endpoint","operationId":"reset_password_api_v1_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/send-verification-link":{"post":{"tags":["Chat"],"summary":"Send Verification Link","description":"Send verification link endpoint","operationId":"send_verification_link_api_v1_send_verification_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendVerificationLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendVerificationLinkResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/verify-account-token":{"post":{"tags":["Chat"],"summary":"Verify Account Token","description":"Verify account token endpoint","operationId":"verify_account_token_api_v1_verify_account_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAccountTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAccountTokenResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/generate-presentation":{"post":{"tags":["Chat"],"summary":"Generate Pptx","description":"Generate PowerPoint presentation from report. If report_version_id is provided, generates for that specific version.","operationId":"generate_pptx_api_v1_generate_presentation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratePresentationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratePresentationResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/generate-infographic":{"post":{"tags":["Chat"],"summary":"Generate Infographic","description":"Generate infographic PDF for a report.\n\nLogic:\n- Uses current timestamp for infographic generation (no correlation with Report.generated_at)\n- Stores info_pdf_generation_time in s3_uri JSONB only (like PPTX does with pptx_generation_time)\n- Follows same versioning logic as PPTX:\n  - If infographic exists and no changes → return existing\n  - If infographic exists and changes detected → create new version\n  - If no infographic exists → generate for current version\n- Poster image: First generation (report OR infographic) creates it, subsequent reuse it\n- If report_version_id is provided, generates for that specific version","operationId":"generate_infographic_api_v1_generate_infographic_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateInfographicRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateInfographicResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/refine-card":{"post":{"tags":["Chat"],"summary":"Refine Content","description":"Refine a card from the report","operationId":"refine_content_api_v1_refine_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/revert-card":{"post":{"tags":["Chat"],"summary":"Revert Card","description":"Revert a card to its immediate previous version (undo last refinement).\n\nUser can only undo to immediate previous version (v3 → v2, not v3 → v1).\nCurrent version is marked as deleted and previous version is reactivated.","operationId":"revert_card_api_v1_revert_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevertCardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevertCardResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/delete-card":{"post":{"tags":["Chat"],"summary":"Delete Card","description":"Delete a card or subsection from the report","operationId":"delete_card_api_v1_delete_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/refine-visualization":{"post":{"tags":["Chat"],"summary":"Refine Visualization","description":"Refine visualization for a section or subsection in a report","operationId":"refine_visualization_api_v1_refine_visualization_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineVisualizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineVisualizationResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/delete-visualization":{"post":{"tags":["Chat"],"summary":"Delete Visualization Endpoint","description":"Delete visualization for a table in a report","operationId":"delete_visualization_endpoint_api_v1_delete_visualization_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/edit-card-content":{"post":{"tags":["Chat"],"summary":"Replace Card Content","description":"Replace section or subsection content for a particular active card","operationId":"replace_card_content_api_v1_edit_card_content_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefineOrDeleteResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/regenerate-executive-summary":{"post":{"tags":["Chat"],"summary":"Regenerate Executive Summary","description":"Regenerate executive summary based on refined cards.\nOnly creates a new ES version if cards have been modified since last ES generation.","operationId":"regenerate_executive_summary_api_v1_regenerate_executive_summary_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegenerateESRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegenerateESResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/dashboard-stats":{"get":{"tags":["Chat"],"summary":"Get Dashboard Stats Endpoint","description":"Get dashboard statistics for the current user.\n\nReturns counts of reports/chats in different states:\n- **drafts**: Number of draft chats (chats that exist in messages table but NOT in reports table)\n- **analysis_completed**: Number of reports with analysis completed status\n- **output_generated**: Number of reports with output generated status\n- **updated**: Number of updated reports (TODO: implement when update functionality is enabled)\n\nAuthentication Required: Yes (JWT token)","operationId":"get_dashboard_stats_endpoint_api_v1_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStatsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/dashboard-info":{"get":{"tags":["Chat"],"summary":"Get Dashboard Info Endpoint","description":"Get dashboard information including general facts and system info.\n\nReturns:\n- **general_facts**: List of helpful tips and facts about Caspr features\n- **caspr_info**: System information like live feeds data count\n\n**TODO:**\n- Replace static general_facts with dynamic content from database\n- Implement real live_feeds_data count from database\n- Add more system metrics as needed\n\n**Note:** Currently returns static dummy data for frontend development.\n\nAuthentication Required: Yes (JWT token)","operationId":"get_dashboard_info_endpoint_api_v1_dashboard_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardInfoResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/report-domains":{"get":{"tags":["Chat"],"summary":"Get Report Domains","description":"Return a summary of report domains for the authenticated user.\n\nOnly domains that contain at least one non-draft report are included.\nResults are sorted by ``item_count`` descending.\n\n**Response fields per domain:**\n- ``domain_name``: Internal slug (e.g. ``\"due_diligence\"``)\n- ``category_name``: Human-readable label (e.g. ``\"Due Diligence\"``)\n- ``item_count``: Number of non-draft reports in that domain\n\nAuthentication Required: Yes (JWT token)","operationId":"get_report_domains_api_v1_report_domains_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDomainsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/report-domains/{domain_name}/reports":{"get":{"tags":["Chat"],"summary":"Get Domain Reports","description":"Return paginated non-draft reports for a specific domain for the authenticated user.\n\nReports are sorted by ``last_activity_at`` descending (most recent first).\n\n**Path parameter:**\n- ``domain_name``: One of ``default``, ``primary_research``, ``due_diligence``,\n  ``industry_benchmarking``, ``market_insight``, ``rfp``, ``business_plan``\n\n**Query parameters (required):**\n- ``limit`` (int, 1–100): Page size.\n- ``offset`` (int, ≥ 0): Pagination offset.\n\n**Response fields:**\n- ``total``: Total matching reports (use with ``limit``/``offset`` for client-side pagination)\n- ``reports``: Paginated list of report records\n\nAuthentication Required: Yes (JWT token)","operationId":"get_domain_reports_api_v1_report_domains__domain_name__reports_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain_name","in":"path","required":true,"schema":{"type":"string","title":"Domain Name"}},{"name":"limit","in":"query","required":true,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of reports per page","title":"Limit"},"description":"Number of reports per page"},{"name":"offset","in":"query","required":true,"schema":{"type":"integer","minimum":0,"description":"Number of reports to skip","title":"Offset"},"description":"Number of reports to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainReportsResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/categories":{"get":{"tags":["Chat"],"summary":"Get Categories","description":"Return the static catalog of all report categories.\n\nReturns the full set of categories regardless of whether the user has\nany reports in them. The internal ``default`` domain is surfaced as\n``standard``; pass that slug back as-is on subsequent calls (the API\nwill translate it internally where needed).\n\nAuthentication Required: Yes (JWT token)","operationId":"get_categories_api_v1_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoriesResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/home-search":{"get":{"tags":["Chat"],"summary":"Home Search","description":"Homepage search across the authenticated user's chats and reports.\n\nEach result represents a chat (one row per chat); when the chat has a\ngenerated report, the latest report's title/poster are surfaced too.\nThe search query (``q``) matches case-insensitively against both\n``chat_title`` and the latest report's ``title``. The ``matched_on``\nfield on each item indicates which field actually matched.\n\nAll filters are additive (AND). Chats with no report are treated as\nhaving status ``draft`` and domain ``standard``.\n\nAuthentication Required: Yes (JWT token)","operationId":"home_search_api_v1_home_search_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Case-insensitive substring matched against chat title and latest report title","title":"Q"},"description":"Case-insensitive substring matched against chat title and latest report title"},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Comma-separated category slugs to filter by (e.g. 'standard,due_diligence')","title":"Domain"},"description":"Comma-separated category slugs to filter by (e.g. 'standard,due_diligence')"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Comma-separated report status values to filter by (e.g. 'draft,analysis-completed')","title":"Status"},"description":"Comma-separated report status values to filter by (e.g. 'draft,analysis-completed')"},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO-8601 datetime; only chats created at/after this time are returned","title":"Created After"},"description":"ISO-8601 datetime; only chats created at/after this time are returned"},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO-8601 datetime; only chats created at/before this time are returned","title":"Created Before"},"description":"ISO-8601 datetime; only chats created at/before this time are returned"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":20,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeSearchResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ongoing-chats":{"get":{"tags":["Chat"],"summary":"Ongoing Chats","description":"Return the user's ongoing (draft) chats, grouped by category.\n\nA chat is included here when its latest report is in ``draft`` status,\nor when no report has been generated yet. Because draft reports do not\nyet have a ``domain_name`` in the DB, every entry currently lands under\nthe ``standard`` key. Additional category keys will start appearing on\nthis response once drafts begin carrying a domain.\n\nWithin each group, chats are ordered by ``updated_at`` descending\n(most-recent first).\n\nAuthentication Required: Yes (JWT token)","operationId":"ongoing_chats_api_v1_ongoing_chats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OngoingChatsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/balance":{"get":{"tags":["Wallet","Wallet"],"summary":"Get Wallet Balance","description":"Get current wallet balance for the authenticated user.","operationId":"get_wallet_balance_api_v1_wallet_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletBalanceResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/transactions":{"get":{"tags":["Wallet","Wallet"],"summary":"Get Transaction History","description":"Get transaction history for the authenticated user.","operationId":"get_transaction_history_api_v1_wallet_transactions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"transaction_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionHistoryResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wallet/subscription":{"get":{"tags":["Wallet","Wallet"],"summary":"Get Subscription","description":"Get subscription details and active subscription plan for the authenticated user.\n\nReturns:\n    - If user has a subscription: returns subscription details\n    - If user has no subscription (FREE tier): returns success=True with subscription=None\n    - Only returns error for actual failures (e.g., database errors)","operationId":"get_subscription_api_v1_wallet_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/tiers":{"get":{"tags":["Wallet","Wallet"],"summary":"Get All Tiers","description":"Get information about all subscription tiers (no auth required).","operationId":"get_all_tiers_api_v1_wallet_tiers_get","parameters":[{"name":"country_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"default","title":"Country Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllTiersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wallet/subscribe":{"post":{"tags":["Wallet","Wallet"],"summary":"Subscribe or change plan","description":"Create a new subscription (to_update=False) or change existing plan (to_update=True).","operationId":"subscribe_api_v1_wallet_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__resources__schemas__wallet__SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__resources__schemas__wallet__SubscribeResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/subscription/cancel":{"post":{"tags":["Wallet","Wallet"],"summary":"Cancel active subscription","description":"Cancel the user's active subscription at the end of the current billing cycle. User keeps access until cycle ends.","operationId":"cancel_user_subscription_api_v1_wallet_subscription_cancel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/subscription/update-payment-method":{"post":{"tags":["Wallet","Wallet"],"summary":"Update subscription payment method","description":"Cancel current subscription and create a new one with updated payment method at cycle end","operationId":"update_subscription_payment_method_api_v1_wallet_subscription_update_payment_method_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentMethodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentMethodResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/subscription/webhook":{"post":{"tags":["Wallet","Wallet"],"summary":"Subscription Webhook","description":"Handle subscription status webhooks from payment service.","operationId":"subscription_webhook_api_v1_wallet_subscription_webhook_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionWebhookEvent"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Subscription Webhook Api V1 Wallet Subscription Webhook Post"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wallet/topup/initiate":{"post":{"tags":["Wallet","Wallet"],"summary":"Initiate Topup","description":"Initiate a token top-up purchase.","operationId":"initiate_topup_api_v1_wallet_topup_initiate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupInitiateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupInitiateResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/payment-webhook":{"post":{"tags":["Wallet","Wallet"],"summary":"Payment Webhook Handler","description":"Credit tokens to a user's wallet from a completed payment (called by payment service).","operationId":"payment_webhook_handler_api_v1_wallet_payment_webhook_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentWebhookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentWebhookResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wallet/payment-status/{payment_id}":{"get":{"tags":["Wallet","Wallet"],"summary":"Get Payment Status","description":"Get the status of a payment/token batch by payment_id.\nUsed for polling from frontend to check if tokens have been credited.\nSECURITY: Only returns payment info if it belongs to the requesting user.","operationId":"get_payment_status_api_v1_wallet_payment_status__payment_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStatusResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wallet/calculate-tax":{"post":{"tags":["Wallet","Wallet"],"summary":"Calculate Tax","description":"Calculate tax for a top-up or subscription based on country code.","operationId":"calculate_tax_api_v1_wallet_calculate_tax_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCalculationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCalculationResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/subscription/calculate-tax":{"post":{"tags":["Wallet","Wallet"],"summary":"Calculate Subscription Tax","description":"Calculate tax for a specific subscription plan and type based on country code.","operationId":"calculate_subscription_tax_api_v1_wallet_subscription_calculate_tax_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionTaxCalculationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCalculationResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/wallet/referral":{"get":{"tags":["Wallet","Wallet"],"summary":"Get referral information","description":"Get user's referral code and statistics including total referrals and tokens earned","operationId":"get_referral_info_api_v1_wallet_referral_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralInfoResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ask-caspr/create-session":{"post":{"tags":["Ask Caspr","Ask Caspr"],"summary":"Create a new Ask Caspr session","description":"Creates a new session for Ask Caspr chat with a specific report section or subsection.","operationId":"create_ask_caspr_session_api_v1_ask_caspr_create_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__resources__routers__ask_caspr_api__CreateSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ask-caspr/stream/{session_id}":{"get":{"tags":["Ask Caspr","Ask Caspr"],"summary":"Get Ask Caspr events from Redis stream","description":"SSE endpoint for streaming Ask Caspr events in real-time","operationId":"ask_caspr_stream_api_v1_ask_caspr_stream__session_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"event_id","in":"query","required":false,"schema":{"type":"string","default":"0","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ask-caspr/ask":{"post":{"tags":["Ask Caspr","Ask Caspr"],"summary":"Ask a question to Caspr about a report section","description":"Submit a question to Ask Caspr. Processing happens in background, results streamed via SSE.","operationId":"ask_caspr_question_api_v1_ask_caspr_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskCasprRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskCasprResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ask-caspr/chat":{"post":{"tags":["Ask Caspr","Ask Caspr"],"summary":"Ask a question about a report section or subsection","description":"Ask Caspr a question about a specific section or subsection of a report. Maintains conversation history automatically.","operationId":"ask_caspr_chat_api_v1_ask_caspr_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskCasprRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskCasprResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ask-caspr/chat-history":{"get":{"tags":["Ask Caspr","Ask Caspr"],"summary":"Get Ask Caspr chat history for a section or subsection","description":"Retrieve the Ask Caspr chat conversation for a specific section or subsection. If report_version_id is omitted, returns the latest chat (current version). If report_version_id is provided, returns the chat that was valid at that report version by matching against card_version.","operationId":"get_ask_caspr_chat_history_api_v1_ask_caspr_chat_history_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"query","required":true,"schema":{"type":"string","description":"ID of the report","title":"Report Id"},"description":"ID of the report"},{"name":"section_id","in":"query","required":true,"schema":{"type":"string","description":"Business card_id (section identifier)","title":"Section Id"},"description":"Business card_id (section identifier)"},{"name":"subsection_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Subsection ID. Omit for section-level chat.","title":"Subsection Id"},"description":"Subsection ID. Omit for section-level chat."},{"name":"report_version_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ReportVersion ID. Omit to get the latest chat.","title":"Report Version Id"},"description":"ReportVersion ID. Omit to get the latest chat."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskCasprChatHistoryResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"}}}},"/api/v1/upload/create-session":{"post":{"tags":["Upload"],"summary":"Create a new upload session","description":"Creates a dedicated upload session and returns an ``upload_session_id``.  The frontend must call this **before** connecting to the SSE stream and before submitting the file via ``POST /upload/process``.  This mirrors the ``POST /create-session`` pattern used for chat sessions.","operationId":"create_upload_session_api_v1_upload_create_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/upload/process":{"post":{"tags":["Upload"],"summary":"Upload and process files","description":"Accept up to 3 files (binary, max 25 MB each) and/or previously-uploaded file IDs (reference_ids) from the user's library. Total files (new + library) must not exceed 3. Kicks off a background task that uploads to S3 and indexes the documents for grep-backed search. Progress is streamed via SSE on ``GET /upload/process-stream/{upload_session_id}``.","operationId":"upload_process_api_v1_upload_process_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_process_api_v1_upload_process_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/upload/process-stream/{upload_session_id}":{"get":{"tags":["Upload"],"summary":"Stream upload processing events via SSE","description":"Server-Sent Events stream for upload progress, errors, and completion. The frontend should connect after calling ``POST /upload/create-session``.","operationId":"upload_process_stream_api_v1_upload_process_stream__upload_session_id__get","parameters":[{"name":"upload_session_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Session Id"}},{"name":"event_id","in":"query","required":false,"schema":{"type":"string","default":"0","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/upload/files":{"get":{"tags":["Upload"],"summary":"List all uploaded files for the authenticated user","description":"Returns non-deleted files uploaded by the user, newest first.  Supports optional ``limit`` and ``offset`` query parameters for pagination.","operationId":"list_uploaded_files_api_v1_upload_files_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/upload/chat-files/{chat_id}":{"get":{"tags":["Upload"],"summary":"Get reference files linked to a chat","description":"Returns the reference file metadata for a given chat.  Checks Redis first (for files uploaded before the first message is sent), then falls back to the ``chat_files`` table (for files linked after the first ``POST /chat`` message).","operationId":"get_chat_reference_files_api_v1_upload_chat_files__chat_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatReferenceFilesResponse"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/upload/file/{uploaded_file_id}":{"delete":{"tags":["Upload"],"summary":"Soft-delete an uploaded file from the user's library","description":"Marks the file as deleted so it no longer appears in the library picker. The file remains in S3 for existing chats.","operationId":"delete_uploaded_file_api_v1_upload_file__uploaded_file_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"uploaded_file_id","in":"path","required":true,"schema":{"type":"string","title":"Uploaded File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/roles":{"get":{"tags":["Onboarding","Onboarding"],"summary":"List Roles","description":"Return all active user-role options for the onboarding UI.","operationId":"list_roles_api_v1_onboarding_roles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRolesResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/research-interests":{"get":{"tags":["Onboarding","Onboarding"],"summary":"List Research Interests","description":"Return all active research-interest options for the onboarding UI.","operationId":"list_research_interests_api_v1_onboarding_research_interests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchInterestsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/save-role":{"post":{"tags":["Onboarding","Onboarding"],"summary":"Save Role","description":"Save the user's role selection (Step 1).\n\nWhen the chosen role is the ``Other`` row, ``custom_role_text`` must be\nsupplied in the request body and is persisted alongside the role.","operationId":"save_role_api_v1_onboarding_save_role_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveUserRoleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStepResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/save-interests":{"post":{"tags":["Onboarding","Onboarding"],"summary":"Save Interests","description":"Save the user's research interest selections (Step 2).\n\nWhen one of the chosen interests is the ``Something else`` row,\n``custom_research_text`` must be supplied in the request body and is\npersisted on the user.","operationId":"save_interests_api_v1_onboarding_save_interests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveResearchInterestsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStepResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/validate-university-email":{"post":{"tags":["Onboarding","Onboarding"],"summary":"Validate University Email","description":"Check whether the university email domain is registered with Caspr.","operationId":"validate_university_email_api_v1_onboarding_validate_university_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateUniversityEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateUniversityEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/save-university-email":{"post":{"tags":["Onboarding","Onboarding"],"summary":"Save Uni Email","description":"Persist the student's university email and link the university.\nThe frontend should call /validate-university-email first to get the\nuniversity_id, then pass both here.","operationId":"save_uni_email_api_v1_onboarding_save_university_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveUniversityEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStepResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/complete":{"post":{"tags":["Onboarding","Onboarding"],"summary":"Complete Onboarding","description":"Mark the user's onboarding as complete.","operationId":"complete_onboarding_api_v1_onboarding_complete_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStepResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/onboarding/status":{"get":{"tags":["Onboarding","Onboarding"],"summary":"Onboarding Status","description":"Return the user's current onboarding progress so the frontend can resume from the right step.","operationId":"onboarding_status_api_v1_onboarding_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStatusResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/me":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Admin Me","description":"Who is logged into the dashboard.","operationId":"admin_me_api_v1_admin_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/overview":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Overview","description":"Executive overview:\n- total users (all registered)\n- active users (range)\n- spend today / all-time (+ range spend)\n- top features by spend\n- top users by spend (company mode only)","operationId":"overview_api_v1_admin_overview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional: scope to one user","title":"User Id"},"description":"Optional: scope to one user"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/search":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Users Search","description":"Typeahead search by email or name. Includes current subscription only.","operationId":"users_search_api_v1_admin_users_search_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/active":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Users Active","description":"Active-user count for any custom period (day / days / month), plus daily series.","operationId":"users_active_api_v1_admin_users_active_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"30d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"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":200,"minimum":1,"default":25,"title":"Page Size"}},{"name":"include_list","in":"query","required":false,"schema":{"type":"boolean","description":"Include paginated active-user rows","default":true,"title":"Include List"},"description":"Include paginated active-user rows"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Users List","description":"All users (searchable, paginated), sorted by usage in the selected period.","operationId":"users_list_api_v1_admin_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search user name or email","title":"Q"},"description":"Search user name or email"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"spend | chats | last_active","default":"spend","title":"Sort"},"description":"spend | chats | last_active"},{"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":200,"minimum":1,"default":25,"title":"Page Size"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"If true, only users with activity in the period","default":false,"title":"Active Only"},"description":"If true, only users with activity in the period"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/summary":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Users Summary","description":"One user: profile, subscription, activity counts, cost breakdown (costtracker).","operationId":"users_summary_api_v1_admin_users__user_id__summary_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/chats":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Users Chats","description":"Tree level: User → Chats (with spend from costtracker).","operationId":"users_chats_api_v1_admin_users__user_id__chats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/chats/{chat_id}/costs":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Chat Costs","description":"Tree level: Chat → costtracker feature/model breakdown.","operationId":"chat_costs_api_v1_admin_users__user_id__chats__chat_id__costs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"all","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/chats/{chat_id}/reports":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Chat Reports","description":"Tree level: Chat → Reports.","operationId":"chat_reports_api_v1_admin_users__user_id__chats__chat_id__reports_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/reports/{report_id}/versions":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Report Versions List","description":"Tree level: Report → Versions.","operationId":"report_versions_list_api_v1_admin_reports__report_id__versions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/costs/summary":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Costs Summary","operationId":"costs_summary_api_v1_admin_costs_summary_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/costs/by-feature":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Costs By Feature","operationId":"costs_by_feature_api_v1_admin_costs_by_feature_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/costs/by-functionality":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Costs By Functionality","description":"Spend grouped by user-facing functionality (chat, report generation,\nrefine, refine visualization, executive summary, infographic, PPTX\ngeneration, Ask CASPR). The non-technical, feature-level cost view.","operationId":"costs_by_functionality_api_v1_admin_costs_by_functionality_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/costs/by-model":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Costs By Model","operationId":"costs_by_model_api_v1_admin_costs_by_model_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/costs/by-user":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Costs By User","operationId":"costs_by_user_api_v1_admin_costs_by_user_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"2d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/costs/timeseries":{"get":{"tags":["Admin Dashboard","Admin Dashboard"],"summary":"Costs Timeseries","operationId":"costs_timeseries_api_v1_admin_costs_timeseries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)","default":"30d","title":"Range"},"description":"Preset: today | 2d | 7d | 30d | all (ignored if start_date/end_date set)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets.","title":"Start Date"},"description":"Custom window start (YYYY-MM-DD or ISO datetime). Overrides range presets."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now.","title":"End Date"},"description":"Custom window end (YYYY-MM-DD or ISO datetime). Defaults to now."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/api-key":{"get":{"tags":["MCP API Keys","MCP API Keys"],"summary":"Get Api Key Status","description":"Return whether the user has an MCP API key and non-secret metadata.","operationId":"get_api_key_status_api_v1_mcp_api_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyStatusResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["MCP API Keys","MCP API Keys"],"summary":"Create Api Key","description":"Create the user's MCP API key. Returns plaintext once.","operationId":"create_api_key_api_v1_mcp_api_key_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyCreateResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["MCP API Keys","MCP API Keys"],"summary":"Delete Api Key","description":"Delete the user's MCP API key.","operationId":"delete_api_key_api_v1_mcp_api_key_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyDeleteResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/mcp/api-key/regenerate":{"post":{"tags":["MCP API Keys","MCP API Keys"],"summary":"Regenerate Api Key","description":"Regenerate the user's MCP API key (invalidates the previous one).","operationId":"regenerate_api_key_api_v1_mcp_api_key_regenerate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyCreateResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpApiKeyErrorResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/health":{"get":{"summary":"Health Check","description":"Health check endpoint","operationId":"health_check_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AllTiersResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"tiers":{"additionalProperties":{"$ref":"#/components/schemas/TierInfo"},"type":"object","title":"Tiers"}},"type":"object","required":["tiers"],"title":"AllTiersResponse","description":"Response with all tier information."},"AskCasprChatHistoryResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entry Id"},"chat":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Chat"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"card_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Card Version"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success"],"title":"AskCasprChatHistoryResponse"},"AskCasprRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"},"report_id":{"type":"string","title":"Report Id"},"section_id":{"type":"string","title":"Section Id"},"subsection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsection Id"},"question":{"type":"string","maxLength":2000,"title":"Question"}},"type":"object","required":["session_id","report_id","section_id","question"],"title":"AskCasprRequest"},"AskCasprResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success"],"title":"AskCasprResponse"},"BatchPresignedUrlRequest":{"properties":{"s3_uris":{"items":{"type":"string"},"type":"array","title":"S3 Uris"}},"type":"object","required":["s3_uris"],"title":"BatchPresignedUrlRequest"},"BatchPresignedUrlResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"urls":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Urls"}},"type":"object","required":["success","urls"],"title":"BatchPresignedUrlResponse"},"Body_upload_process_api_v1_upload_process_post":{"properties":{"upload_session_id":{"type":"string","title":"Upload Session Id","description":"Upload session ID from POST /upload/create-session"},"chat_id":{"type":"string","title":"Chat Id","description":"Chat ID that these files will be associated with"},"reference_ids":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Ids","description":"JSON array of uploaded_files.id from library, e.g. '[\"id1\",\"id2\"]'"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Files to upload (max 3 files, 25 MB each)","default":[]}},"type":"object","required":["upload_session_id","chat_id"],"title":"Body_upload_process_api_v1_upload_process_post"},"BookCallRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"phone":{"$ref":"#/components/schemas/PhoneNumberModel"},"brief":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brief"}},"type":"object","required":["name","email","phone"],"title":"BookCallRequest"},"BookCallResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message","default":"Call booking submitted successfully. We will be in touch shortly."}},"type":"object","title":"BookCallResponse"},"CancelSubscriptionRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional reason for cancellation"}},"type":"object","title":"CancelSubscriptionRequest","description":"Request to cancel a subscription."},"CancelSubscriptionResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","message"],"title":"CancelSubscriptionResponse","description":"Response for subscription cancellation."},"CasprInfo":{"properties":{"live_feeds_data":{"type":"integer","title":"Live Feeds Data","description":"Count of live feeds data (TODO: implement real count)"}},"type":"object","required":["live_feeds_data"],"title":"CasprInfo","description":"Caspr information item"},"CategoriesResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"categories":{"items":{"$ref":"#/components/schemas/CategoryItem"},"type":"array","title":"Categories","description":"All available report categories, in fixed display order"}},"type":"object","title":"CategoriesResponse","description":"Response for GET /categories."},"CategoryItem":{"properties":{"slug":{"type":"string","title":"Slug","description":"Stable slug used in API params and DB writes. Note: the internal domain ``default`` is surfaced as ``standard`` in API responses."},"display_name":{"type":"string","title":"Display Name","description":"Human-readable label (e.g. 'Due Diligence')"}},"type":"object","required":["slug","display_name"],"title":"CategoryItem","description":"A single report-category card for the homepage catalog."},"ChatReferenceFileItem":{"properties":{"reference_id":{"type":"string","title":"Reference Id"},"original_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Filename"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["reference_id"],"title":"ChatReferenceFileItem"},"ChatReferenceFilesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"source":{"type":"string","title":"Source"},"files":{"items":{"$ref":"#/components/schemas/ChatReferenceFileItem"},"type":"array","title":"Files"}},"type":"object","required":["success","source","files"],"title":"ChatReferenceFilesResponse","description":"Response for GET /upload/chat-files/{chat_id}"},"ChatRequest":{"properties":{"message":{"type":"string","maxLength":10000,"title":"Message"},"chat_id":{"type":"string","title":"Chat Id"},"session_id":{"type":"string","title":"Session Id"},"reference_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Reference Ids"}},"type":"object","required":["message","chat_id","session_id"],"title":"ChatRequest"},"CompleteWalkoverResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message","default":"Walkover marked as completed."},"walkover_completed":{"type":"boolean","title":"Walkover Completed","default":true}},"type":"object","title":"CompleteWalkoverResponse"},"CreateSessionResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success"],"title":"CreateSessionResponse"},"CreateTempSessionRequest":{"properties":{"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"}},"type":"object","title":"CreateTempSessionRequest"},"DashboardInfoResponse":{"properties":{"general_facts":{"items":{"$ref":"#/components/schemas/GeneralFact"},"type":"array","title":"General Facts","description":"List of general facts about Caspr"},"caspr_info":{"items":{"$ref":"#/components/schemas/CasprInfo"},"type":"array","title":"Caspr Info","description":"Caspr system information (TODO: implement real data)"}},"type":"object","required":["general_facts","caspr_info"],"title":"DashboardInfoResponse","description":"Response schema for dashboard information"},"DashboardStatsResponse":{"properties":{"total_draft":{"type":"integer","title":"Total Draft","description":"Number of draft chats (chats in messages table but not in reports table)"},"analysis_completed":{"type":"integer","title":"Analysis Completed","description":"Number of reports with analysis completed"},"output_generated":{"type":"integer","title":"Output Generated","description":"Number of reports with output generated"},"updated":{"type":"integer","title":"Updated","description":"Number of updated reports (TODO: implement when update functionality is enabled)","default":0}},"type":"object","required":["total_draft","analysis_completed","output_generated"],"title":"DashboardStatsResponse","description":"Response schema for dashboard statistics"},"DeleteChatRequest":{"properties":{"chat_id":{"type":"string","title":"Chat Id"}},"type":"object","required":["chat_id"],"title":"DeleteChatRequest"},"DeleteChatResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["success"],"title":"DeleteChatResponse"},"DomainReportItem":{"properties":{"report_id":{"type":"string","title":"Report Id","description":"Unique report identifier"},"chat_id":{"type":"string","title":"Chat Id","description":"Associated chat/message ID"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Report title"},"status":{"type":"string","title":"Status","description":"Report status"},"domain_name":{"type":"string","title":"Domain Name","description":"Domain slug"},"poster_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poster Image Url","description":"Poster/thumbnail CDN URL"},"current_version":{"type":"integer","title":"Current Version","description":"Current active version number"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 creation timestamp"},"last_activity_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Activity At","description":"ISO 8601 last-activity timestamp"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At","description":"ISO 8601 generation timestamp"},"s3_uri":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"S3 Uri","description":"S3 URIs for generated files"}},"type":"object","required":["report_id","chat_id","status","domain_name","current_version"],"title":"DomainReportItem","description":"Lightweight report record returned by the domain-reports list endpoint."},"DomainReportsResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"domain_name":{"type":"string","title":"Domain Name","description":"Domain slug that was queried"},"category_name":{"type":"string","title":"Category Name","description":"Human-readable domain label"},"total":{"type":"integer","title":"Total","description":"Total non-draft reports in this domain for the user"},"limit":{"type":"integer","title":"Limit","description":"Page size applied"},"offset":{"type":"integer","title":"Offset","description":"Offset applied"},"reports":{"items":{"$ref":"#/components/schemas/DomainReportItem"},"type":"array","title":"Reports","description":"Paginated report list"}},"type":"object","required":["domain_name","category_name","total","limit","offset"],"title":"DomainReportsResponse","description":"Response for GET /report-domains/{domain_name}/reports."},"ErrorResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":false},"error":{"type":"string","title":"Error"}},"type":"object","required":["error"],"title":"ErrorResponse"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"ForgotPasswordResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"ForgotPasswordResponse"},"GeneralFact":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the fact"},"subtitle":{"type":"string","title":"Subtitle","description":"Subtitle/description of the fact"}},"type":"object","required":["title","subtitle"],"title":"GeneralFact","description":"Individual general fact item"},"GenerateInfographicRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"report_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Version Id"}},"type":"object","required":["report_id"],"title":"GenerateInfographicRequest"},"GenerateInfographicResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"report_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Version Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"info_pdf_s3_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info Pdf S3 Uri"},"info_pdf_generation_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info Pdf Generation Time"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"modified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Modified"},"already_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Already Exists"}},"type":"object","required":["success","message"],"title":"GenerateInfographicResponse"},"GeneratePresentationRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"report_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Version Id"},"generation_mode":{"type":"string","title":"Generation Mode","default":"template"}},"type":"object","required":["report_id"],"title":"GeneratePresentationRequest"},"GeneratePresentationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"report_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Version Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"pptx_s3_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pptx S3 Uri"},"pptx_generation_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pptx Generation Time"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"modified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Modified"},"already_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Already Exists"}},"type":"object","required":["success","message"],"title":"GeneratePresentationResponse"},"GenerateReportRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"report_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Version Id"},"output_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Type","default":"pdf"}},"type":"object","required":["report_id"],"title":"GenerateReportRequest"},"GenerateReportResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"report_id":{"type":"string","title":"Report Id"},"report_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Version Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"output_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Type"},"s3_uri":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"S3 Uri"},"modified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Modified"},"already_exists":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Already Exists"}},"type":"object","required":["success","message","report_id"],"title":"GenerateReportResponse"},"GeneratedOutputStatus":{"properties":{"generated":{"type":"boolean","title":"Generated"},"s3_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Path"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["generated"],"title":"GeneratedOutputStatus","description":"Status of a generated output type for a version"},"GetTCVerifiedResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"t_c_verified":{"type":"boolean","title":"T C Verified"}},"type":"object","required":["success","t_c_verified"],"title":"GetTCVerifiedResponse"},"GetWalkoverStatusResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"walkover_completed":{"type":"boolean","title":"Walkover Completed","description":"False until the user has explicitly finished the in-app walkover/walkthrough. Frontend should show the walkover whenever this is False, and call POST /complete-walkover once the user finishes it."}},"type":"object","required":["walkover_completed"],"title":"GetWalkoverStatusResponse"},"GoogleLoginRequest":{"properties":{"id_token":{"type":"string","title":"Id Token"}},"type":"object","required":["id_token"],"title":"GoogleLoginRequest"},"GoogleLoginResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"token":{"type":"string","title":"Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"user_id":{"type":"string","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"t_c_verified":{"type":"boolean","title":"T C Verified"},"onboarding_completed":{"type":"boolean","title":"Onboarding Completed"}},"type":"object","required":["token","refresh_token","user_id","user_name","t_c_verified","onboarding_completed"],"title":"GoogleLoginResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HomeSearchItem":{"properties":{"chat_id":{"type":"string","title":"Chat Id","description":"Chat identifier"},"chat_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Title","description":"Chat title"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id","description":"Latest report id, if any"},"report_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Title","description":"Latest report title, if any"},"status":{"type":"string","title":"Status","description":"Status of the latest report; 'draft' if no report exists"},"domain":{"type":"string","title":"Domain","description":"Report domain slug (default surfaced as 'standard')"},"poster_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poster Image Url","description":"Poster/thumbnail CDN URL"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Chat created_at, ISO-8601"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Chat updated_at, ISO-8601"},"matched_on":{"type":"string","title":"Matched On","description":"Where the search hit matched: 'chat_title', 'report_title', or 'both'"}},"type":"object","required":["chat_id","status","domain","matched_on"],"title":"HomeSearchItem","description":"One hit in the home search results.\n\nA hit represents a chat (which may or may not have an associated report).\nFor drafts there is no report; for non-draft hits ``report_*`` fields are\npopulated and ``domain`` reflects the report's domain (``default`` is\nsurfaced as ``standard``)."},"HomeSearchResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"total":{"type":"integer","title":"Total","description":"Total matching items (use with limit/offset)"},"limit":{"type":"integer","title":"Limit","description":"Page size applied"},"offset":{"type":"integer","title":"Offset","description":"Offset applied"},"items":{"items":{"$ref":"#/components/schemas/HomeSearchItem"},"type":"array","title":"Items","description":"Search hits page"}},"type":"object","required":["total","limit","offset"],"title":"HomeSearchResponse","description":"Response for GET /home-search."},"ListVersionOutputsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"outputs":{"anyOf":[{"items":{"$ref":"#/components/schemas/VersionOutputItem"},"type":"array"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["success"],"title":"ListVersionOutputsResponse"},"LiveSourcesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["success","count"],"title":"LiveSourcesResponse"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"token":{"type":"string","title":"Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"user_id":{"type":"string","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"t_c_verified":{"type":"boolean","title":"T C Verified"},"onboarding_completed":{"type":"boolean","title":"Onboarding Completed"}},"type":"object","required":["token","refresh_token","user_id","user_name","t_c_verified","onboarding_completed"],"title":"LoginResponse"},"LogoutRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"LogoutRequest"},"LogoutResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message","default":"You have been successfully logged out."}},"type":"object","title":"LogoutResponse"},"McpApiKeyCreateResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"api_key":{"type":"string","title":"Api Key","description":"Plaintext key — shown only once"},"meta":{"$ref":"#/components/schemas/McpApiKeyMeta"},"message":{"type":"string","title":"Message"}},"type":"object","required":["api_key","meta","message"],"title":"McpApiKeyCreateResponse"},"McpApiKeyDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"McpApiKeyDeleteResponse"},"McpApiKeyErrorResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":false},"error":{"type":"string","title":"Error"}},"type":"object","required":["error"],"title":"McpApiKeyErrorResponse"},"McpApiKeyMeta":{"properties":{"id":{"type":"string","title":"Id"},"key_prefix":{"type":"string","title":"Key Prefix"},"last_four":{"type":"string","title":"Last Four"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","key_prefix","last_four"],"title":"McpApiKeyMeta"},"McpApiKeyStatusResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"has_key":{"type":"boolean","title":"Has Key"},"api_key":{"anyOf":[{"$ref":"#/components/schemas/McpApiKeyMeta"},{"type":"null"}]}},"type":"object","required":["has_key"],"title":"McpApiKeyStatusResponse"},"OnboardingStatusResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"onboarding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Onboarding"}},"type":"object","required":["success"],"title":"OnboardingStatusResponse"},"OnboardingStepResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message","default":""},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success"],"title":"OnboardingStepResponse"},"OngoingChatItem":{"properties":{"chat_id":{"type":"string","title":"Chat Id","description":"Chat identifier"},"chat_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Title","description":"Chat title"},"status":{"type":"string","title":"Status","description":"Report status; 'draft' for all entries here"},"poster_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poster Image Url","description":"Poster/thumbnail CDN URL"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Chat created_at, ISO-8601"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Chat updated_at, ISO-8601"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Active chat session id (if any)"}},"type":"object","required":["chat_id","status"],"title":"OngoingChatItem","description":"A single draft chat for the ongoing-chats endpoint."},"OngoingChatsResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"standard":{"items":{"$ref":"#/components/schemas/OngoingChatItem"},"type":"array","title":"Standard","description":"Draft chats for the default/standard category"}},"type":"object","title":"OngoingChatsResponse","description":"Response for GET /ongoing-chats.\n\nDraft reports do not yet have a ``domain_name`` in the DB, so all\ndrafts are returned under the ``standard`` key. As soon as drafts\nstart carrying a domain, additional category keys will appear here\nalongside ``standard``."},"PaymentStatusResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Status: completed, pending, failed, reversed"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens","description":"Number of tokens in the batch"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount","description":"Amount paid in the specified currency"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency (USD, INR, etc.)"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type","description":"Source type: topup, subscription, etc."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"When the payment was created"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At","description":"When the tokens will expire"}},"type":"object","title":"PaymentStatusResponse","description":"Response schema for payment status polling endpoint."},"PaymentWebhookRequest":{"properties":{"payment_id":{"type":"string","title":"Payment Id"},"status":{"type":"string","title":"Status"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method"},"payment_method_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payment Method Details"}},"type":"object","required":["payment_id","status"],"title":"PaymentWebhookRequest","description":"Request to credit tokens from a payment."},"PaymentWebhookResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"tokens_credited":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens Credited"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"balance_after":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance After"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"idempotent":{"type":"boolean","title":"Idempotent","default":false}},"type":"object","title":"PaymentWebhookResponse","description":"Response for credit from payment."},"PhoneNumberModel":{"properties":{"country_code":{"type":"string","title":"Country Code"},"number":{"type":"string","title":"Number"}},"type":"object","required":["country_code","number"],"title":"PhoneNumberModel"},"PreviousChatMessagesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"messages":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Messages"},"reports":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Reports"},"is_mcp":{"type":"boolean","title":"Is Mcp","default":false},"turn_in_progress":{"type":"boolean","title":"Turn In Progress","default":false}},"type":"object","required":["success","messages","reports"],"title":"PreviousChatMessagesResponse"},"ReferralErrorResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":false},"error":{"type":"string","title":"Error"}},"type":"object","required":["error"],"title":"ReferralErrorResponse","description":"Error response for referral operations."},"ReferralInfoResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"referral_code":{"type":"string","title":"Referral Code","description":"User's unique referral code"},"total_referrals":{"type":"integer","title":"Total Referrals","description":"Total successful referrals"},"total_tokens_earned":{"type":"integer","title":"Total Tokens Earned","description":"Total tokens earned from referrals"},"referral_link":{"type":"string","title":"Referral Link","description":"Complete referral link to share"}},"type":"object","required":["success","referral_code","total_referrals","total_tokens_earned","referral_link"],"title":"ReferralInfoResponse","description":"Response for getting referral information."},"RefineOrDeleteRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"card":{"additionalProperties":true,"type":"object","title":"Card"}},"type":"object","required":["report_id","card"],"title":"RefineOrDeleteRequest"},"RefineOrDeleteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"refine_card":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Refine Card"}},"type":"object","required":["success","message"],"title":"RefineOrDeleteResponse"},"RefineVisualizationRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"card":{"additionalProperties":true,"type":"object","title":"Card"}},"type":"object","required":["report_id","card"],"title":"RefineVisualizationRequest"},"RefineVisualizationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"updated_card":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Updated Card"}},"type":"object","required":["success","message"],"title":"RefineVisualizationResponse"},"RegenerateESRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"}},"type":"object","required":["report_id"],"title":"RegenerateESRequest"},"RegenerateESResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"new_es_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"New Es Version"},"updated_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated Summary"}},"type":"object","required":["success","message"],"title":"RegenerateESResponse"},"RenameChatRequest":{"properties":{"chat_id":{"type":"string","title":"Chat Id"},"new_title":{"type":"string","title":"New Title"}},"type":"object","required":["chat_id","new_title"],"title":"RenameChatRequest"},"RenameChatResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["success"],"title":"RenameChatResponse"},"ReportDomainItem":{"properties":{"domain_name":{"type":"string","title":"Domain Name","description":"Internal domain slug, e.g. 'due_diligence'"},"category_name":{"type":"string","title":"Category Name","description":"Human-readable label, e.g. 'Due Diligence'"},"item_count":{"type":"integer","title":"Item Count","description":"Number of non-draft reports in this domain"}},"type":"object","required":["domain_name","category_name","item_count"],"title":"ReportDomainItem","description":"Summary of one report domain for the current user."},"ReportDomainsResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"domains":{"items":{"$ref":"#/components/schemas/ReportDomainItem"},"type":"array","title":"Domains","description":"Domains that have at least one non-draft report, sorted by item count desc"}},"type":"object","title":"ReportDomainsResponse","description":"Response for GET /report-domains."},"ReportInfoResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"reports":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Reports"}},"type":"object","required":["success","reports"],"title":"ReportInfoResponse","description":"Response for getting report info by report_id and report_version_id"},"ReportPresignedUrlResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"presigned_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presigned Url"}},"type":"object","required":["success","presigned_url"],"title":"ReportPresignedUrlResponse"},"ReportVersionHistoryResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"report_id":{"type":"string","title":"Report Id"},"s3_base_path":{"type":"string","title":"S3 Base Path"},"versions":{"items":{"$ref":"#/components/schemas/VersionInfo"},"type":"array","title":"Versions"}},"type":"object","required":["success","report_id","s3_base_path","versions"],"title":"ReportVersionHistoryResponse","description":"Response for the version history dropdown API"},"RequestRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","email"],"title":"RequestRequest"},"RequestResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message","default":"Request submitted successfully!"}},"type":"object","title":"RequestResponse"},"ResearchInterestItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"display_order":{"type":"integer","title":"Display Order"}},"type":"object","required":["id","name","display_name","display_order"],"title":"ResearchInterestItem"},"ResearchInterestsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"interests":{"items":{"$ref":"#/components/schemas/ResearchInterestItem"},"type":"array","title":"Interests","default":[]}},"type":"object","required":["success"],"title":"ResearchInterestsResponse"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","title":"Password"}},"type":"object","required":["token","password"],"title":"ResetPasswordRequest"},"ResetPasswordResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"ResetPasswordResponse"},"RevertCardRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"card_id":{"type":"string","title":"Card Id"}},"type":"object","required":["report_id","card_id"],"title":"RevertCardRequest","description":"Request to revert a card to its immediate previous version (undo last refinement).\n\nOnly reverts to immediate previous version (v3 → v2, not v3 → v1).\nCurrent version is deleted and previous version is reactivated."},"RevertCardResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"reverted_to_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reverted To Version"},"card_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Id"},"primary_card_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Card Id"},"deleted_versions":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Deleted Versions"},"reverted_card":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Reverted Card"}},"type":"object","required":["success"],"title":"RevertCardResponse"},"SaveResearchInterestsRequest":{"properties":{"interest_ids":{"items":{"type":"string"},"type":"array","title":"Interest Ids"},"custom_research_text":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Custom Research Text","description":"Free-text description the user typed when selecting 'Something else' in the research-interests step. Required only when one of the selected interest_ids maps to the 'something_else' row in research_interests; ignored otherwise."}},"type":"object","required":["interest_ids"],"title":"SaveResearchInterestsRequest"},"SaveUniversityEmailRequest":{"properties":{"university_email":{"type":"string","format":"email","title":"University Email"},"university_id":{"type":"string","title":"University Id"}},"type":"object","required":["university_email","university_id"],"title":"SaveUniversityEmailRequest"},"SaveUserRoleRequest":{"properties":{"role_id":{"type":"string","title":"Role Id"},"custom_role_text":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Custom Role Text","description":"Free-text description the user typed when selecting the 'Other' role. Required only when role_id maps to the 'other' row in user_roles; ignored otherwise."}},"type":"object","required":["role_id"],"title":"SaveUserRoleRequest"},"SendVerificationLinkRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"SendVerificationLinkRequest"},"SendVerificationLinkResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"SendVerificationLinkResponse"},"SignupRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"phone_country_code":{"type":"string","title":"Phone Country Code"},"phone":{"type":"string","title":"Phone"},"password":{"type":"string","title":"Password"},"referral_code":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}],"title":"Referral Code","description":"Referral code (optional)"}},"type":"object","required":["name","email","phone_country_code","phone","password"],"title":"SignupRequest"},"SignupResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message","default":"You need to verify your email address to continue."}},"type":"object","title":"SignupResponse"},"SubscriptionResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"subscription":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscription"},"current_interval":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Current Interval"}},"type":"object","title":"SubscriptionResponse","description":"Response schema for subscription details."},"SubscriptionTaxCalculationRequest":{"properties":{"country_code":{"type":"string","title":"Country Code","description":"ISO country code (e.g. IN, US)"},"plan_name":{"type":"string","title":"Plan Name","description":"Subscription plan name (e.g. free, plus, pro)"},"plan_type":{"type":"string","title":"Plan Type","description":"Plan type (e.g. monthly, yearly)"}},"type":"object","required":["country_code","plan_name","plan_type"],"title":"SubscriptionTaxCalculationRequest","description":"Request schema for calculating taxes for a subscription plan."},"SubscriptionWebhookEvent":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id"},"event":{"type":"string","title":"Event"},"payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"gateway":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"plan_duration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Duration"},"paid_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Paid Count"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method"},"payment_method_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payment Method Details"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"next_payment_datetime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Payment Datetime"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"sale_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sale Id"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"gateway_plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Plan Id"},"current_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Start"},"current_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current End"},"refund_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Id"},"refund_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Status"},"refund_created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Created At"},"refund_speed_requested":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Speed Requested"},"refund_speed_processed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Speed Processed"},"gateway_payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Payment Id"},"gateway_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Invoice Id"},"gateway_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Order Id"},"original_payment_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Original Payment Amount"},"amount_refunded_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Refunded Total"},"payment_refund_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Refund Status"},"payment_created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Created At"},"payment_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Description"},"razorpay_event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Razorpay Event"}},"type":"object","required":["subscription_id","event"],"title":"SubscriptionWebhookEvent","description":"Schema for subscription webhook events."},"TaxCalculationRequest":{"properties":{"country_code":{"type":"string","title":"Country Code","description":"ISO country code (e.g. IN, US)"},"amount_in_usd":{"type":"number","exclusiveMinimum":0.0,"title":"Amount In Usd","description":"Amount in USD to calculate tax on"}},"type":"object","required":["country_code","amount_in_usd"],"title":"TaxCalculationRequest","description":"Request schema for calculating taxes."},"TaxCalculationResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"country_code":{"type":"string","title":"Country Code"},"currency":{"type":"string","title":"Currency"},"amount_in_currency":{"type":"number","title":"Amount In Currency"},"tokens_per_month":{"type":"integer","title":"Tokens Per Month"},"tax_percentage":{"type":"number","title":"Tax Percentage"},"tax_amount":{"type":"number","title":"Tax Amount"},"total_amount":{"type":"number","title":"Total Amount"},"tax_details":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tax Details"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["country_code","currency","amount_in_currency","tokens_per_month","tax_percentage","tax_amount","total_amount"],"title":"TaxCalculationResponse","description":"Response schema for tax calculation.\n\nNote: tokens_per_month represents:\n- For subscription: tokens credited per month\n- For topup: total tokens in single purchase (field name kept for consistency)"},"TempChatMessagesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"messages":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Messages"}},"type":"object","required":["success","messages"],"title":"TempChatMessagesResponse"},"TempChatRequest":{"properties":{"message":{"type":"string","maxLength":10000,"title":"Message"},"chat_id":{"type":"string","title":"Chat Id"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["message","chat_id","session_id"],"title":"TempChatRequest"},"TierInfo":{"properties":{"tier":{"type":"string","title":"Tier"},"monthly":{"$ref":"#/components/schemas/TierPricing"},"yearly":{"$ref":"#/components/schemas/TierPricing"},"signup_bonus":{"type":"integer","title":"Signup Bonus"},"report_cost":{"type":"integer","title":"Report Cost"}},"type":"object","required":["tier","monthly","yearly","signup_bonus","report_cost"],"title":"TierInfo","description":"Information about a subscription tier."},"TierPricing":{"properties":{"cost":{"type":"number","title":"Cost"},"currency":{"type":"string","title":"Currency"},"tokens_per_month":{"type":"integer","title":"Tokens Per Month"}},"type":"object","required":["cost","currency","tokens_per_month"],"title":"TierPricing","description":"Pricing details for a tier interval."},"TopupInitiateRequest":{"properties":{"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount"},"country_code":{"type":"string","title":"Country Code","description":"ISO country code (e.g. IN, US)"},"idempotency_key":{"type":"string","title":"Idempotency Key","description":"Unique key for idempotency"}},"type":"object","required":["amount","country_code","idempotency_key"],"title":"TopupInitiateRequest","description":"Request to initiate a token top-up."},"TopupInitiateResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"payment_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payment Params"}},"type":"object","title":"TopupInitiateResponse","description":"Response with payment parameters for top-up."},"TransactionHistoryResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"transactions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transactions"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["transactions","total","limit","offset"],"title":"TransactionHistoryResponse","description":"Response schema for transaction history endpoint."},"UpdatePaymentMethodRequest":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id","description":"Current subscription ID"},"cancel_at_cycle_end":{"type":"boolean","title":"Cancel At Cycle End","description":"Cancel at cycle end (recommended) or immediately","default":true}},"type":"object","required":["subscription_id"],"title":"UpdatePaymentMethodRequest","description":"Request to update subscription payment method."},"UpdatePaymentMethodResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","message"],"title":"UpdatePaymentMethodResponse","description":"Response for payment method update."},"UpdateTCVerifiedRequest":{"properties":{"t_c_verified":{"type":"boolean","title":"T C Verified"}},"type":"object","required":["t_c_verified"],"title":"UpdateTCVerifiedRequest"},"UpdateTCVerifiedResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"t_c_verified":{"type":"boolean","title":"T C Verified"}},"type":"object","required":["success","message","t_c_verified"],"title":"UpdateTCVerifiedResponse"},"UserChatsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"chats":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Chats"}},"type":"object","required":["success","chats"],"title":"UserChatsResponse"},"UserLogsRequest":{"properties":{"type":{"type":"string","title":"Type"},"logs_data":{"additionalProperties":true,"type":"object","title":"Logs Data"},"status":{"type":"boolean","title":"Status"}},"type":"object","required":["type","logs_data","status"],"title":"UserLogsRequest"},"UserRoleItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"discount_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Tag"},"display_order":{"type":"integer","title":"Display Order"}},"type":"object","required":["id","name","display_name","display_order"],"title":"UserRoleItem"},"UserRolesResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"roles":{"items":{"$ref":"#/components/schemas/UserRoleItem"},"type":"array","title":"Roles","default":[]}},"type":"object","required":["success"],"title":"UserRolesResponse"},"ValidateUniversityEmailRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ValidateUniversityEmailRequest"},"ValidateUniversityEmailResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"matched":{"type":"boolean","title":"Matched","default":false},"university":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"University"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["success"],"title":"ValidateUniversityEmailResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyAccountTokenRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"VerifyAccountTokenRequest"},"VerifyAccountTokenResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"token":{"type":"string","title":"Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"user_id":{"type":"string","title":"User Id"},"user_name":{"type":"string","title":"User Name"},"t_c_verified":{"type":"boolean","title":"T C Verified"}},"type":"object","required":["success","message","token","refresh_token","user_id","user_name","t_c_verified"],"title":"VerifyAccountTokenResponse"},"VerifyResetTokenResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"valid":{"type":"boolean","title":"Valid"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","valid","message"],"title":"VerifyResetTokenResponse"},"VersionDownloadResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"presigned_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presigned Url"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"}},"type":"object","required":["success"],"title":"VersionDownloadResponse"},"VersionInfo":{"properties":{"report_version_id":{"type":"string","title":"Report Version Id"},"version":{"type":"integer","title":"Version"},"is_current":{"type":"boolean","title":"Is Current"},"is_modified":{"type":"boolean","title":"Is Modified"},"label":{"type":"string","title":"Label"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"generated_outputs":{"additionalProperties":{"$ref":"#/components/schemas/GeneratedOutputStatus"},"type":"object","title":"Generated Outputs"}},"type":"object","required":["report_version_id","version","is_current","is_modified","label","generated_outputs"],"title":"VersionInfo","description":"Information about a single report version"},"VersionOutputItem":{"properties":{"version":{"type":"integer","title":"Version"},"file_type":{"type":"string","title":"File Type"},"s3_path":{"type":"string","title":"S3 Path"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["version","file_type","s3_path"],"title":"VersionOutputItem"},"WalletBalanceResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"available_balance":{"type":"integer","title":"Available Balance","description":"Tokens available for use"},"reserved_balance":{"type":"integer","title":"Reserved Balance","description":"Tokens locked for pending operations"},"total_balance":{"type":"integer","title":"Total Balance","description":"Total tokens (available + reserved)"},"subscription_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier","description":"Current subscription tier"},"subscription_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Expires At","description":"Subscription expiry date"}},"type":"object","required":["available_balance","reserved_balance","total_balance"],"title":"WalletBalanceResponse","description":"Response schema for wallet balance endpoint."},"WalletErrorResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":false},"error":{"type":"string","title":"Error"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"}},"type":"object","required":["error"],"title":"WalletErrorResponse","description":"Generic error response for wallet operations."},"src__resources__routers__ask_caspr_api__CreateSessionRequest":{"properties":{"report_id":{"type":"string","title":"Report Id"},"section_id":{"type":"string","title":"Section Id"},"subsection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsection Id"}},"type":"object","required":["report_id","section_id"],"title":"CreateSessionRequest"},"src__resources__schemas__chat__CreateSessionRequest":{"properties":{"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"}},"type":"object","title":"CreateSessionRequest"},"src__resources__schemas__subscription__SubscribeRequest":{"properties":{"email_id":{"type":"string","format":"email","title":"Email Id"}},"type":"object","required":["email_id"],"title":"SubscribeRequest"},"src__resources__schemas__subscription__SubscribeResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"type":"string","title":"Message","default":"Successfully subscribed!"}},"type":"object","title":"SubscribeResponse"},"src__resources__schemas__wallet__SubscribeRequest":{"properties":{"to_update":{"type":"boolean","title":"To Update","description":"True to change existing plan, False to create new subscription"},"idempotency_key":{"type":"string","title":"Idempotency Key","description":"Unique key for idempotency"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier","description":"PLUS or PRO (required for both create and update)"},"plan_duration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Duration","description":"MONTHLY or YEARLY (required for both create and update)"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"ISO country code e.g. IN, US (required when to_update=False)"}},"type":"object","required":["to_update","idempotency_key"],"title":"SubscribeRequest","description":"Request for /subscribe endpoint. Single endpoint for both new subscription and plan change.\n- to_update=False: create new subscription (plan_tier, plan_duration, country required).\n- to_update=True: change existing plan (plan_tier, plan_duration required)."},"src__resources__schemas__wallet__SubscribeResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id"}},"type":"object","title":"SubscribeResponse","description":"Response with subscription details."}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}}}