{"openapi":"3.1.0","info":{"title":"TRAID API","description":"AI-powered financial prediction platform API","version":"0.1.0"},"paths":{"/api/v1/health/":{"get":{"tags":["health"],"summary":"Health Check","description":"Health check endpoint - tests all service connections\n\nReturns:\n    HealthResponse with status of database, Redis, and Binance API","operationId":"health_check_api_v1_health__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_v1_auth_login_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Get Profile","operationId":"get_profile_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/accept-terms":{"post":{"tags":["auth"],"summary":"Accept Terms","description":"Store users.terms_accepted_at for the current user, once.\n\nOne UPDATE whose WHERE clause also requires terms_accepted_at IS NULL, so\ntwo concurrent requests cannot overwrite each other and a stored value is\nnever changed. updated_at is set to itself so its onupdate does not fire.\nCommitted here, so a 200 means the value is stored. The response carries\nthe stored value, read back with a SELECT. The UPDATE is\nuser_repository.accept_terms_once, which the mobile provider sign-in also\nuses (MAPI-R5B).","operationId":"accept_terms_api_v1_auth_accept_terms_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptTermsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptTermsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh Token","operationId":"refresh_token_api_v1_auth_refresh_post","parameters":[{"name":"refresh_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Refresh Token Api V1 Auth Refresh Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_v1_auth_logout_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"refresh_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","operationId":"forgot_password_api_v1_auth_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/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","operationId":"reset_password_api_v1_auth_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/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","operationId":"change_password_api_v1_auth_change_password_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"refresh_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify-email":{"get":{"tags":["auth"],"summary":"Verify Email","operationId":"verify_email_api_v1_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":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","operationId":"resend_verification_api_v1_auth_resend_verification_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResendVerificationRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/request-verification":{"post":{"tags":["auth"],"summary":"Request Verification","description":"Send verification email by email address. No auth required.\n\nAlways returns 200 regardless of whether the email exists or is already verified.\nRate-limited to 3/60s per IP via auth_email_send tier.","operationId":"request_verification_api_v1_auth_request_verification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/delete-account":{"post":{"tags":["auth"],"summary":"Delete Account","operationId":"delete_account_api_v1_auth_delete_account_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/delete-account/request-link":{"post":{"tags":["auth"],"summary":"Request Delete Account Link","description":"E-mail the one-time deletion link (logic in auth_service.request_account_delete_link).","operationId":"request_delete_account_link_api_v1_auth_delete_account_request_link_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AccountDeleteLinkRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeleteLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/delete-account/confirm":{"post":{"tags":["auth"],"summary":"Confirm Delete Account","description":"Delete the account the link names (logic in auth_service.confirm_account_delete).","operationId":"confirm_delete_account_api_v1_auth_delete_account_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeleteConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/recover-account/request-link":{"post":{"tags":["auth"],"summary":"Request Recover Account Link","description":"Always 202 with the same body: whether a link was issued (logic in\nauth_service.request_account_recovery_link) is never told. The e-mail goes out after the answer.","operationId":"request_recover_account_link_api_v1_auth_recover_account_request_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRecoveryLinkRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/recover-account/confirm":{"post":{"tags":["auth"],"summary":"Confirm Recover Account","description":"Reopen the account the link names (logic in auth_service.confirm_account_recovery).","operationId":"confirm_recover_account_api_v1_auth_recover_account_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRecoveryConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/profile":{"patch":{"tags":["auth"],"summary":"Update Profile","description":"Update current user's profile (full_name).","operationId":"update_profile_api_v1_auth_profile_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendedProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/profile/stats":{"get":{"tags":["auth"],"summary":"Get Profile Stats","description":"Get usage statistics for current user.","operationId":"get_profile_stats_api_v1_auth_profile_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileStatsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/profile/preferences":{"patch":{"tags":["auth"],"summary":"Update Preferences","description":"Update current user's notification preference.","operationId":"update_preferences_api_v1_auth_profile_preferences_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePreferencesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/registration-status":{"get":{"tags":["auth"],"summary":"Public Registration Status","description":"Check if user registration is currently enabled. Public endpoint.","operationId":"public_registration_status_api_v1_auth_registration_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/google/url":{"get":{"tags":["auth-google"],"summary":"Google Oauth Url","description":"Generate Google OAuth consent URL with CSRF state parameter.","operationId":"google_oauth_url_api_v1_auth_google_url_get","parameters":[{"name":"analytics_rejected","in":"query","required":false,"schema":{"type":"string","title":"Analytics Rejected"}},{"name":"via","in":"query","required":false,"schema":{"type":"string","title":"Via"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/callback":{"get":{"tags":["auth-google"],"summary":"Google Oauth Callback","description":"Handle Google OAuth callback: verify state, exchange code, find-or-create user, issue tokens.","operationId":"google_oauth_callback_api_v1_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","title":"State"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/coins/":{"get":{"tags":["coins"],"summary":"Get Coins","description":"Get list of all available coins with live prices from Redis.\n\nPrices are sourced from live_service Redis keys (live:indicators:{SYMBOL}),\nupdated every minute. No Binance call is made. If Redis is unavailable or\na coin's data is missing / stale (>10 min old), price fields return None.\n\nArgs:\n    tier: Optional tier filter.\n    db:   Database session.\n    redis: Redis client (injected).\n\nReturns:\n    List of coins with current_price, price_change_24h from Redis.\n    volume_24h is always None (not stored in Redis; not rendered by ticker).","operationId":"get_coins_api_v1_coins__get","parameters":[{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by subscription tier (free, basic, pro, enterprise)","title":"Tier"},"description":"Filter by subscription tier (free, basic, pro, enterprise)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CoinWithPrice"},"title":"Response Get Coins Api V1 Coins  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/coins/{symbol}":{"get":{"tags":["coins"],"summary":"Get Coin","description":"Get specific coin by symbol with live price from Redis.\n\nSources current_price and price_change_24h from the same\nlive:indicators Redis key used by GET /coins/.\n\nNOTE: volume_24h is now None. Previously this endpoint returned\nvolume_24h from Binance's 24hr ticker; that Binance call has been\nremoved along with the bulk call in GET /. volume_24h was not\nconsumed by any frontend component at the time of this change.\n\nArgs:\n    symbol: Coin symbol (e.g., BTC).\n    db:     Database session.\n    redis:  Redis client (injected).\n\nReturns:\n    Coin with current_price and price_change_24h from Redis.\n\nRaises:\n    HTTPException 404: If coin not found in database.","operationId":"get_coin_api_v1_coins__symbol__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoinWithPrice"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/coins/{symbol}/chart":{"get":{"tags":["coins"],"summary":"Get Chart Data","description":"Get real OHLCV chart data for a coin.\n\nReads from Redis key ``live:chart:{SYMBOL}USDT:{TIMEFRAME}``\npopulated by the live_service process. Returns data in the format\nexpected by the frontend ChartPanel (timestamp, open, high, low,\nclose, volume).\n\nFalls back to 404 if the live service hasn't written data for this\ncoin/timeframe yet.","operationId":"get_chart_data_api_v1_coins__symbol__chart_get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"timeframe","in":"query","required":true,"schema":{"type":"string","description":"Timeframe: 1m, 5m, 15m, 30m, 1h, 2h, 3h, 4h, 6h, 12h, 1d","title":"Timeframe"},"description":"Timeframe: 1m, 5m, 15m, 30m, 1h, 2h, 3h, 4h, 6h, 12h, 1d"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/binance/test":{"get":{"tags":["binance"],"summary":"Test Binance Connection","description":"Test Binance API connectivity and fetch sample data\n\nReturns:\n    BinanceTestResponse with connection status and sample BTCUSDT data\n    \nRaises:\n    HTTPException: 503 if Binance API is unreachable","operationId":"test_binance_connection_api_v1_binance_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BinanceTestResponse"}}}}}}},"/api/v1/predictions/predict":{"post":{"tags":["predictions"],"summary":"Predict","description":"Get statistical analysis for a position\n\nPhase 1: Returns random score (demo mode)\nPhase 2: Will use actual statistical model","operationId":"predict_api_v1_predictions_predict_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/discover/snapshot":{"get":{"tags":["discover-snapshot"],"summary":"Get Discover Snapshot","description":"Return the discover snapshot filtered by user tier.\n\nReads the consolidated snapshot from Redis (single GET) and\nfilters the coins dict based on the user's subscription tier.\n\n- Unauthenticated users resolve to the \"visitor\" tier (5 coins).\n- Returns 503 if the snapshot key doesn't exist in Redis.\n\nReturns:\n    JSON object with `ts` (millisecond timestamp) and `coins` dict.","operationId":"get_discover_snapshot_api_v1_discover_snapshot_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Discover Snapshot Api V1 Discover Snapshot Get"}}}}}}},"/api/v1/backtest/run":{"post":{"tags":["backtest"],"summary":"Run Backtest","description":"Start a new backtest job using the real SimulationEngine.\n\nPipeline: JWT auth → tier validation → Redis lock check → lazy credit reset\n→ token deduction → early task_id + system events → global concurrency check\n→ engine start → Redis lock acquire.","operationId":"run_backtest_api_v1_backtest_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/backtest/status/{job_id}":{"get":{"tags":["backtest"],"summary":"Get Backtest Status","description":"Get current status and statistics for a backtest job.\nFallback chain: active_jobs → completed_jobs → Redis → 404.","operationId":"get_backtest_status_api_v1_backtest_status__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/backtest/stop/{job_id}":{"post":{"tags":["backtest"],"summary":"Stop Backtest","description":"Stop a running backtest job. Only the user who started it may stop it.\n\nDeletes Redis lock but does NOT refund tokens (manual stop = consumed).\nThat refund policy is intentional and unchanged.\n\nAUTHORIZATION: this endpoint previously had no authentication and no ownership\ncheck, so anyone holding a job id could cancel another user's paid backtest and\nclear their active_backtest lock — with credits already consumed and no refund.\nOwnership is taken from job_deductions[job_id][\"user_id\"], which is recorded for\nevery job on both the in-process and worker-process paths.\n\nA non-owner gets 404 rather than 403 so the endpoint does not confirm whether\nsomeone else's job id exists.","operationId":"stop_backtest_api_v1_backtest_stop__job_id__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/backtest/active":{"get":{"tags":["backtest"],"summary":"Get Active Backtest","description":"Check if the current user has a running backtest.\nUsed by the frontend to recover jobId after page refresh or navigation.","operationId":"get_active_backtest_api_v1_backtest_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/backtest/{task_id}/events":{"get":{"tags":["backtest"],"summary":"Get Backtest Events","description":"Poll trade/system events for a backtest. Returns events from index `after` onward.","operationId":"get_backtest_events_api_v1_backtest__task_id__events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"After"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/backtest/{job_id}/running-stats":{"get":{"tags":["backtest"],"summary":"Get Backtest Running Stats","description":"Return the latest running_stats snapshot for a backtest, read from Redis.","operationId":"get_backtest_running_stats_api_v1_backtest__job_id__running_stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/backtest/tier-config":{"get":{"tags":["backtest"],"summary":"Get Tier Config","description":"Return current user's tier constraints for frontend.","operationId":"get_tier_config_api_v1_backtest_tier_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/backtest/indicators":{"get":{"tags":["backtest"],"summary":"Get Indicators","description":"Get list of all available indicators for the strategy builder.\n\nDerived directly from indicator_mapping.py INDICATOR_MAP (142 indicators).\nNo DB query needed. Response shape is backward-compatible with the\nprevious DB-backed implementation.","operationId":"get_indicators_api_v1_backtest_indicators_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/IndicatorResponse"},"type":"array","title":"Response Get Indicators Api V1 Backtest Indicators Get"}}}}}}},"/api/v1/backtest/strategies/save":{"post":{"tags":["backtest"],"summary":"Save Strategy","description":"Save a strategy configuration with optional results. Requires authentication.","operationId":"save_strategy_api_v1_backtest_strategies_save_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrategySaveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrategyDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/backtest/strategies":{"get":{"tags":["backtest"],"summary":"List Strategies","description":"List saved strategies for the current user.","operationId":"list_strategies_api_v1_backtest_strategies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/StrategyListItem"},"type":"array","title":"Response List Strategies Api V1 Backtest Strategies Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/backtest/strategies/{strategy_id}":{"get":{"tags":["backtest"],"summary":"Get Strategy","description":"Get full strategy details. Only returns strategies owned by the current user.","operationId":"get_strategy_api_v1_backtest_strategies__strategy_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"strategy_id","in":"path","required":true,"schema":{"type":"integer","title":"Strategy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrategyDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["backtest"],"summary":"Delete Strategy","description":"Delete a saved strategy. Only allows deleting strategies owned by the current user.","operationId":"delete_strategy_api_v1_backtest_strategies__strategy_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"strategy_id","in":"path","required":true,"schema":{"type":"integer","title":"Strategy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/indicators/live/{coin_symbol}":{"get":{"tags":["live-indicators"],"summary":"Get Live Indicators","description":"Get live indicator data for a coin.\n\nReads from Redis key ``live:indicators:{COIN_SYMBOL}`` which is\npopulated by the standalone Live Indicator Service every minute.\n\nReturns JSON with all 10 JSONB indicator groups, last price,\nand calculation timestamp.\n\nArgs:\n    coin_symbol: Trading pair symbol (e.g. BTCUSDT).\n\nReturns:\n    JSON object with keys: last, timestamp, and all 10 indicator\n    groups — see INDICATOR_MAP in app.core.indicator_mapping.\n\nRaises:\n    HTTPException 404: If coin is not tracked or data has expired.\n    HTTPException 503: If Redis is unavailable.","operationId":"get_live_indicators_api_v1_indicators_live__coin_symbol__get","parameters":[{"name":"coin_symbol","in":"path","required":true,"schema":{"type":"string","title":"Coin Symbol"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chart/{symbol}/{timeframe}":{"get":{"tags":["chart"],"summary":"Get Chart","description":"Get real OHLCV chart data for a coin from Redis.\n\nReads pre-aggregated candle data written by the live_service process.\nEach candle has: t (timestamp ms), o (open), h (high), l (low),\nc (close), v (volume).\n\nArgs:\n    symbol: Coin symbol (e.g. \"BTC\", \"ETH\").\n    timeframe: Chart timeframe (1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d).\n\nReturns:\n    JSON with symbol, timeframe, candles array, and count.","operationId":"get_chart_api_v1_chart__symbol___timeframe__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"timeframe","in":"path","required":true,"schema":{"type":"string","title":"Timeframe"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chart/{symbol}/{timeframe}/indicators":{"get":{"tags":["chart"],"summary":"Get Chart Indicators","description":"Get indicator overlay data calculated on-the-fly from chart OHLCV.\n\nReads chart candles from Redis, extracts close prices, and computes\nrequested indicators. Formulas match live_service/indicator_engine.py.\n\nArgs:\n    symbol: Coin symbol (e.g. \"BTC\", \"ETH\").\n    timeframe: Chart timeframe (1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d).\n    types: Comma-separated indicator types (boll, rsi, macd).\n\nReturns:\n    JSON with symbol, timeframe, indicators dict, timestamps, and count.","operationId":"get_chart_indicators_api_v1_chart__symbol___timeframe__indicators_get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"timeframe","in":"path","required":true,"schema":{"type":"string","title":"Timeframe"}},{"name":"types","in":"query","required":false,"schema":{"type":"string","default":"","title":"Types"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chart/{symbol}/{timeframe}/history":{"get":{"tags":["chart"],"summary":"Get Chart History","description":"Older closed candles, for scrolling the chart back.\n\nReads only the candle store (chart_candles), never Redis or Binance: up to\nHISTORY_CHUNK closed candles with open time < `before` (ms, the open time\nof the oldest candle the client has), ascending, in the candle shape of\nGET /{symbol}/{timeframe}, with their BOLL, RSI and MACD values and the\nvalues of the first HISTORY_OVERLAP candles at or after `before`. An empty\nlist means the store holds nothing older.\n\nInvalid timeframe: 400 and unknown symbol: 404, with the same details as\nGET /{symbol}/{timeframe}. Store unavailable: 503.","operationId":"get_chart_history_api_v1_chart__symbol___timeframe__history_get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"timeframe","in":"path","required":true,"schema":{"type":"string","title":"Timeframe"}},{"name":"before","in":"query","required":true,"schema":{"type":"integer","maximum":253402300799999,"minimum":0,"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chart/{symbol}/{timeframe}/patterns":{"get":{"tags":["chart"],"summary":"Get Chart Patterns","description":"The pattern drawings of the chart, as the pattern service stored them.\n\nReads patterns:meta and patterns:{SYMBOL}:{STORE_TF} from Redis and computes\nnothing (app/services/chart_patterns.py has the answers). Invalid timeframe:\n400 and unknown symbol: 404, with the same details as GET /{symbol}/{timeframe}\nand /history; Redis unavailable: 503. Every answer carries\nCache-Control: private, no-store.","operationId":"get_chart_patterns_api_v1_chart__symbol___timeframe__patterns_get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"timeframe","in":"path","required":true,"schema":{"type":"string","title":"Timeframe"}}],"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}/role":{"put":{"tags":["admin"],"summary":"Update User Role","operationId":"update_user_role_api_v1_admin_users__user_id__role_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/cleanup-unverified-users":{"post":{"tags":["admin"],"summary":"Cleanup Unverified Users","description":"Deletes nothing (E50-P2B): 409 \"cleanup_replaced_by_nightly_job\". The nightly job\n(scripts/purge_deleted_accounts.py, account_purge_service's unverified step) does this work, for\naccounts that never had a verified address or a session only; this endpoint deleted every\nunverified account older than 7 days.","operationId":"cleanup_unverified_users_api_v1_admin_cleanup_unverified_users_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/cleanup-deleted-users":{"post":{"tags":["admin"],"summary":"Cleanup Deleted Users","description":"Deletes nothing (AUTH-H2; E50-P2B): 409 \"cleanup_replaced_by_nightly_job\".\n\nA ban writes the same deleted_at as a self-delete, so a cleanup by deleted_at age would also\nerase banned accounts, and a user's data is deleted only at that user's own request. The\nnightly job (scripts/purge_deleted_accounts.py) purges accounts by their self-delete's deletion\nrecord instead; nothing calls user_repository.delete_soft_deleted_users_older_than.","operationId":"cleanup_deleted_users_api_v1_admin_cleanup_deleted_users_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/reset-backtest-counter":{"post":{"tags":["admin"],"summary":"Reset Backtest Counter","description":"Reset the global active backtest counter to 0.\nUsed for crash recovery when the counter becomes permanently inflated.","operationId":"reset_backtest_counter_api_v1_admin_reset_backtest_counter_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/backtest-pool":{"get":{"tags":["admin"],"summary":"Get Backtest Pool Health","description":"Full worker-pool diagnostics: generation, break/rebuild counters, remaining\nrebuild budget, POSIX semaphore count vs. the count at pool creation, and\nwhether the host has logind's RemoveIPC disabled.\n\nAdmin-only because it exposes process internals (fd and thread counts). The\npublic /health endpoint carries a coarse version of the same signal.\n\nRead this when a user reports \"Backtest failed\" but the site looks fine:\n  - status \"broken\"   → the pool is dead and the rebuild budget is spent\n  - semaphores_lost   → something deleted the pool's semaphores under a live\n                        process; check ipc_guard and fix RemoveIPC\n  - rebuilds climbing → it is self-healing, but the root cause is still there","operationId":"get_backtest_pool_health_api_v1_admin_backtest_pool_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/dashboard-stats":{"get":{"tags":["admin"],"summary":"Get Dashboard Stats","description":"Dashboard metrics: user stats + system health.","operationId":"get_dashboard_stats_api_v1_admin_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStatsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/users":{"get":{"tags":["admin"],"summary":"List Users","description":"Paginated user list with search, filter, and sort.","operationId":"list_users_api_v1_admin_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Page Size"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}":{"get":{"tags":["admin"],"summary":"Get User Detail","description":"Full user detail with saved strategies count.","operationId":"get_user_detail_api_v1_admin_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/tier":{"patch":{"tags":["admin"],"summary":"Update User Tier","description":"Give a user a plan by hand. MAPI-RC1: an admin entitlement row (entitlement_service.set_admin_plan): the\nuser's active admin rows are revoked; a paid tier adds one admin row ending at tier_expires_at, or in 30 days\nwhen none is given; free adds none. The tier is then recomputed from all the user's rows, so the answer names the\neffective tier, which stays above the admin's choice while a store subscription (or another row) gives more.","operationId":"update_user_tier_api_v1_admin_users__user_id__tier_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTierRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/gift-credits":{"post":{"tags":["admin"],"summary":"Gift Credits Endpoint","description":"Gift tokens to a user (monthly or purchased).","operationId":"gift_credits_endpoint_api_v1_admin_users__user_id__gift_credits_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCreditsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/reset-cycle":{"post":{"tags":["admin"],"summary":"Reset Credit Cycle Endpoint","description":"Reset a user's credit cycle start to now.","operationId":"reset_credit_cycle_endpoint_api_v1_admin_users__user_id__reset_cycle_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/ban":{"post":{"tags":["admin"],"summary":"Ban User Endpoint","description":"Ban a user (set deleted_at + is_active=false) and revoke all of its refresh tokens with the\nfunction self-delete uses (AUTH-H2). Unban restores no token: the user logs in again.","operationId":"ban_user_endpoint_api_v1_admin_users__user_id__ban_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/unban":{"post":{"tags":["admin"],"summary":"Unban User Endpoint","description":"Unban a user (clear deleted_at + is_active=true). E50-P2A: an account the nightly purge has\nanonymized is not reopened: 409 \"account_purged\", nothing changed in the database or Redis.","operationId":"unban_user_endpoint_api_v1_admin_users__user_id__unban_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/registration-status":{"get":{"tags":["admin"],"summary":"Get Registration Status","description":"Check if user registration is currently enabled.","operationId":"get_registration_status_api_v1_admin_registration_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/registration-toggle":{"post":{"tags":["admin"],"summary":"Toggle Registration","description":"Enable or disable user registration. Body: {\"enabled\": true/false}","operationId":"toggle_registration_api_v1_admin_registration_toggle_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Request"}}},"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/admin/users/{user_id}/export":{"get":{"tags":["admin"],"summary":"Export User Data","description":"Export all data belonging to a user as JSON (GDPR Article 15/20).\nReturns a downloadable JSON file.","operationId":"export_user_data_api_v1_admin_users__user_id__export_get","security":[{"OAuth2PasswordBearer":[]}],"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"}}}}}}},"/api/v1/admin/users/{user_id}/permanent-delete":{"delete":{"tags":["admin"],"summary":"Permanent Delete User","description":"Permanently delete a user and ALL associated data (GDPR Article 17).\nSuperadmin only. Requires ?confirm=PERMANENTLY_DELETE safety parameter.\nThis is IRREVERSIBLE.","operationId":"permanent_delete_user_api_v1_admin_users__user_id__permanent_delete_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"confirm","in":"query","required":false,"schema":{"type":"string","default":"","title":"Confirm"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/consent":{"post":{"tags":["analytics"],"summary":"Log Consent","description":"Log cookie consent choice. Public, no auth required.","operationId":"log_consent_api_v1_analytics_consent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequest"}}},"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/analytics/anonymous-pageview":{"post":{"tags":["analytics"],"summary":"Anonymous Pageview","description":"Increment anonymous page counter. No personal data stored.","operationId":"anonymous_pageview_api_v1_analytics_anonymous_pageview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnonymousPageviewRequest"}}},"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/analytics/event":{"post":{"tags":["analytics"],"summary":"Track Event","description":"Receive a single analytics event. Always returns 200.","operationId":"track_event_api_v1_analytics_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsEventRequest"}}},"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/analytics/batch":{"post":{"tags":["analytics"],"summary":"Track Batch","description":"Receive multiple analytics events. Always returns 200.","operationId":"track_batch_api_v1_analytics_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsBatchRequest"}}},"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/analytics/hit":{"post":{"tags":["analytics"],"summary":"Record Hit","description":"Count one page view without cookies. Public. Always 204, never an error.","operationId":"record_hit_api_v1_analytics_hit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficHitRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/counts":{"post":{"tags":["analytics"],"summary":"Record Counts","description":"Add a browser's usage counts to today's totals. Public, no token read,\nno IP stored. Always 204, never an error.","operationId":"record_counts_api_v1_analytics_counts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageCountsRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/my-indicators":{"get":{"tags":["analytics"],"summary":"Get My Indicators","description":"Indicator group popularity for the current user, from their own backtest runs; empty without runs.","operationId":"get_my_indicators_api_v1_analytics_my_indicators_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndicatorPopularityResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/analytics/overview":{"get":{"tags":["admin-analytics"],"summary":"Get Overview","operationId":"get_overview_api_v1_admin_analytics_overview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"7d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/freshness":{"get":{"tags":["admin-analytics"],"summary":"Get Freshness","description":"How current the pre-aggregated summary tables are.\n\nMost figures on this dashboard are served from analytics_daily_summary, which is\nonly written by POST /admin/analytics/aggregate. With no scheduler running, that\ncan silently fall days or months behind while the raw event stream stays current.\nThe UI shows this so nobody reads stale numbers as live ones.","operationId":"get_freshness_api_v1_admin_analytics_freshness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/analytics/pages":{"get":{"tags":["admin-analytics"],"summary":"Get Pages","operationId":"get_pages_api_v1_admin_analytics_pages_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"7d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageViewsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/indicators":{"get":{"tags":["admin-analytics"],"summary":"Get Indicators","operationId":"get_indicators_api_v1_admin_analytics_indicators_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"7d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndicatorUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/coins":{"get":{"tags":["admin-analytics"],"summary":"Get Coins","operationId":"get_coins_api_v1_admin_analytics_coins_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"7d","title":"Period"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","pattern":"^(backtest|predict|all)$","default":"all","title":"Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoinUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/growth":{"get":{"tags":["admin-analytics"],"summary":"Get Growth","operationId":"get_growth_api_v1_admin_analytics_growth_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"30d","title":"Period"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","pattern":"^(daily|weekly|monthly)$","default":"daily","title":"Granularity"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/sessions":{"get":{"tags":["admin-analytics"],"summary":"Get Sessions","operationId":"get_sessions_api_v1_admin_analytics_sessions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"7d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/aggregate":{"post":{"tags":["admin-analytics"],"summary":"Trigger Aggregation","operationId":"trigger_aggregation_api_v1_admin_analytics_aggregate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/analytics/cleanup":{"post":{"tags":["admin-analytics"],"summary":"Trigger Cleanup","operationId":"trigger_cleanup_api_v1_admin_analytics_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsCleanupResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/analytics/retention":{"get":{"tags":["admin-analytics"],"summary":"Get Retention","description":"D1, D7, D30 retention rates for users registered in the period.","operationId":"get_retention_api_v1_admin_analytics_retention_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"30d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/cohorts":{"get":{"tags":["admin-analytics"],"summary":"Get Cohorts","description":"Cohort retention table grouped by ISO registration week.","operationId":"get_cohorts_api_v1_admin_analytics_cohorts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"weeks","in":"query","required":false,"schema":{"type":"integer","maximum":52,"minimum":1,"default":8,"title":"Weeks"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CohortResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/funnel":{"get":{"tags":["admin-analytics"],"summary":"Get Funnel","description":"5-step conversion funnel: Visitors → Registered → First Backtest → Repeat → Paid.","operationId":"get_funnel_api_v1_admin_analytics_funnel_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|90d|all)$","default":"30d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/tiers":{"get":{"tags":["admin-analytics"],"summary":"Get Tiers","description":"User count per subscription tier + free-to-paid conversion rate.","operationId":"get_tiers_api_v1_admin_analytics_tiers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierDistributionResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/analytics/churn":{"get":{"tags":["admin-analytics"],"summary":"Get Churn","description":"Churn rate comparing two consecutive period windows.","operationId":"get_churn_api_v1_admin_analytics_churn_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|90d)$","default":"30d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChurnResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/traffic":{"get":{"tags":["admin-analytics"],"summary":"Get Traffic","description":"Cookieless visits (traffic_hits) and new members for a range of UTC days.\n\nWithout dates: the REPORT_DEFAULT_DAYS days up to today (UTC). Read-only, not\ncached. A failure is logged as exception type names only: get_db and the\napp's error handlers would log the full text, which for a database error\nincludes the SQL.","operationId":"get_traffic_api_v1_admin_analytics_traffic_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"First UTC day, YYYY-MM-DD","title":"Start"},"description":"First UTC day, YYYY-MM-DD"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Last UTC day, YYYY-MM-DD (at most today)","title":"End"},"description":"Last UTC day, YYYY-MM-DD (at most today)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/analytics/usage":{"get":{"tags":["admin-analytics"],"summary":"Get Usage","description":"The usage counters summed over a range of UTC days, and the Analyze\npage views of that range. The range rules, the longest range and the\nstatement timeout are the traffic report's\n(app/core/traffic_report_config.py). Read-only, not cached; a failure is\nlogged as exception type names only, as for /traffic.","operationId":"get_usage_api_v1_admin_analytics_usage_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"First UTC day, YYYY-MM-DD","title":"Start"},"description":"First UTC day, YYYY-MM-DD"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Last UTC day, YYYY-MM-DD (at most today)","title":"End"},"description":"Last UTC day, YYYY-MM-DD (at most today)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contact":{"post":{"tags":["contact"],"summary":"Submit Contact","description":"Submit a contact form message. Public endpoint — no auth required.","operationId":"submit_contact_api_v1_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSubmitRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/messages":{"get":{"tags":["admin-messages"],"summary":"List Messages","description":"Paginated list of contact messages with filtering and sorting.","operationId":"list_messages_api_v1_admin_messages_get","security":[{"OAuth2PasswordBearer":[]}],"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":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(all|read|unread)$"},{"type":"null"}],"title":"Status"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","pattern":"^(created_at|name|email|subject)$","default":"created_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMessageListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/messages/export":{"get":{"tags":["admin-messages"],"summary":"Export Messages","description":"Export contact messages as CSV file.","operationId":"export_messages_api_v1_admin_messages_export_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(all|read|unread)$"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/messages/{message_id}":{"get":{"tags":["admin-messages"],"summary":"Get Message Detail","description":"Get full message detail with user info if registered.","operationId":"get_message_detail_api_v1_admin_messages__message_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMessageDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/messages/{message_id}/read":{"patch":{"tags":["admin-messages"],"summary":"Toggle Read Status","description":"Toggle read/unread status of a message.","operationId":"toggle_read_status_api_v1_admin_messages__message_id__read_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message 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/messages/{message_id}/reply":{"post":{"tags":["admin-messages"],"summary":"Reply To Message","description":"Send email reply to a contact message sender.","operationId":"reply_to_message_api_v1_admin_messages__message_id__reply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications":{"get":{"tags":["notifications"],"summary":"List Notifications","description":"Get current user's notifications, unread first, then by date desc.","operationId":"list_notifications_api_v1_notifications_get","security":[{"OAuth2PasswordBearer":[]}],"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/unread-count":{"get":{"tags":["notifications"],"summary":"Get Unread Count","description":"Get count of unread notifications for current user.","operationId":"get_unread_count_api_v1_notifications_unread_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnreadCountResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/notifications/{notification_id}/read":{"patch":{"tags":["notifications"],"summary":"Mark Notification Read","description":"Mark a specific notification as read. Must belong to current user.","operationId":"mark_notification_read_api_v1_notifications__notification_id__read_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/read-all":{"patch":{"tags":["notifications"],"summary":"Mark All Read","description":"Mark all of current user's unread notifications as read.","operationId":"mark_all_read_api_v1_notifications_read_all_patch","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/notifications/send":{"post":{"tags":["admin-notifications"],"summary":"Send Notification","description":"Send notification to a specific user, tier, or all users.","operationId":"send_notification_api_v1_admin_notifications_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendNotificationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendNotificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/notifications/broadcasts":{"get":{"tags":["admin-notifications"],"summary":"List Broadcasts","description":"Paginated broadcast history.","operationId":"list_broadcasts_api_v1_admin_notifications_broadcasts_get","security":[{"OAuth2PasswordBearer":[]}],"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/maintenance/status":{"get":{"tags":["maintenance"],"summary":"Get Maintenance Status","description":"Public endpoint — returns maintenance mode state. Fail-open on Redis error.","operationId":"get_maintenance_status_api_v1_maintenance_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/maintenance/toggle":{"post":{"tags":["admin-maintenance"],"summary":"Toggle Maintenance","description":"Admin-only — toggle maintenance mode. Stops active backtests when enabling.","operationId":"toggle_maintenance_api_v1_admin_maintenance_toggle_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/public-access/status":{"get":{"tags":["public-access"],"summary":"Get Public Access Status","description":"Public endpoint — returns public access state. Fail-OPEN on Redis error.","operationId":"get_public_access_status_api_v1_public_access_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/public-access/toggle":{"post":{"tags":["admin-public-access"],"summary":"Toggle Public Access","description":"Admin-only — toggle anonymous access to the public product pages.","operationId":"toggle_public_access_api_v1_admin_public_access_toggle_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/home/feed":{"get":{"tags":["home-feed"],"summary":"Get Home Feed","description":"Public endpoint — 200 with the stored feed, 204 if absent, 503 if Redis is down.","operationId":"get_home_feed_api_v1_home_feed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/me/usage":{"get":{"tags":["me"],"summary":"Get My Usage","description":"The member's coins (most used first, at most TOP_COINS), indicator\nfamilies and indicator codes, from their usage of the last WINDOW_DAYS days.\nRead-only; a visitor gets 401.","operationId":"get_my_usage_api_v1_me_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberUsageResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/":{"get":{"summary":"Root","description":"Root endpoint","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AcceptTermsRequest":{"properties":{"terms_accepted":{"type":"boolean","title":"Terms Accepted","description":"User must accept Terms of Service and Privacy Policy"}},"type":"object","required":["terms_accepted"],"title":"AcceptTermsRequest","description":"POST /auth/accept-terms — the logged-in user accepts the Terms once."},"AcceptTermsResponse":{"properties":{"terms_accepted_at":{"type":"string","format":"date-time","title":"Terms Accepted At"}},"type":"object","required":["terms_accepted_at"],"title":"AcceptTermsResponse","description":"The stored acceptance time (unchanged if it was already set)."},"AccountDeleteConfirmRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"AccountDeleteConfirmRequest","description":"POST /auth/delete-account/confirm: the token from the e-mailed link. E50-P2B: locale\n(inherited, optional) is the confirm page's, used as in DeleteAccountRequest."},"AccountDeleteLinkRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"}},"type":"object","title":"AccountDeleteLinkRequest","description":"POST /auth/delete-account/request-link. A missing, non-string or unknown locale means en."},"AccountDeleteLinkResponse":{"properties":{"message":{"type":"string","title":"Message"},"expires_minutes":{"type":"integer","title":"Expires Minutes"}},"type":"object","required":["message","expires_minutes"],"title":"AccountDeleteLinkResponse","description":"The deletion link was e-mailed; it expires after expires_minutes."},"AccountRecoveryConfirmRequest":{"properties":{"token":{"type":"string","maxLength":256,"title":"Token"}},"type":"object","required":["token"],"title":"AccountRecoveryConfirmRequest","description":"POST /auth/recover-account/confirm (E50-P1): the token from the e-mailed link."},"AccountRecoveryLinkRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"AccountRecoveryLinkRequest","description":"POST /auth/recover-account/request-link (E50-P1): the account's e-mail address. The link's\nlanguage as for the account-delete link (inherited): a missing, non-string or unknown locale\nmeans en."},"AdminMessageDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"subject":{"type":"string","title":"Subject"},"message":{"type":"string","title":"Message"},"is_read":{"type":"boolean","title":"Is Read"},"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"user_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Tier"},"user_registered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"User Registered At"},"user_backtest_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Backtest Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","email","subject","message","is_read","created_at"],"title":"AdminMessageDetailResponse"},"AdminMessageListResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/AdminMessageRow"},"type":"array","title":"Messages"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["messages","total","page","page_size"],"title":"AdminMessageListResponse"},"AdminMessageRow":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"subject":{"type":"string","title":"Subject"},"preview":{"type":"string","title":"Preview"},"is_read":{"type":"boolean","title":"Is Read"},"user_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Tier"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","email","subject","preview","is_read","created_at"],"title":"AdminMessageRow"},"AdminReplyRequest":{"properties":{"reply_text":{"type":"string","maxLength":5000,"minLength":1,"title":"Reply Text"}},"type":"object","required":["reply_text"],"title":"AdminReplyRequest"},"AdminUserDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","title":"Role"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"monthly_tokens_remaining":{"type":"integer","title":"Monthly Tokens Remaining"},"purchased_tokens":{"type":"integer","title":"Purchased Tokens"},"credit_cycle_start":{"type":"string","format":"date-time","title":"Credit Cycle Start"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"email_verified":{"type":"boolean","title":"Email Verified"},"is_active":{"type":"boolean","title":"Is Active"},"tier_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Tier Expires At"},"daily_prediction_count":{"type":"integer","title":"Daily Prediction Count"},"daily_backtest_count":{"type":"integer","title":"Daily Backtest Count"},"telegram_connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Telegram Connected At"},"saved_strategies_count":{"type":"integer","title":"Saved Strategies Count","default":0},"status":{"type":"string","title":"Status","default":""}},"type":"object","required":["id","email","role","subscription_tier","monthly_tokens_remaining","purchased_tokens","credit_cycle_start","created_at","updated_at","email_verified","is_active","daily_prediction_count","daily_backtest_count"],"title":"AdminUserDetailResponse"},"AdminUserListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/AdminUserRow"},"type":"array","title":"Users"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["users","total","page","page_size"],"title":"AdminUserListResponse"},"AdminUserRow":{"properties":{"id":{"type":"integer","title":"Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"monthly_tokens_remaining":{"type":"integer","title":"Monthly Tokens Remaining"},"purchased_tokens":{"type":"integer","title":"Purchased Tokens"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"status":{"type":"string","title":"Status","default":""}},"type":"object","required":["id","email","role","subscription_tier","monthly_tokens_remaining","purchased_tokens","created_at"],"title":"AdminUserRow"},"AggregateResponse":{"properties":{"daily_rows_created":{"type":"integer","title":"Daily Rows Created"},"weekly_rows_created":{"type":"integer","title":"Weekly Rows Created"},"monthly_rows_created":{"type":"integer","title":"Monthly Rows Created"}},"type":"object","required":["daily_rows_created","weekly_rows_created","monthly_rows_created"],"title":"AggregateResponse"},"AnalyticsBatchRequest":{"properties":{"events":{"items":{"$ref":"#/components/schemas/AnalyticsEventRequest"},"type":"array","maxItems":50,"minItems":1,"title":"Events"}},"type":"object","required":["events"],"title":"AnalyticsBatchRequest"},"AnalyticsCleanupResponse":{"properties":{"deleted_count":{"type":"integer","title":"Deleted Count"}},"type":"object","required":["deleted_count"],"title":"AnalyticsCleanupResponse"},"AnalyticsEventRequest":{"properties":{"event_type":{"type":"string","maxLength":100,"minLength":1,"title":"Event Type"},"page":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Page"},"metadata":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata"},"visitor_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Visitor Id"},"session_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Session Id"}},"type":"object","required":["event_type"],"title":"AnalyticsEventRequest"},"AnonymousPageviewRequest":{"properties":{"page":{"type":"string","maxLength":500,"minLength":1,"title":"Page"}},"type":"object","required":["page"],"title":"AnonymousPageviewRequest"},"AuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"$ref":"#/components/schemas/UserResponse"}},"type":"object","required":["access_token","user"],"title":"AuthResponse","description":"Authentication response with token and user data"},"BacktestRequest":{"properties":{"coins":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Coins","description":"List of coin symbols to backtest"},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Backtest start date"},"end_date":{"type":"string","format":"date","title":"End Date","description":"Backtest end date"},"position_capital":{"type":"number","exclusiveMinimum":0.0,"title":"Position Capital","description":"Position capital in USDT"},"leverage":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Leverage","description":"Leverage multiplier (1x-50x)"},"stop_loss_percent":{"type":"number","exclusiveMinimum":0.0,"title":"Stop Loss Percent","description":"Stop loss percentage (decimal allowed)"},"take_profit_percent":{"type":"number","exclusiveMinimum":0.0,"title":"Take Profit Percent","description":"Take profit percentage (decimal allowed)"},"commission_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Commission Rate","description":"Commission rate (default 0.001 = 0.1%)","default":0.001},"strategy":{"allOf":[{"$ref":"#/components/schemas/StrategyRules"}],"description":"Strategy rules for LONG and SHORT entries"},"capital_mode":{"type":"string","enum":["standard","win_compound","loss_martingale"],"title":"Capital Mode","default":"standard"},"streak_limit":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":1.0},{"type":"null"}],"title":"Streak Limit"},"profit_reinvest_pct":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Profit Reinvest Pct"},"loss_recovery_pct":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":1.0},{"type":"null"}],"title":"Loss Recovery Pct"},"win_cooldown_minutes":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Win Cooldown Minutes","description":"Cooldown after win in minutes (0=disabled, max 10000)"},"loss_cooldown_minutes":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Loss Cooldown Minutes","description":"Cooldown after loss in minutes (0=disabled, max 10000)"}},"type":"object","required":["coins","start_date","end_date","position_capital","leverage","stop_loss_percent","take_profit_percent","strategy"],"title":"BacktestRequest","description":"Backtest configuration request"},"BacktestResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Unique job identifier"},"status":{"type":"string","enum":["pending","running","completed","stopped","failed"],"title":"Status","description":"Job status"},"progress":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Progress","description":"Progress percentage","default":0.0},"statistics":{"anyOf":[{"$ref":"#/components/schemas/BacktestStatistics"},{"type":"null"}],"description":"Current statistics"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Status message or error"}},"type":"object","required":["job_id","status"],"title":"BacktestResponse","description":"Backtest response"},"BacktestStatistics":{"properties":{"current_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Date"},"progress_percent":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Progress Percent","default":0.0},"total_trades":{"type":"integer","minimum":0.0,"title":"Total Trades","default":0},"winning_trades":{"type":"integer","minimum":0.0,"title":"Winning Trades","default":0},"losing_trades":{"type":"integer","minimum":0.0,"title":"Losing Trades","default":0},"win_rate":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Win Rate","description":"Win rate percentage","default":0.0},"long_count":{"type":"integer","minimum":0.0,"title":"Long Count","default":0},"winning_longs":{"type":"integer","minimum":0.0,"title":"Winning Longs","default":0},"losing_longs":{"type":"integer","minimum":0.0,"title":"Losing Longs","default":0},"long_win_rate":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Long Win Rate","default":0.0},"short_count":{"type":"integer","minimum":0.0,"title":"Short Count","default":0},"winning_shorts":{"type":"integer","minimum":0.0,"title":"Winning Shorts","default":0},"losing_shorts":{"type":"integer","minimum":0.0,"title":"Losing Shorts","default":0},"short_win_rate":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Short Win Rate","default":0.0},"total_pnl":{"type":"number","title":"Total Pnl","description":"Total profit/loss in USDT","default":0.0},"avg_profit_per_position":{"type":"number","title":"Avg Profit Per Position","description":"Average profit per position","default":0.0},"roi":{"type":"number","title":"Roi","description":"Return on investment percentage","default":0.0},"total_volume":{"type":"number","minimum":0.0,"title":"Total Volume","description":"Total trading volume","default":0.0},"total_commission_paid":{"type":"number","minimum":0.0,"title":"Total Commission Paid","description":"Total commission paid","default":0.0},"avg_position_duration_minutes":{"type":"number","minimum":0.0,"title":"Avg Position Duration Minutes","description":"Average position duration in minutes","default":0.0},"max_drawdown":{"type":"number","title":"Max Drawdown","description":"Maximum drawdown in USDT","default":0.0},"sharpe_ratio":{"type":"number","title":"Sharpe Ratio","description":"Sharpe ratio","default":0.0},"best_win_streak":{"type":"integer","minimum":0.0,"title":"Best Win Streak","description":"Longest consecutive win streak across all coins","default":0},"worst_loss_streak":{"type":"integer","minimum":0.0,"title":"Worst Loss Streak","description":"Longest consecutive loss streak across all coins","default":0},"best_win_streak_coin":{"type":"string","title":"Best Win Streak Coin","description":"Coin with the best win streak","default":""},"worst_loss_streak_coin":{"type":"string","title":"Worst Loss Streak Coin","description":"Coin with the worst loss streak","default":""},"coin_statistics":{"type":"object","title":"Coin Statistics","description":"Per-coin statistics breakdown"},"peak_capital_used":{"type":"number","minimum":0.0,"title":"Peak Capital Used","description":"Maximum concurrent capital across all coins","default":0.0}},"type":"object","title":"BacktestStatistics","description":"Backtest statistics"},"BinanceTestResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"message":{"type":"string","title":"Message"},"sample_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Sample Data"}},"type":"object","required":["connected","message"],"title":"BinanceTestResponse","description":"Binance connectivity test response"},"BroadcastListResponse":{"properties":{"broadcasts":{"items":{"$ref":"#/components/schemas/BroadcastRow"},"type":"array","title":"Broadcasts"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["broadcasts","total","page","page_size"],"title":"BroadcastListResponse"},"BroadcastRow":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"message":{"type":"string","title":"Message"},"type":{"type":"string","title":"Type"},"target_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Tier"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","title","message","type","created_at"],"title":"BroadcastRow"},"CampaignRow":{"properties":{"campaign":{"type":"string","title":"Campaign"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Medium"},"sessions":{"type":"integer","title":"Sessions"},"signups":{"type":"integer","title":"Signups"}},"type":"object","required":["campaign","source","medium","sessions","signups"],"title":"CampaignRow"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest"},"ChurnResponse":{"properties":{"churn_rate":{"type":"number","title":"Churn Rate"},"churned_users":{"type":"integer","title":"Churned Users"},"previously_active_users":{"type":"integer","title":"Previously Active Users"}},"type":"object","required":["churn_rate","churned_users","previously_active_users"],"title":"ChurnResponse"},"CleanupResponse":{"properties":{"deleted_count":{"type":"integer","title":"Deleted Count"},"message":{"type":"string","title":"Message"}},"type":"object","required":["deleted_count","message"],"title":"CleanupResponse","description":"Response for admin cleanup endpoints."},"CohortEntry":{"properties":{"week_label":{"type":"string","title":"Week Label"},"cohort_size":{"type":"integer","title":"Cohort Size"},"retention_by_week":{"items":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"array","title":"Retention By Week"}},"type":"object","required":["week_label","cohort_size","retention_by_week"],"title":"CohortEntry"},"CohortResponse":{"properties":{"cohorts":{"items":{"$ref":"#/components/schemas/CohortEntry"},"type":"array","title":"Cohorts"}},"type":"object","required":["cohorts"],"title":"CohortResponse"},"CoinUsageResponse":{"properties":{"coins":{"items":{"type":"object"},"type":"array","title":"Coins"}},"type":"object","required":["coins"],"title":"CoinUsageResponse"},"CoinWithPrice":{"properties":{"symbol":{"type":"string","title":"Symbol"},"name":{"type":"string","title":"Name"},"binance_symbol":{"type":"string","title":"Binance Symbol"},"min_tier_required":{"type":"string","title":"Min Tier Required"},"is_active":{"type":"boolean","title":"Is Active"},"id":{"type":"integer","title":"Id"},"data_start_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data Start Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"current_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Price"},"price_change_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Change 24H"},"volume_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume 24H"}},"type":"object","required":["symbol","name","binance_symbol","min_tier_required","is_active","id","created_at"],"title":"CoinWithPrice","description":"Coin with current price from Binance"},"ConsentRequest":{"properties":{"consent":{"type":"boolean","title":"Consent"},"version":{"type":"string","maxLength":20,"title":"Version","default":"1.0"},"visitor_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Visitor Id"}},"type":"object","required":["consent"],"title":"ConsentRequest"},"ContactSubmitRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"subject":{"type":"string","maxLength":255,"minLength":1,"title":"Subject"},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"}},"type":"object","required":["name","email","subject","message"],"title":"ContactSubmitRequest"},"ContactSubmitResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"ContactSubmitResponse"},"CountryRow":{"properties":{"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"sessions":{"type":"integer","title":"Sessions"},"visitors":{"type":"integer","title":"Visitors"}},"type":"object","required":["country","sessions","visitors"],"title":"CountryRow"},"DashboardStatsResponse":{"properties":{"total_users":{"type":"integer","title":"Total Users"},"new_today":{"type":"integer","title":"New Today"},"new_this_week":{"type":"integer","title":"New This Week"},"new_this_month":{"type":"integer","title":"New This Month"},"active_last_24h":{"type":"integer","title":"Active Last 24H"},"recent_users":{"items":{"$ref":"#/components/schemas/RecentUserResponse"},"type":"array","title":"Recent Users"},"system_health":{"$ref":"#/components/schemas/SystemHealthResponse"}},"type":"object","required":["total_users","new_today","new_this_week","new_this_month","active_last_24h","recent_users","system_health"],"title":"DashboardStatsResponse"},"DeleteAccountRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"DeleteAccountRequest","description":"POST /auth/delete-account: the password. E50-P2B: locale (inherited, optional) is the profile\npage's, the language of the \"account deleted\" e-mail; a missing, non-string or unknown one means\nthe account's own language, else en."},"DeviceRow":{"properties":{"device":{"type":"string","title":"Device"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["device","sessions"],"title":"DeviceRow"},"EntryPageRow":{"properties":{"path":{"type":"string","title":"Path"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["path","sessions"],"title":"EntryPageRow"},"ExcludedCounts":{"properties":{"path":{"type":"integer","title":"Path"},"bot":{"type":"integer","title":"Bot"},"no_lang":{"type":"integer","title":"No Lang"},"origin":{"type":"integer","title":"Origin"}},"type":"object","required":["path","bot","no_lang","origin"],"title":"ExcludedCounts","description":"Hits not counted in the range, per reason. MIRRORS EXCLUDED_REASONS in\napp/core/traffic_report_config.py."},"ExtendedProfileResponse":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"role":{"type":"string","title":"Role"},"email_verified":{"type":"boolean","title":"Email Verified"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"monthly_tokens_remaining":{"type":"integer","title":"Monthly Tokens Remaining"},"purchased_tokens":{"type":"integer","title":"Purchased Tokens"},"credit_cycle_start":{"type":"string","format":"date-time","title":"Credit Cycle Start"},"notification_enabled":{"type":"boolean","title":"Notification Enabled"},"has_password":{"type":"boolean","title":"Has Password"}},"type":"object","required":["id","email","full_name","subscription_tier","role","email_verified","created_at","monthly_tokens_remaining","purchased_tokens","credit_cycle_start","notification_enabled","has_password"],"title":"ExtendedProfileResponse","description":"Extended user profile response with subscription, credit, and preference data."},"ForgotPasswordRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest","description":"POST /auth/forgot-password and POST /auth/request-verification: the address; locale (optional,\ninherited; EPOSTA-P1) is the e-mail's language."},"FunnelResponse":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/FunnelStep"},"type":"array","title":"Steps"}},"type":"object","required":["steps"],"title":"FunnelResponse"},"FunnelStep":{"properties":{"name":{"type":"string","title":"Name"},"count":{"type":"integer","title":"Count"},"conversion_pct":{"type":"number","title":"Conversion Pct"}},"type":"object","required":["name","count","conversion_pct"],"title":"FunnelStep"},"GiftCreditsRequest":{"properties":{"type":{"type":"string","enum":["monthly","purchased"],"title":"Type"},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount"}},"type":"object","required":["type","amount"],"title":"GiftCreditsRequest"},"Grouped_CampaignRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/CampaignRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[CampaignRow]"},"Grouped_CountryRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/CountryRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[CountryRow]"},"Grouped_DeviceRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/DeviceRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[DeviceRow]"},"Grouped_EntryPageRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/EntryPageRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[EntryPageRow]"},"Grouped_LanguageRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/LanguageRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[LanguageRow]"},"Grouped_ReferrerRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/ReferrerRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[ReferrerRow]"},"Grouped_SourceRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/SourceRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[SourceRow]"},"Grouped_TopPageRow_":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/TopPageRow"},"type":"array","title":"Rows"},"total_groups":{"type":"integer","title":"Total Groups"}},"type":"object","required":["rows","total_groups"],"title":"Grouped[TopPageRow]"},"GrowthDataPoint":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["date","count"],"title":"GrowthDataPoint"},"GrowthResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/GrowthDataPoint"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"GrowthResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"database":{"$ref":"#/components/schemas/ServiceStatus"},"redis":{"$ref":"#/components/schemas/ServiceStatus"},"binance":{"$ref":"#/components/schemas/ServiceStatus"},"backtest_pool":{"anyOf":[{"$ref":"#/components/schemas/ServiceStatus"},{"type":"null"}]}},"type":"object","required":["status","database","redis","binance"],"title":"HealthResponse","description":"Health check response"},"IndicatorPopularityItem":{"properties":{"group":{"type":"string","title":"Group"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["group","count"],"title":"IndicatorPopularityItem"},"IndicatorPopularityResponse":{"properties":{"indicators":{"items":{"$ref":"#/components/schemas/IndicatorPopularityItem"},"type":"array","title":"Indicators"}},"type":"object","required":["indicators"],"title":"IndicatorPopularityResponse"},"IndicatorResponse":{"properties":{"id":{"type":"integer","title":"Id"},"indicator_name":{"type":"string","title":"Indicator Name","description":"Short code (e.g., 'rsi1h')"},"display_name":{"type":"string","title":"Display Name","description":"Display name (e.g., 'RSI (1h)')"},"category":{"type":"string","title":"Category","description":"Category (Trend, Momentum, Volatility, Volume)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","indicator_name","display_name","category"],"title":"IndicatorResponse","description":"Indicator information"},"IndicatorUsageResponse":{"properties":{"indicators":{"items":{"type":"object"},"type":"array","title":"Indicators"}},"type":"object","required":["indicators"],"title":"IndicatorUsageResponse"},"LanguageRow":{"properties":{"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"pageviews":{"type":"integer","title":"Pageviews"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["language","pageviews","sessions"],"title":"LanguageRow"},"MemberUsageResponse":{"properties":{"coins":{"items":{"type":"string"},"type":"array","title":"Coins"},"families":{"items":{"type":"string"},"type":"array","title":"Families"},"indicators":{"items":{"type":"string"},"type":"array","title":"Indicators"}},"type":"object","required":["coins","families","indicators"],"title":"MemberUsageResponse","description":"The logged-in member's own most used coins and indicators, in order:\ncoins (at most TOP_COINS), indicator families (\"rsi\", \"boll\", ...) and\nindicator codes (\"R1h\", ...). Empty lists for a member without usage."},"MembersSummary":{"properties":{"total":{"type":"integer","title":"Total"},"by_provider":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Provider"},"terms_pending":{"type":"integer","title":"Terms Pending"}},"type":"object","required":["total","by_provider","terms_pending"],"title":"MembersSummary"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["message"],"title":"MessageResponse","description":"Generic success message response."},"NotificationListResponse":{"properties":{"notifications":{"items":{"$ref":"#/components/schemas/NotificationResponse"},"type":"array","title":"Notifications"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["notifications","total","page","page_size"],"title":"NotificationListResponse"},"NotificationResponse":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"message":{"type":"string","title":"Message"},"type":{"type":"string","title":"Type"},"is_read":{"type":"boolean","title":"Is Read"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","title","message","type","is_read","created_at"],"title":"NotificationResponse"},"OrAlternative":{"properties":{"indicator":{"type":"string","title":"Indicator","description":"Indicator short code"},"operator":{"type":"string","enum":[">","<","="],"title":"Operator","description":"Comparison operator"},"value":{"type":"number","title":"Value","description":"Comparison value"}},"type":"object","required":["indicator","operator","value"],"title":"OrAlternative","description":"OR alternative condition"},"OverviewResponse":{"properties":{"total_users":{"type":"integer","title":"Total Users"},"dau":{"type":"integer","title":"Dau"},"wau":{"type":"integer","title":"Wau"},"mau":{"type":"integer","title":"Mau"},"new_registrations":{"type":"integer","title":"New Registrations"},"total_backtests":{"type":"integer","title":"Total Backtests"},"total_predict_views":{"type":"integer","title":"Total Predict Views"},"avg_session_duration":{"type":"number","title":"Avg Session Duration"}},"type":"object","required":["total_users","dau","wau","mau","new_registrations","total_backtests","total_predict_views","avg_session_duration"],"title":"OverviewResponse"},"PageViewsResponse":{"properties":{"pages":{"items":{"type":"object"},"type":"array","title":"Pages"}},"type":"object","required":["pages"],"title":"PageViewsResponse"},"PredictionRequest":{"properties":{"coin_symbol":{"type":"string","maxLength":20,"pattern":"^[A-Z0-9]{1,20}$","title":"Coin Symbol","description":"Coin symbol (e.g., BTC)"},"direction":{"type":"string","enum":["long","short"],"title":"Direction","description":"Position direction: long or short"},"stop_loss":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Stop Loss","description":"Stop loss percentage (1-10)"},"take_profit":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Take Profit","description":"Take profit percentage (1-10)"},"position_size":{"type":"number","title":"Position Size","description":"Position size in USDT","default":100},"leverage":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Leverage","description":"Leverage (1-50x)","default":1}},"type":"object","required":["coin_symbol","direction","stop_loss","take_profit"],"title":"PredictionRequest","description":"Prediction request model"},"PredictionResponse":{"properties":{"coin_symbol":{"type":"string","title":"Coin Symbol"},"direction":{"type":"string","title":"Direction"},"stop_loss":{"type":"integer","title":"Stop Loss"},"take_profit":{"type":"integer","title":"Take Profit"},"win_probability":{"type":"number","title":"Win Probability"},"entry_price":{"type":"number","title":"Entry Price"},"sl_price":{"type":"number","title":"Sl Price"},"tp_price":{"type":"number","title":"Tp Price"},"max_loss_usdt":{"type":"number","title":"Max Loss Usdt"},"max_profit_usdt":{"type":"number","title":"Max Profit Usdt"},"risk_reward_ratio":{"type":"number","title":"Risk Reward Ratio"},"recommended_max_leverage":{"type":"integer","title":"Recommended Max Leverage"},"liquidation_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Liquidation Price"},"warnings":{"items":{"$ref":"#/components/schemas/Warning"},"type":"array","title":"Warnings"}},"type":"object","required":["coin_symbol","direction","stop_loss","take_profit","win_probability","entry_price","sl_price","tp_price","max_loss_usdt","max_profit_usdt","risk_reward_ratio","recommended_max_leverage","warnings"],"title":"PredictionResponse","description":"Prediction response model"},"PreferencesResponse":{"properties":{"message":{"type":"string","title":"Message"},"notification_enabled":{"type":"boolean","title":"Notification Enabled"}},"type":"object","required":["message","notification_enabled"],"title":"PreferencesResponse","description":"Response after updating preferences."},"ProfileResponse":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"role":{"type":"string","title":"Role"},"email_verified":{"type":"boolean","title":"Email Verified"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"terms_accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Terms Accepted At"},"has_password":{"type":"boolean","title":"Has Password"}},"type":"object","required":["id","email","full_name","subscription_tier","role","email_verified","created_at","has_password"],"title":"ProfileResponse","description":"User profile response with additional metadata"},"ProfileStatsResponse":{"properties":{"backtest_count":{"type":"integer","title":"Backtest Count"},"predict_count":{"type":"integer","title":"Predict Count"},"member_days":{"type":"integer","title":"Member Days"}},"type":"object","required":["backtest_count","predict_count","member_days"],"title":"ProfileStatsResponse","description":"Usage statistics for the current user."},"RecentSignup":{"properties":{"user_id":{"type":"integer","title":"User Id"},"email":{"type":"string","title":"Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"auth_provider":{"type":"string","title":"Auth Provider"},"deleted":{"type":"boolean","title":"Deleted"},"matched":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Matched"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Medium"},"campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign"},"landing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Landing"},"first_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Source"},"first_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Medium"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"device":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"},"hits_before_signup":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hits Before Signup"}},"type":"object","required":["user_id","email","created_at","auth_provider","deleted","matched","source","medium","campaign","landing","first_source","first_medium","country","device","hits_before_signup"],"title":"RecentSignup"},"RecentUserResponse":{"properties":{"id":{"type":"integer","title":"Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"type":"string","title":"Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"subscription_tier":{"type":"string","title":"Subscription Tier"}},"type":"object","required":["id","email","created_at","subscription_tier"],"title":"RecentUserResponse"},"ReferrerRow":{"properties":{"host":{"type":"string","title":"Host"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["host","sessions"],"title":"ReferrerRow"},"RegisterRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password","description":"Password must be 8-128 characters"},"full_name":{"type":"string","maxLength":100,"minLength":1,"title":"Full Name","description":"Full name (1-100 characters)"},"terms_accepted":{"type":"boolean","title":"Terms Accepted","description":"User must accept Terms of Service and Privacy Policy"},"analytics_rejected":{"type":"boolean","title":"Analytics Rejected","default":false},"signup_via":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Signup Via"}},"type":"object","required":["email","password","full_name","terms_accepted"],"title":"RegisterRequest","description":"User registration request. EPOSTA-P1: locale (optional, inherited) is stored on the new account\nand is the verification e-mail's language."},"ResendVerificationRequest":{"properties":{"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"}},"type":"object","title":"ResendVerificationRequest","description":"POST /auth/resend-verification (EPOSTA-P1): an optional body; locale is the e-mail's language."},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"RetentionResponse":{"properties":{"d1_retention":{"type":"number","title":"D1 Retention"},"d7_retention":{"type":"number","title":"D7 Retention"},"d30_retention":{"type":"number","title":"D30 Retention"},"total_registered":{"type":"integer","title":"Total Registered"}},"type":"object","required":["d1_retention","d7_retention","d30_retention","total_registered"],"title":"RetentionResponse"},"RuleCondition":{"properties":{"indicator":{"type":"string","title":"Indicator","description":"Indicator short code (e.g., 'rsi1h')"},"operator":{"type":"string","enum":[">","<","="],"title":"Operator","description":"Comparison operator"},"value":{"type":"number","title":"Value","description":"Comparison value"},"or_alternatives":{"items":{"$ref":"#/components/schemas/OrAlternative"},"type":"array","maxItems":10,"title":"Or Alternatives","description":"Optional OR alternatives (max 10)"}},"type":"object","required":["indicator","operator","value"],"title":"RuleCondition","description":"Single rule condition with optional OR alternatives"},"SendNotificationRequest":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"type":{"type":"string","enum":["info","warning","success"],"title":"Type"},"target":{"type":"string","minLength":1,"title":"Target"}},"type":"object","required":["title","message","type","target"],"title":"SendNotificationRequest"},"SendNotificationResponse":{"properties":{"message":{"type":"string","title":"Message"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["message","count"],"title":"SendNotificationResponse"},"ServiceStatus":{"properties":{"status":{"type":"string","title":"Status"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["status"],"title":"ServiceStatus","description":"Individual service status"},"SessionStatsResponse":{"properties":{"avg_duration":{"type":"number","title":"Avg Duration"},"sessions_per_day":{"type":"number","title":"Sessions Per Day"},"page_views_per_session":{"type":"number","title":"Page Views Per Session"}},"type":"object","required":["avg_duration","sessions_per_day","page_views_per_session"],"title":"SessionStatsResponse"},"SignupSourceCount":{"properties":{"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Medium"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["source","medium","count"],"title":"SignupSourceCount"},"SignupSources":{"properties":{"first":{"items":{"$ref":"#/components/schemas/SignupSourceCount"},"type":"array","title":"First"},"last":{"items":{"$ref":"#/components/schemas/SignupSourceCount"},"type":"array","title":"Last"},"unmatched":{"type":"integer","title":"Unmatched"},"missing":{"type":"integer","title":"Missing"}},"type":"object","required":["first","last","unmatched","missing"],"title":"SignupSources"},"SourceRow":{"properties":{"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Medium"},"sessions":{"type":"integer","title":"Sessions"},"visitors":{"type":"integer","title":"Visitors"},"signups":{"type":"integer","title":"Signups"}},"type":"object","required":["source","medium","sessions","visitors","signups"],"title":"SourceRow"},"StrategyConfig":{"properties":{"coins":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Coins"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"position_capital":{"type":"number","exclusiveMinimum":0.0,"title":"Position Capital"},"leverage":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Leverage"},"stop_loss_percent":{"type":"number","exclusiveMinimum":0.0,"title":"Stop Loss Percent"},"take_profit_percent":{"type":"number","exclusiveMinimum":0.0,"title":"Take Profit Percent"},"commission_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Commission Rate"},"capital_mode":{"type":"string","title":"Capital Mode","default":"standard"},"streak_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Streak Limit"},"profit_reinvest_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profit Reinvest Pct"},"loss_recovery_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Loss Recovery Pct"},"win_cooldown_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Win Cooldown Minutes"},"loss_cooldown_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Loss Cooldown Minutes"}},"additionalProperties":false,"type":"object","required":["coins","start_date","end_date","position_capital","leverage","stop_loss_percent","take_profit_percent","commission_rate"],"title":"StrategyConfig","description":"Strict schema for strategy configuration — rejects unknown keys."},"StrategyDetail":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"config":{"type":"object","title":"Config"},"long_rules":{"items":{"type":"object"},"type":"array","title":"Long Rules"},"short_rules":{"items":{"type":"object"},"type":"array","title":"Short Rules"},"results":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Results"},"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","config","long_rules","short_rules","created_at","updated_at"],"title":"StrategyDetail","description":"Full strategy details"},"StrategyListItem":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"total_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Trades"},"win_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Win Rate"},"total_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pnl"},"roi":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Roi"},"coins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Coins"}},"type":"object","required":["id","name","created_at"],"title":"StrategyListItem","description":"Strategy summary for list view"},"StrategyRules":{"properties":{"long_rules":{"items":{"$ref":"#/components/schemas/RuleCondition"},"type":"array","maxItems":10,"title":"Long Rules","description":"LONG entry rules (max 10)"},"short_rules":{"items":{"$ref":"#/components/schemas/RuleCondition"},"type":"array","maxItems":10,"title":"Short Rules","description":"SHORT entry rules (max 10)"}},"type":"object","title":"StrategyRules","description":"Complete strategy with LONG and SHORT rules"},"StrategySaveRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"config":{"allOf":[{"$ref":"#/components/schemas/StrategyConfig"}],"description":"Full backtest config"},"long_rules":{"items":{"$ref":"#/components/schemas/RuleCondition"},"type":"array","maxItems":10,"title":"Long Rules"},"short_rules":{"items":{"$ref":"#/components/schemas/RuleCondition"},"type":"array","maxItems":10,"title":"Short Rules"},"results":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Results","description":"Last backtest statistics"}},"type":"object","required":["name","config"],"title":"StrategySaveRequest","description":"Request to save a strategy"},"SystemHealthResponse":{"properties":{"db_size":{"type":"string","title":"Db Size"},"redis_memory":{"type":"string","title":"Redis Memory"},"active_backtests":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Active Backtests"}},"type":"object","required":["db_size","redis_memory","active_backtests"],"title":"SystemHealthResponse"},"TierCount":{"properties":{"tier":{"type":"string","title":"Tier"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["tier","count"],"title":"TierCount"},"TierDistributionResponse":{"properties":{"tiers":{"items":{"$ref":"#/components/schemas/TierCount"},"type":"array","title":"Tiers"},"total_users":{"type":"integer","title":"Total Users"},"free_to_paid_pct":{"type":"number","title":"Free To Paid Pct"}},"type":"object","required":["tiers","total_users","free_to_paid_pct"],"title":"TierDistributionResponse"},"TopPageRow":{"properties":{"path":{"type":"string","title":"Path"},"pageviews":{"type":"integer","title":"Pageviews"},"visitors":{"type":"integer","title":"Visitors"}},"type":"object","required":["path","pageviews","visitors"],"title":"TopPageRow"},"TrafficDay":{"properties":{"day":{"type":"string","format":"date","title":"Day"},"visitors":{"type":"integer","title":"Visitors"},"sessions":{"type":"integer","title":"Sessions"},"pageviews":{"type":"integer","title":"Pageviews"},"signups":{"type":"integer","title":"Signups"}},"type":"object","required":["day","visitors","sessions","pageviews","signups"],"title":"TrafficDay"},"TrafficHitRequest":{"properties":{"path":{"type":"string","maxLength":300,"minLength":1,"title":"Path"},"referrer":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Referrer"},"utm_source":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Utm Campaign"},"click_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Click Id"},"analytics_rejected":{"type":"boolean","title":"Analytics Rejected","default":false}},"type":"object","required":["path"],"title":"TrafficHitRequest","description":"POST /analytics/hit — one cookieless page view. Unknown fields are ignored.\n\nA value longer than its limit is cut to the limit instead of failing with\n422: the app's validation handler logs the rejected input, and a referrer\nURL can carry an e-mail or a token in its query string."},"TrafficRange":{"properties":{"start":{"type":"string","format":"date","title":"Start"},"end":{"type":"string","format":"date","title":"End"},"days":{"type":"integer","title":"Days"},"today":{"type":"string","format":"date","title":"Today"}},"type":"object","required":["start","end","days","today"],"title":"TrafficRange"},"TrafficReportResponse":{"properties":{"range":{"$ref":"#/components/schemas/TrafficRange"},"data_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Data Start"},"totals":{"$ref":"#/components/schemas/TrafficTotals"},"daily":{"items":{"$ref":"#/components/schemas/TrafficDay"},"type":"array","title":"Daily"},"sources":{"$ref":"#/components/schemas/Grouped_SourceRow_"},"campaigns":{"$ref":"#/components/schemas/Grouped_CampaignRow_"},"referrers":{"$ref":"#/components/schemas/Grouped_ReferrerRow_"},"countries":{"$ref":"#/components/schemas/Grouped_CountryRow_"},"devices":{"$ref":"#/components/schemas/Grouped_DeviceRow_"},"languages":{"$ref":"#/components/schemas/Grouped_LanguageRow_"},"entry_pages":{"$ref":"#/components/schemas/Grouped_EntryPageRow_"},"top_pages":{"$ref":"#/components/schemas/Grouped_TopPageRow_"},"signup_sources":{"$ref":"#/components/schemas/SignupSources"},"signups_truncated":{"type":"boolean","title":"Signups Truncated"},"recent_signups":{"items":{"$ref":"#/components/schemas/RecentSignup"},"type":"array","title":"Recent Signups"},"members":{"$ref":"#/components/schemas/MembersSummary"},"excluded":{"anyOf":[{"$ref":"#/components/schemas/ExcludedCounts"},{"type":"null"}]}},"type":"object","required":["range","data_start","totals","daily","sources","campaigns","referrers","countries","devices","languages","entry_pages","top_pages","signup_sources","signups_truncated","recent_signups","members","excluded"],"title":"TrafficReportResponse"},"TrafficTotals":{"properties":{"visitors":{"type":"integer","title":"Visitors"},"sessions":{"type":"integer","title":"Sessions"},"pageviews":{"type":"integer","title":"Pageviews"},"pages_per_session":{"type":"number","title":"Pages Per Session"},"signups":{"type":"integer","title":"Signups"},"signup_rate_pct":{"type":"number","title":"Signup Rate Pct"}},"type":"object","required":["visitors","sessions","pageviews","pages_per_session","signups","signup_rate_pct"],"title":"TrafficTotals"},"UnreadCountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"UnreadCountResponse"},"UpdatePreferencesRequest":{"properties":{"notification_enabled":{"type":"boolean","title":"Notification Enabled"}},"type":"object","required":["notification_enabled"],"title":"UpdatePreferencesRequest","description":"Request to update user preferences."},"UpdateProfileRequest":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Full Name"}},"type":"object","title":"UpdateProfileRequest","description":"Request to update user profile (full_name)."},"UpdateRoleRequest":{"properties":{"role":{"type":"string","pattern":"^(user|moderator|admin|superadmin)$","title":"Role"}},"type":"object","required":["role"],"title":"UpdateRoleRequest"},"UpdateTierRequest":{"properties":{"tier":{"type":"string","pattern":"^(free|basic|pro|enterprise)$","title":"Tier"},"tier_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Tier Expires At","description":"Explicit expiry date (UTC). If omitted, defaults to now + 30 days for paid tiers."}},"type":"object","required":["tier"],"title":"UpdateTierRequest"},"UsageCountsRequest":{"properties":{"path":{"type":"string","maxLength":300,"minLength":1,"title":"Path"},"items":{"items":{},"type":"array","title":"Items"}},"type":"object","required":["path"],"title":"UsageCountsRequest","description":"POST /analytics/counts. Unknown fields are ignored.\n\nitems is any list: each row ({name, who, n, v}) is checked on its own by\nusage_service.clean_items, so a bad row is skipped instead of failing the\nrequest with 422. A path longer than its limit is cut, as in\nTrafficHitRequest."},"UsageReportResponse":{"properties":{"range":{"$ref":"#/components/schemas/TrafficRange"},"rows":{"items":{"$ref":"#/components/schemas/UsageRow"},"type":"array","title":"Rows"},"analyze_views":{"type":"integer","title":"Analyze Views"}},"type":"object","required":["range","rows","analyze_views"],"title":"UsageReportResponse"},"UsageRow":{"properties":{"name":{"type":"string","title":"Name"},"who":{"type":"string","title":"Who"},"total":{"type":"integer","title":"Total"},"visits":{"type":"integer","title":"Visits"}},"type":"object","required":["name","who","total","visits"],"title":"UsageRow"},"UserResponse":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"role":{"type":"string","title":"Role"},"email_verified":{"type":"boolean","title":"Email Verified","default":false}},"type":"object","required":["id","email","full_name","subscription_tier","role"],"title":"UserResponse","description":"User response (without sensitive data)"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Warning":{"properties":{"level":{"type":"string","title":"Level","description":"Warning level: critical, high, medium, low"},"message":{"type":"string","title":"Message","description":"Warning message"}},"type":"object","required":["level","message"],"title":"Warning","description":"Warning model"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/auth/login"}}}}}}