{"openapi":"3.1.0","info":{"title":"CloakAI Backend","description":"AI Interview Assistant API","version":"0.1.0"},"paths":{"/api/auth/signup":{"post":{"tags":["auth"],"summary":"Create User","operationId":"create_user_api_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login For Access Token","operationId":"login_for_access_token_api_auth_login_post","parameters":[{"name":"X-Turnstile-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Turnstile-Token"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_for_access_token_api_auth_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/google/start":{"get":{"tags":["auth"],"summary":"Google Start","description":"Send the browser to Google's consent screen.\n\nThe desktop app adds desktop_port + desktop_nonce so the result is handed\nback to it instead of the website.","operationId":"google_start_api_auth_google_start_get","parameters":[{"name":"intent","in":"query","required":false,"schema":{"type":"string","default":"login","title":"Intent"}},{"name":"desktop_port","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Desktop Port"}},{"name":"desktop_nonce","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desktop Nonce"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/google/callback":{"get":{"tags":["auth"],"summary":"Google Callback","description":"Finish Google sign-in and hand the session token to the website or desktop app.","operationId":"google_callback_api_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Read Users Me","operationId":"read_users_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["auth"],"summary":"Update Users Me","operationId":"update_users_me_api_auth_me_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/verify-email":{"get":{"tags":["auth"],"summary":"Verify Email","operationId":"verify_email_api_auth_verify_email_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","operationId":"resend_verification_api_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","operationId":"change_password_api_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"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/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Generate a time-limited reset token and email it to the user.\nAlways returns 200 to prevent email enumeration — including when the\nsend is throttled, which is silently skipped rather than reported.","operationId":"forgot_password_api_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Validate the reset token and set the new password.","operationId":"reset_password_api_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/session/start":{"post":{"tags":["auth"],"summary":"Start User Session","description":"Start a new user session.","operationId":"start_user_session_api_auth_session_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStartResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/session/heartbeat":{"post":{"tags":["auth"],"summary":"Heartbeat User Session","description":"Update an active user session with a heartbeat.","operationId":"heartbeat_user_session_api_auth_session_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"}}},"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/auth/session/end":{"post":{"tags":["auth"],"summary":"End User Session","description":"End a user session.","operationId":"end_user_session_api_auth_session_end_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"}}},"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/subscriptions/me":{"get":{"tags":["subscriptions"],"summary":"Get Subscription","operationId":"get_subscription_api_subscriptions_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/subscriptions/checkout":{"post":{"tags":["subscriptions"],"summary":"Create Checkout Session","operationId":"create_checkout_session_api_subscriptions_checkout_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"plan","in":"query","required":true,"schema":{"type":"string","title":"Plan"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscriptions/checkout-session/{session_id}":{"get":{"tags":["subscriptions"],"summary":"Get Checkout Session","description":"Purchase details for the /success page's GA4 `purchase` event.\n\nOnly the session's own buyer can read it — the Stripe session id sits in\nthe success URL, so it must not act as a bearer credential on its own.","operationId":"get_checkout_session_api_subscriptions_checkout_session__session_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscriptions/cancel":{"post":{"tags":["subscriptions"],"summary":"Cancel Subscription","operationId":"cancel_subscription_api_subscriptions_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/subscriptions/webhook":{"post":{"tags":["subscriptions"],"summary":"Stripe Webhook","description":"Stripe webhook receiver endpoint.\n\nVerifies the webhook signature, checks event idempotency, updates\nsubscription states, registers payment statuses, and notifies admins\nof failures.","operationId":"stripe_webhook_api_subscriptions_webhook_post","parameters":[{"name":"stripe-signature","in":"header","required":false,"schema":{"type":"string","title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profiles/":{"get":{"tags":["profiles"],"summary":"Get Profiles","operationId":"get_profiles_api_profiles__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProfileResponse"},"type":"array","title":"Response Get Profiles Api Profiles  Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["profiles"],"summary":"Create Profile","operationId":"create_profile_api_profiles__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/profiles/{profile_id}":{"get":{"tags":["profiles"],"summary":"Get Profile","operationId":"get_profile_api_profiles__profile_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles"],"summary":"Update Profile","operationId":"update_profile_api_profiles__profile_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["profiles"],"summary":"Delete Profile","operationId":"delete_profile_api_profiles__profile_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profiles/{profile_id}/resume":{"put":{"tags":["profiles"],"summary":"Upload Resume","operationId":"upload_resume_api_profiles__profile_id__resume_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_resume_api_profiles__profile_id__resume_put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/":{"post":{"tags":["history"],"summary":"Create History","operationId":"create_history_api_history__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHistoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["history"],"summary":"Get History","operationId":"get_history_api_history__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":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHistoryPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/{history_id}":{"patch":{"tags":["history"],"summary":"Set History Visibility","operationId":"set_history_visibility_api_history__history_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"history_id","in":"path","required":true,"schema":{"type":"integer","title":"History Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHistoryVisibility"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/hide-all":{"post":{"tags":["history"],"summary":"Hide All History","operationId":"hide_all_history_api_history_hide_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/feedback":{"post":{"tags":["feedback"],"summary":"Submit Feedback","description":"Store one post-interview feedback submission for the signed-in user.","operationId":"submit_feedback_api_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionFeedbackCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionFeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/audio/transcribe":{"post":{"tags":["audio"],"summary":"Transcribe Audio","operationId":"transcribe_audio_api_audio_transcribe_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_audio_api_audio_transcribe_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/vision/analyze":{"post":{"tags":["vision"],"summary":"Analyze Image","operationId":"analyze_image_api_vision_analyze_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_image_api_vision_analyze_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/chat":{"post":{"tags":["chat"],"summary":"Chat","description":"Send a chat message and get a response.","operationId":"chat_api_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"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/providers":{"get":{"tags":["chat"],"summary":"Get Providers","description":"Report the active provider and the models it offers.\n\nThe provider is set by the operator via DEFAULT_PROVIDER and is not\nswitchable per request, so exactly one provider is reported.","operationId":"get_providers_api_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/providers/{provider_name}":{"post":{"tags":["chat"],"summary":"Set Provider","description":"Rejected by design — the provider is operator-controlled via .env.\n\nKept so existing clients get a clear 409 instead of a 500 from assigning\nto a read-only property.","operationId":"set_provider_api_providers__provider_name__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider_name","in":"path","required":true,"schema":{"type":"string","title":"Provider Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/providers/{provider_name}/models":{"get":{"tags":["chat"],"summary":"Get Provider Models","description":"Get available models for the active provider.","operationId":"get_provider_models_api_providers__provider_name__models_get","parameters":[{"name":"provider_name","in":"path","required":true,"schema":{"type":"string","title":"Provider Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/resumes/":{"get":{"tags":["resumes"],"summary":"Get Resumes","operationId":"get_resumes_api_resumes__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ResumeResponse"},"type":"array","title":"Response Get Resumes Api Resumes  Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/resumes/upload":{"post":{"tags":["resumes"],"summary":"Upload Resume","operationId":"upload_resume_api_resumes_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_resume_api_resumes_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/resumes/text":{"post":{"tags":["resumes"],"summary":"Add Text Resume","operationId":"add_text_resume_api_resumes_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeBase"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/resumes/{resume_id}":{"delete":{"tags":["resumes"],"summary":"Delete Resume","operationId":"delete_resume_api_resumes__resume_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"resume_id","in":"path","required":true,"schema":{"type":"integer","title":"Resume Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/misc/languages":{"get":{"tags":["misc"],"summary":"Get Supported Languages","operationId":"get_supported_languages_api_misc_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Get Supported Languages Api Misc Languages Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/admin/auth/login":{"post":{"tags":["admin-auth"],"summary":"Admin Login","description":"Authenticate admin with email + password.\n\n- Returns short-lived JWT (15 min) and refresh token (7 days).\n- Skip MFA if a valid device token is provided in the X-MFA-Device-Token header.\n- Locks account after ``ADMIN_MAX_FAILED_ATTEMPTS`` consecutive failures.\n- Returns a **generic** error for both wrong email and wrong password\n  to prevent account enumeration.","operationId":"admin_login_admin_auth_login_post","parameters":[{"name":"X-MFA-Device-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Mfa-Device-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/auth/refresh":{"post":{"tags":["admin-auth"],"summary":"Admin Refresh","description":"Exchange a valid refresh token for a new access token.\n\nPreserves the ``mfa_verified`` state from the current access token\nif one is provided in the Authorization header; otherwise defaults\nto ``False``.","operationId":"admin_refresh_admin_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRefreshResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/auth/logout":{"post":{"tags":["admin-auth"],"summary":"Admin Logout","description":"Revoke a refresh token, effectively logging out.\n\nReturns 204 regardless of whether the token existed (prevent enumeration).","operationId":"admin_logout_admin_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLogoutRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/auth/setup-mfa":{"post":{"tags":["admin-auth"],"summary":"Admin Setup Mfa","description":"Generate a TOTP secret and return the provisioning URI.\n\nThe admin must then scan the QR code and verify with ``/verify-mfa``\nto complete MFA enrollment.\n\nUses the no-MFA dependency since the admin hasn't verified MFA yet —\nbut if MFA is already enabled, the *current* session must already be\nMFA-verified to re-enroll. Otherwise a password-only session could\noverwrite an existing secret and satisfy its own MFA challenge.","operationId":"admin_setup_mfa_admin_auth_setup_mfa_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMFASetupResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/auth/verify-mfa":{"post":{"tags":["admin-auth"],"summary":"Admin Verify Mfa","description":"Verify a TOTP code and issue an upgraded JWT with ``mfa_verified=True``.\n\nIf this is the admin's first successful verification, ``mfa_enabled``\nis set to ``True`` on their account.","operationId":"admin_verify_mfa_admin_auth_verify_mfa_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMFAVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMFAVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/auth/me":{"get":{"tags":["admin-auth"],"summary":"Admin Me","description":"Retrieve info about the currently logged in admin user.\n\nValidates signature and expiry of token via the dependency.","operationId":"admin_me_admin_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/auth/settings":{"put":{"tags":["admin-auth"],"summary":"Update Admin Settings","description":"Update settings/preferences for the authenticated admin user.","operationId":"update_admin_settings_admin_auth_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSettingsUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/users":{"get":{"tags":["admin_users"],"summary":"List Users","description":"Paginated user list with filters, sorting, and search.\nRequires VIEWER or SUPER_ADMIN.","operationId":"list_users_admin_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier"}},{"name":"is_email_verified","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Email Verified"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"credits_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Min"}},{"name":"credits_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Max"}},{"name":"created_at_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At From"}},{"name":"created_at_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At To"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Order"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/export":{"get":{"tags":["admin_users"],"summary":"Export Users Csv","description":"Streams a CSV export of the filtered user list.\nRequires SUPER_ADMIN.","operationId":"export_users_csv_admin_users_export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier"}},{"name":"is_email_verified","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Email Verified"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"credits_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Min"}},{"name":"credits_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Max"}},{"name":"created_at_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At From"}},{"name":"created_at_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At To"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}":{"get":{"tags":["admin_users"],"summary":"Get User Profile","description":"Get full user profile including query count, total spend, and purchase history.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_user_profile_admin_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin_users"],"summary":"Soft Delete User","description":"Soft delete user: sets deleted_at, anonymizes name, surname, and email.\nMust happen within a single transaction.\nRequires SUPER_ADMIN.","operationId":"soft_delete_user_admin_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/sessions":{"get":{"tags":["admin_users"],"summary":"List User Sessions","description":"A user's interview sessions, newest first: when each ran, for which\nprofile, and how many questions got an answer. Rows saved before session\nids existed and never backfilled (no session_id) are not listed.\nRequires VIEWER or SUPER_ADMIN.","operationId":"list_user_sessions_admin_users__user_id__sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/sessions/{session_id}":{"get":{"tags":["admin_users"],"summary":"Get User Session","description":"Every question and answer of one interview session, in order. Answers\nare empty where generation failed. Viewing is audit-logged because it\nexposes what the user said in an interview.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_user_session_admin_users__user_id__sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/credits":{"patch":{"tags":["admin_users"],"summary":"Adjust User Credits","description":"Adjust user credits. Rejects if final credits would fall below zero.\nRequires SUPER_ADMIN.","operationId":"adjust_user_credits_admin_users__user_id__credits_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditAdjustRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/status":{"patch":{"tags":["admin_users"],"summary":"Update User Status","description":"Soft suspend or reactivate users. Suspended users receive 401 on login.\nRequires SUPER_ADMIN.","operationId":"update_user_status_admin_users__user_id__status_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/gdpr/delete":{"post":{"tags":["admin_users"],"summary":"Gdpr Delete User","description":"GDPR Delete: Hard delete all user records and create log in gdpr_requests.\nRequires SUPER_ADMIN.","operationId":"gdpr_delete_user_admin_users__user_id__gdpr_delete_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/gdpr/export":{"post":{"tags":["admin_users"],"summary":"Gdpr Export User","description":"GDPR Export: Exports all personal data and writes to gdpr_requests.\nRequires SUPER_ADMIN.","operationId":"gdpr_export_user_admin_users__user_id__gdpr_export_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/ai-usage":{"get":{"tags":["admin_analytics"],"summary":"Get Ai Usage","description":"Get overview analytics for AI query logs.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_ai_usage_admin_analytics_ai_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"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"}}}}}}},"/admin/analytics/ai-usage/trends":{"get":{"tags":["admin_analytics"],"summary":"Get Ai Usage Trends","description":"Get time-series trends for AI usage and costs.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_ai_usage_trends_admin_analytics_ai_usage_trends_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Granularity"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/ai-usage/top-users":{"get":{"tags":["admin_analytics"],"summary":"Get Top Users","description":"Get paginated top users by AI queries and cost.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_top_users_admin_analytics_ai_usage_top_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":20,"title":"Limit"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/ai-usage/errors":{"get":{"tags":["admin_analytics"],"summary":"Get Error Rates","description":"Get error rate per provider per day; flags any period above 5% error rate.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_error_rates_admin_analytics_ai_usage_errors_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/growth":{"get":{"tags":["admin_analytics"],"summary":"Get Growth Analytics","description":"Get growth and activation metrics for the administrative portal.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_growth_analytics_admin_analytics_growth_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/growth/trends":{"get":{"tags":["admin_analytics"],"summary":"Get Growth Trends","description":"Get time-series trends for growth metrics.\nRequires VIEWER or SUPER_ADMIN.","operationId":"get_growth_trends_admin_analytics_growth_trends_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Granularity"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/stripe":{"post":{"tags":["webhooks"],"summary":"Stripe Webhook","description":"Stripe webhook receiver endpoint.\n\nVerifies the webhook signature, checks event idempotency, updates\nsubscription states, registers payment statuses, and notifies admins\nof failures.","operationId":"stripe_webhook_webhooks_stripe_post","parameters":[{"name":"stripe-signature","in":"header","required":false,"schema":{"type":"string","title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/revenue":{"get":{"tags":["admin_revenue"],"summary":"Get Revenue Analytics","description":"Get high-level revenue and subscription metrics for a period.\n\nRequires VIEWER or SUPER_ADMIN role.","operationId":"get_revenue_analytics_admin_analytics_revenue_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/revenue/failed-payments":{"get":{"tags":["admin_revenue"],"summary":"Get Failed Payments","description":"Get paginated failed payments within a timeframe.\n\nRequires VIEWER or SUPER_ADMIN role.","operationId":"get_failed_payments_admin_analytics_revenue_failed_payments_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/revenue/plan-distribution":{"get":{"tags":["admin_revenue"],"summary":"Get Plan Distribution","description":"Get the subscription plan distribution across active users.\n\nRequires VIEWER or SUPER_ADMIN role.","operationId":"get_plan_distribution_admin_analytics_revenue_plan_distribution_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/coupons":{"get":{"tags":["admin_coupons"],"summary":"List Coupons","description":"List all coupons (including soft-deleted ones) with uses count and revenue impact.\n\nRequires VIEWER or SUPER_ADMIN role.","operationId":"list_coupons_admin_coupons_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CouponResponseSchema"},"type":"array","title":"Response List Coupons Admin Coupons Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin_coupons"],"summary":"Create Coupon","description":"Create a new coupon.\n\nRequires SUPER_ADMIN role. Writes to AuditLog.","operationId":"create_coupon_admin_coupons_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponCreateSchema"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/coupons/{id}":{"patch":{"tags":["admin_coupons"],"summary":"Update Coupon","description":"Update valid_until or max_uses parameters on a coupon.\n\nRequires SUPER_ADMIN role. Writes to AuditLog.","operationId":"update_coupon_admin_coupons__id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponUpdateSchema"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin_coupons"],"summary":"Delete Coupon","description":"Soft delete a coupon.\n\nRequires SUPER_ADMIN role. Writes to AuditLog.","operationId":"delete_coupon_admin_coupons__id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/alerts/configs":{"get":{"tags":["admin_alerts"],"summary":"List Alert Configs","description":"List all alert configurations.\nRequires VIEWER or SUPER_ADMIN role.","operationId":"list_alert_configs_admin_alerts_configs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AlertConfigResponseSchema"},"type":"array","title":"Response List Alert Configs Admin Alerts Configs Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/alerts/configs/{id}":{"patch":{"tags":["admin_alerts"],"summary":"Update Alert Config","description":"Update a specific alert configuration.\nRequires SUPER_ADMIN role. Writes to AuditLog.","operationId":"update_alert_config_admin_alerts_configs__id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertConfigUpdateSchema"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertConfigResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/alerts/events":{"get":{"tags":["admin_alerts"],"summary":"List Alert Events","description":"Get paginated and filterable list of triggered alert events.\nRequires VIEWER or SUPER_ADMIN role.","operationId":"list_alert_events_admin_alerts_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/email/segments":{"get":{"tags":["admin_email"],"summary":"List Segments","description":"List the recipient segments available for a SEGMENT send, with a live\n(opt-out-excluded) recipient count so the compose UI can show an\naccurate number before an admin commits to sending.","operationId":"list_segments_admin_email_segments_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SegmentInfoSchema"},"type":"array","title":"Response List Segments Admin Email Segments Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/email/templates":{"get":{"tags":["admin_email"],"summary":"List Templates","operationId":"list_templates_admin_email_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EmailTemplateResponseSchema"},"type":"array","title":"Response List Templates Admin Email Templates Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin_email"],"summary":"Create Template","operationId":"create_template_admin_email_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateCreateSchema"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/email/templates/{id}":{"get":{"tags":["admin_email"],"summary":"Get Template","operationId":"get_template_admin_email_templates__id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin_email"],"summary":"Update Template","operationId":"update_template_admin_email_templates__id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateUpdateSchema"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin_email"],"summary":"Delete Template","operationId":"delete_template_admin_email_templates__id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/email/test-send":{"post":{"tags":["admin_email"],"summary":"Test Send","description":"Send the given (or templated) email to the requesting admin's own address only.","operationId":"test_send_admin_email_test_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendSchema"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/email/send":{"post":{"tags":["admin_email"],"summary":"Create Send","operationId":"create_send_admin_email_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSendCreateSchema"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminEmailSendResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/email/sends":{"get":{"tags":["admin_email"],"summary":"List Sends","operationId":"list_sends_admin_email_sends_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminEmailSendResponseSchema"},"title":"Response List Sends Admin Email Sends Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/email/sends/{id}":{"get":{"tags":["admin_email"],"summary":"Get Send","operationId":"get_send_admin_email_sends__id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminEmailSendDetailSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/email/sends/{id}/retry-failed":{"post":{"tags":["admin_email"],"summary":"Retry Failed","operationId":"retry_failed_admin_email_sends__id__retry_failed_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminEmailSendResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/feedback/summary":{"get":{"tags":["admin_feedback"],"summary":"Feedback Summary","description":"Aggregate ratings and the most common problems across all feedback.","operationId":"feedback_summary_admin_feedback_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackSummary"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/feedback":{"get":{"tags":["admin_feedback"],"summary":"List Feedback","description":"Newest-first feedback, optionally filtered by rating, issue or comment.","operationId":"list_feedback_admin_feedback_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"rating","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":1},{"type":"null"}],"title":"Rating"}},{"name":"issue","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue"}},{"name":"has_comment","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Has Comment"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/email/unsubscribe":{"post":{"tags":["email_public"],"summary":"Unsubscribe","description":"Public endpoint linked from admin broadcast/segment email footers.\n\nVerifies the HMAC token (see app/core/unsubscribe.py) rather than\nrequiring login, since the person clicking it isn't necessarily signed\ninto a CloakAI account.","operationId":"unsubscribe_email_unsubscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companion/sessions":{"post":{"tags":["companion"],"summary":"Start Session","description":"Start an interview's phone link. Ends any earlier one (one interview at a time).","operationId":"start_session_api_companion_sessions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/companion/sessions/end":{"post":{"tags":["companion"],"summary":"End Session","description":"End the interview's phone link: the QR code and the phone's token stop working.","operationId":"end_session_api_companion_sessions_end_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndSessionRequest"}}},"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/companion/claim":{"post":{"tags":["companion"],"summary":"Claim Session","description":"Trade the interview's QR code for a companion token.\n\nWorks for the whole interview, so a phone can always get back in — but\nonly while no other phone is connected, and a successful scan locks out\nwhichever phone held the previous token.","operationId":"claim_session_api_companion_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Root","description":"Root endpoint.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AdminEmailRecipientResponseSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"status":{"$ref":"#/components/schemas/AdminEmailRecipientStatus"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["id","email","status","error_message","sent_at"],"title":"AdminEmailRecipientResponseSchema"},"AdminEmailRecipientStatus":{"type":"string","enum":["PENDING","SENT","FAILED"],"title":"AdminEmailRecipientStatus"},"AdminEmailRecipientType":{"type":"string","enum":["SINGLE","SEGMENT","ALL"],"title":"AdminEmailRecipientType"},"AdminEmailSendDetailSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"template_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"},"subject":{"type":"string","title":"Subject"},"recipient_type":{"$ref":"#/components/schemas/AdminEmailRecipientType"},"recipient_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recipient Filter"},"status":{"$ref":"#/components/schemas/AdminEmailSendStatus"},"total_recipients":{"type":"integer","title":"Total Recipients"},"sent_count":{"type":"integer","title":"Sent Count"},"failed_count":{"type":"integer","title":"Failed Count"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"recipients":{"items":{"$ref":"#/components/schemas/AdminEmailRecipientResponseSchema"},"type":"array","title":"Recipients"}},"type":"object","required":["id","template_id","subject","recipient_type","recipient_filter","status","total_recipients","sent_count","failed_count","created_by","created_at","completed_at","recipients"],"title":"AdminEmailSendDetailSchema"},"AdminEmailSendResponseSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"template_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"},"subject":{"type":"string","title":"Subject"},"recipient_type":{"$ref":"#/components/schemas/AdminEmailRecipientType"},"recipient_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recipient Filter"},"status":{"$ref":"#/components/schemas/AdminEmailSendStatus"},"total_recipients":{"type":"integer","title":"Total Recipients"},"sent_count":{"type":"integer","title":"Sent Count"},"failed_count":{"type":"integer","title":"Failed Count"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","template_id","subject","recipient_type","recipient_filter","status","total_recipients","sent_count","failed_count","created_by","created_at","completed_at"],"title":"AdminEmailSendResponseSchema"},"AdminEmailSendStatus":{"type":"string","enum":["PENDING","SENDING","COMPLETED","FAILED"],"title":"AdminEmailSendStatus"},"AdminLoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"AdminLoginRequest","description":"POST /admin/auth/login body."},"AdminLoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"requires_mfa":{"type":"boolean","title":"Requires Mfa"}},"type":"object","required":["access_token","refresh_token","requires_mfa"],"title":"AdminLoginResponse","description":"Successful login response."},"AdminLogoutRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"AdminLogoutRequest","description":"POST /admin/auth/logout body."},"AdminMFASetupResponse":{"properties":{"secret":{"type":"string","title":"Secret"},"qr_uri":{"type":"string","title":"Qr Uri"}},"type":"object","required":["secret","qr_uri"],"title":"AdminMFASetupResponse","description":"Response from /admin/auth/setup-mfa."},"AdminMFAVerifyRequest":{"properties":{"totp_code":{"type":"string","title":"Totp Code"},"remember_device":{"type":"boolean","title":"Remember Device","default":false}},"type":"object","required":["totp_code"],"title":"AdminMFAVerifyRequest","description":"POST /admin/auth/verify-mfa body."},"AdminMFAVerifyResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"mfa_device_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mfa Device Token"}},"type":"object","required":["access_token"],"title":"AdminMFAVerifyResponse","description":"Successful MFA verification — returns upgraded JWT."},"AdminMeResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"mfa_verified":{"type":"boolean","title":"Mfa Verified"},"mfa_enabled":{"type":"boolean","title":"Mfa Enabled"},"notify_user_registration":{"type":"boolean","title":"Notify User Registration"},"notify_payment_started":{"type":"boolean","title":"Notify Payment Started"},"notify_payment_completed":{"type":"boolean","title":"Notify Payment Completed"},"notify_payment_failed":{"type":"boolean","title":"Notify Payment Failed"}},"type":"object","required":["id","email","role","mfa_verified","mfa_enabled","notify_user_registration","notify_payment_started","notify_payment_completed","notify_payment_failed"],"title":"AdminMeResponse","description":"Response from GET /admin/auth/me containing token claims info."},"AdminRefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"AdminRefreshRequest","description":"POST /admin/auth/refresh body."},"AdminRefreshResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"AdminRefreshResponse","description":"Successful token refresh response."},"AdminSettingsUpdateRequest":{"properties":{"notify_user_registration":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify User Registration"},"notify_payment_started":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify Payment Started"},"notify_payment_completed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify Payment Completed"},"notify_payment_failed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify Payment Failed"}},"type":"object","title":"AdminSettingsUpdateRequest","description":"PUT /admin/auth/settings request body."},"AlertConfigResponseSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"alert_type":{"type":"string","title":"Alert Type"},"threshold_value":{"type":"number","title":"Threshold Value"},"window_minutes":{"type":"integer","title":"Window Minutes"},"is_active":{"type":"boolean","title":"Is Active"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["id","alert_type","threshold_value","window_minutes","is_active","updated_at","updated_by"],"title":"AlertConfigResponseSchema"},"AlertConfigUpdateSchema":{"properties":{"threshold_value":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Threshold Value","description":"New threshold value"},"window_minutes":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Window Minutes","description":"New window minutes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Set active status"}},"type":"object","title":"AlertConfigUpdateSchema"},"Body_analyze_image_api_vision_analyze_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_analyze_image_api_vision_analyze_post"},"Body_login_for_access_token_api_auth_login_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_for_access_token_api_auth_login_post"},"Body_transcribe_audio_api_audio_transcribe_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_transcribe_audio_api_audio_transcribe_post"},"Body_upload_resume_api_profiles__profile_id__resume_put":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_resume_api_profiles__profile_id__resume_put"},"Body_upload_resume_api_resumes_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_resume_api_resumes_upload_post"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ChatRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"temperature":{"type":"number","title":"Temperature","default":0.45},"max_tokens":{"type":"integer","title":"Max Tokens","default":1024},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"stream":{"type":"boolean","title":"Stream","default":true},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"},"input_kind":{"type":"string","enum":["text","transcript","screen"],"title":"Input Kind","default":"text"}},"type":"object","required":["messages"],"title":"ChatRequest"},"ClaimRequest":{"properties":{"code":{"type":"string","maxLength":64,"minLength":1,"title":"Code"}},"type":"object","required":["code"],"title":"ClaimRequest"},"ClaimResponse":{"properties":{"token":{"type":"string","title":"Token"},"session_id":{"type":"string","format":"uuid","title":"Session Id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["token","session_id","expires_at"],"title":"ClaimResponse"},"CouponCreateSchema":{"properties":{"code":{"type":"string","maxLength":50,"minLength":1,"title":"Code","description":"Unique coupon code"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountType","description":"PERCENT or FIXED"},"discount_value":{"type":"number","exclusiveMinimum":0.0,"title":"Discount Value","description":"Percentage or fixed discount value"},"max_uses":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Uses","description":"Maximum allowed uses"},"valid_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid From","description":"Coupon valid start date"},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid Until","description":"Coupon valid end date"}},"type":"object","required":["code","discount_type","discount_value"],"title":"CouponCreateSchema"},"CouponDiscountType":{"type":"string","enum":["PERCENT","FIXED"],"title":"CouponDiscountType"},"CouponResponseSchema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"code":{"type":"string","title":"Code"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountType"},"discount_value":{"type":"number","title":"Discount Value"},"max_uses":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Uses"},"uses_count":{"type":"integer","title":"Uses Count"},"valid_from":{"type":"string","format":"date-time","title":"Valid From"},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid Until"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_deleted":{"type":"boolean","title":"Is Deleted"},"revenue_impact":{"type":"number","title":"Revenue Impact"}},"type":"object","required":["id","code","discount_type","discount_value","max_uses","uses_count","valid_from","valid_until","created_by","created_at","is_deleted","revenue_impact"],"title":"CouponResponseSchema"},"CouponUpdateSchema":{"properties":{"max_uses":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Uses","description":"Update maximum allowed uses"},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid Until","description":"Update coupon expiration date"}},"type":"object","title":"CouponUpdateSchema"},"CreditAdjustRequest":{"properties":{"delta":{"type":"integer","title":"Delta"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["delta","reason"],"title":"CreditAdjustRequest"},"EmailSendCreateSchema":{"properties":{"template_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"},"subject":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Subject"},"html_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Html Content"},"recipient_type":{"$ref":"#/components/schemas/AdminEmailRecipientType"},"recipient_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Recipient Email"},"recipient_segment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Segment"}},"type":"object","required":["recipient_type"],"title":"EmailSendCreateSchema"},"EmailTemplateCreateSchema":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject"},"html_content":{"type":"string","minLength":1,"title":"Html Content"},"mjml_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mjml Source"}},"type":"object","required":["name","subject","html_content"],"title":"EmailTemplateCreateSchema"},"EmailTemplateResponseSchema":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"subject":{"type":"string","title":"Subject"},"html_content":{"type":"string","title":"Html Content"},"mjml_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mjml Source"},"is_system_default":{"type":"boolean","title":"Is System Default"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","subject","html_content","mjml_source","is_system_default","updated_by","created_at","updated_at"],"title":"EmailTemplateResponseSchema"},"EmailTemplateUpdateSchema":{"properties":{"subject":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Subject"},"html_content":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Html Content"},"mjml_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mjml Source"}},"type":"object","title":"EmailTemplateUpdateSchema"},"EndSessionRequest":{"properties":{"session_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"EndSessionRequest"},"FeedbackItem":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"rating":{"type":"integer","title":"Rating"},"answer_rating":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Answer Rating"},"issues":{"items":{"type":"string"},"type":"array","title":"Issues"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"session_duration_sec":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Duration Sec"},"ai_answer_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ai Answer Count"},"app_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","user_email","rating","answer_rating","issues","comment","session_duration_sec","ai_answer_count","app_version","created_at"],"title":"FeedbackItem"},"FeedbackListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FeedbackItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"FeedbackListResponse"},"FeedbackSummary":{"properties":{"total":{"type":"integer","title":"Total"},"avg_rating":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Rating"},"avg_answer_rating":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Answer Rating"},"rating_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Rating Distribution"},"issue_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Issue Counts"}},"type":"object","required":["total","avg_rating","avg_answer_rating","rating_distribution","issue_counts"],"title":"FeedbackSummary"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeartbeatRequest":{"properties":{"session_id":{"type":"string","format":"uuid","title":"Session Id"}},"type":"object","required":["session_id"],"title":"HeartbeatRequest"},"ProfileCreate":{"properties":{"role_name":{"type":"string","maxLength":200,"title":"Role Name"},"company_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company Name"},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"topic":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Topic"},"resume_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Text"},"job_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Description"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"interview_language":{"type":"string","maxLength":50,"title":"Interview Language","default":"English"},"resume_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resume Id"}},"type":"object","required":["role_name"],"title":"ProfileCreate"},"ProfileResponse":{"properties":{"role_name":{"type":"string","maxLength":200,"title":"Role Name"},"company_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company Name"},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"topic":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Topic"},"resume_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Text"},"job_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Description"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"interview_language":{"type":"string","maxLength":50,"title":"Interview Language","default":"English"},"resume_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resume Id"},"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"}},"type":"object","required":["role_name","id","user_id"],"title":"ProfileResponse"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"ResumeBase":{"properties":{"filename":{"type":"string","maxLength":255,"title":"Filename"},"content_text":{"type":"string","title":"Content Text"}},"type":"object","required":["filename","content_text"],"title":"ResumeBase"},"ResumeResponse":{"properties":{"filename":{"type":"string","maxLength":255,"title":"Filename"},"content_text":{"type":"string","title":"Content Text"},"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["filename","content_text","id","user_id","created_at"],"title":"ResumeResponse"},"SegmentInfoSchema":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"recipient_count":{"type":"integer","title":"Recipient Count"}},"type":"object","required":["key","label","recipient_count"],"title":"SegmentInfoSchema"},"SessionFeedbackCreate":{"properties":{"rating":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Rating"},"answer_rating":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Answer Rating"},"issues":{"items":{"type":"string"},"type":"array","maxItems":9,"title":"Issues"},"comment":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Comment"},"session_duration_sec":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Session Duration Sec"},"ai_answer_count":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Ai Answer Count"},"app_version":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"App Version"}},"type":"object","required":["rating"],"title":"SessionFeedbackCreate"},"SessionFeedbackResponse":{"properties":{"id":{"type":"integer","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","created_at"],"title":"SessionFeedbackResponse"},"SessionHistoryCreate":{"properties":{"question_text":{"type":"string","title":"Question Text"},"answer_text":{"type":"string","title":"Answer Text"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"}},"type":"object","required":["question_text","answer_text"],"title":"SessionHistoryCreate"},"SessionHistoryPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SessionHistoryResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"SessionHistoryPage"},"SessionHistoryResponse":{"properties":{"question_text":{"type":"string","title":"Question Text"},"answer_text":{"type":"string","title":"Answer Text"},"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"show_in_history":{"type":"boolean","title":"Show In History","default":false}},"type":"object","required":["question_text","answer_text","id","user_id","created_at"],"title":"SessionHistoryResponse"},"SessionHistoryVisibility":{"properties":{"show_in_history":{"type":"boolean","title":"Show In History"}},"type":"object","required":["show_in_history"],"title":"SessionHistoryVisibility"},"SessionResponse":{"properties":{"session_id":{"type":"string","format":"uuid","title":"Session Id"},"pair_url":{"type":"string","title":"Pair Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["session_id","pair_url","expires_at"],"title":"SessionResponse"},"SessionStartResponse":{"properties":{"session_id":{"type":"string","format":"uuid","title":"Session Id"}},"type":"object","required":["session_id"],"title":"SessionStartResponse"},"StatusUpdateRequest":{"properties":{"action":{"type":"string","title":"Action"}},"type":"object","required":["action"],"title":"StatusUpdateRequest"},"TestSendSchema":{"properties":{"template_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"},"subject":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Subject"},"html_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Html Content"}},"type":"object","title":"TestSendSchema"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token"},"UnsubscribeRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"token":{"type":"string","title":"Token"}},"type":"object","required":["email","token"],"title":"UnsubscribeRequest"},"UserCreate":{"properties":{"email":{"type":"string","maxLength":255,"format":"email","title":"Email"},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"surname":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Surname"},"app_language":{"type":"string","maxLength":50,"title":"App Language","default":"English"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserCreate"},"UserResponse":{"properties":{"email":{"type":"string","maxLength":255,"format":"email","title":"Email"},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"surname":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Surname"},"app_language":{"type":"string","maxLength":50,"title":"App Language","default":"English"},"id":{"type":"integer","title":"Id"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"credits":{"type":"integer","title":"Credits"},"plan_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Type"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"is_email_verified":{"type":"boolean","title":"Is Email Verified"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_internal":{"type":"boolean","title":"Is Internal","default":false},"resume_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Text"},"show_session_history":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Show Session History"}},"type":"object","required":["email","id","subscription_tier","credits","is_email_verified","created_at"],"title":"UserResponse"},"UserUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"surname":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Surname"},"app_language":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"App Language"},"resume_text":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Resume Text"},"show_session_history":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Show Session History"}},"type":"object","title":"UserUpdate"},"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"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/login"}}},"HTTPBearer":{"type":"http","scheme":"bearer"}}}}