{"openapi":"3.1.0","info":{"title":"Media Downloader API","summary":"Unified API for async media downloads, auth automation, file delivery, and service diagnostics.","description":"Скачивание медиа с Instagram, TikTok, YouTube в максимальном качестве.\n\nAuthentication:\n- `X-API-Key` is required for non-admin `/api/*` routes when the deployment is configured with `API_KEY`.\n- `api_key` query parameter is supported for backward compatibility only.\n- `X-Admin-Token` is required for protected `/api/v1/admin/*` routes after login.\n\nOperational behavior:\n- Download creation endpoints are asynchronous and return immediately with task metadata.\n- Rate limiting applies to `/api/*` routes and may return HTTP 429 with reset headers.\n- File retrieval may respond with a binary body or a 307 redirect to external object storage.","version":"3.1.0"},"paths":{"/api/v1/health":{"get":{"tags":["system"],"summary":"Health check","description":"Returns service health status including uptime, version, platform info, active task count, storage stats, and availability of optional components.","operationId":"health_check_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/proxy-stats":{"get":{"tags":["system"],"summary":"Proxy pool statistics","description":"Returns current proxy pool metrics: pool size, verified count, and last refresh time.","operationId":"proxy_stats_api_v1_proxy_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProxyStatsResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/cobalt-status":{"get":{"tags":["system"],"summary":"Cobalt runtime status","description":"Checks the configured Cobalt instance and returns its availability, version, and supported services.","operationId":"cobalt_status_api_v1_cobalt_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CobaltStatusResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/ollama-status":{"get":{"tags":["system"],"summary":"Ollama server inventory","description":"Discovers configured Ollama endpoints and reports model availability for extraction and AML workloads.","operationId":"ollama_status_api_v1_ollama_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OllamaStatusResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/debug":{"get":{"tags":["system"],"summary":"Protected dependency diagnostics","description":"Runs extended checks for yt-dlp, ffmpeg, and a sample extractor call. Requires a valid API key and is intended for operator diagnostics.","operationId":"debug_info_api_v1_debug_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebugInfoResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/cookies/status":{"get":{"tags":["cookies"],"summary":"Instagram cookie status","description":"Shows whether the primary Instagram cookie file exists and whether it contains a usable `sessionid`.","operationId":"cookies_status_api_v1_cookies_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookiesStatusResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/cookies/import-from-browser":{"post":{"tags":["cookies"],"summary":"Import Instagram cookies from a local browser","description":"Attempts to locate an installed browser with an authenticated Instagram session and exports its cookies into the server cookie store.","operationId":"import_cookies_from_browser_api_v1_cookies_import_from_browser_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBrowserCookiesResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"422":{"$ref":"#/components/responses/ValidationFailed"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/cookies/manual":{"post":{"tags":["cookies"],"summary":"Store Instagram cookies manually","description":"Creates or replaces the primary Instagram Netscape cookie file from manually supplied cookie values.","operationId":"set_cookies_manually_api_v1_cookies_manual_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualCookiesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualCookiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/cookies/platform":{"post":{"tags":["cookies"],"summary":"Store cookies for any supported platform","description":"Persists platform cookies in Netscape format so downstream downloaders and fallbacks can reuse authenticated access.","operationId":"set_platform_cookies_api_v1_cookies_platform_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformCookiesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformCookiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/cookies/all":{"get":{"tags":["cookies"],"summary":"Cookie inventory for all platforms","description":"Returns file presence, auth-readiness, and cookie-name previews for every supported platform.","operationId":"all_cookies_status_api_v1_cookies_all_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllCookiesStatusResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/sessions":{"get":{"tags":["sessions"],"summary":"List Instagram sessions","description":"Returns all configured Instagram cookie sessions and their status.","operationId":"list_sessions_api_v1_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsListResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/sessions/reload":{"post":{"tags":["sessions"],"summary":"Reload Instagram sessions","description":"Reload all Instagram sessions from cookie files on disk.","operationId":"reload_sessions_api_v1_sessions_reload_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsReloadResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/sessions/add":{"post":{"tags":["sessions"],"summary":"Register an Instagram session file","description":"Adds a named session from `cookies/sessions/{name}.txt` into the in-memory Instagram session pool.","operationId":"add_session_api_v1_sessions_add_post","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","description":"Logical session name matching `cookies/sessions/{name}.txt`.","title":"Name"},"description":"Logical session name matching `cookies/sessions/{name}.txt`."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionAddResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/methods":{"get":{"tags":["system"],"summary":"Available download methods","description":"Returns the currently available downloader cascade and the readiness of each method.","operationId":"available_methods_api_v1_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodsResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/start":{"post":{"tags":["auth"],"summary":"Start an interactive browser auth session","description":"Launches a Playwright-backed browser session on the login page for the selected platform and returns the initial screenshot state.","operationId":"auth_start_api_v1_auth_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthStartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/screenshot/{session_id}":{"get":{"tags":["auth"],"summary":"Capture the current auth-session screenshot","description":"Returns the latest base64 screenshot together with detected authentication cookies for the active browser session.","operationId":"auth_screenshot_api_v1_auth_screenshot__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","description":"Interactive auth-session identifier.","title":"Session Id"},"description":"Interactive auth-session identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthScreenshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/action":{"post":{"tags":["auth"],"summary":"Perform a browser action inside the auth session","description":"Executes a click, type, keypress, navigation, scroll, or wait action inside the active Playwright session and returns the updated browser state.","operationId":"auth_action_api_v1_auth_action_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/status/{session_id}":{"get":{"tags":["auth"],"summary":"Check whether authentication is complete","description":"Inspects the current browser session and reports whether the required cookies for the selected platform are already present.","operationId":"auth_status_api_v1_auth_status__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","description":"Interactive auth-session identifier.","title":"Session Id"},"description":"Interactive auth-session identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/finish/{session_id}":{"post":{"tags":["auth"],"summary":"Persist cookies and close the auth session","description":"Extracts cookies from the active browser session, saves them into the platform cookie store, and closes the Playwright session.","operationId":"auth_finish_api_v1_auth_finish__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","description":"Interactive auth-session identifier.","title":"Session Id"},"description":"Interactive auth-session identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthFinishResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/close/{session_id}":{"post":{"tags":["auth"],"summary":"Close the auth session without saving cookies","description":"Stops the Playwright session and discards any unsaved browser state.","operationId":"auth_close_api_v1_auth_close__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","description":"Interactive auth-session identifier.","title":"Session Id"},"description":"Interactive auth-session identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthCloseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/auth/sessions":{"get":{"tags":["auth"],"summary":"List active auth sessions","description":"Returns all currently active interactive authorization sessions and their runtime metadata.","operationId":"auth_list_sessions_api_v1_auth_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionsListResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/download":{"post":{"tags":["download"],"summary":"Start a download task","description":"Queue a media download for the given URL. Returns a task object immediately. Poll GET /api/v1/tasks/{task_id} to track progress. Cascade order: cobalt → yt-dlp → instaloader (platform-dependent).","operationId":"download_endpoint_api_v1_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/batch-download":{"post":{"tags":["download"],"summary":"Start multiple download tasks","description":"Queue up to 50 media downloads at once. Each URL becomes an independent task. Returns a list of task objects. Duplicates in the input are automatically deduplicated.","operationId":"batch_download_endpoint_api_v1_batch_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDownloadRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/tasks/{task_id}":{"get":{"tags":["download"],"summary":"Get task status","description":"Retrieve current status and progress of a download task by ID.","operationId":"get_task_status_api_v1_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","description":"Download-task identifier.","title":"Task Id"},"description":"Download-task identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]},"delete":{"tags":["download"],"summary":"Cancel a download task","description":"Attempts to cancel an in-flight task. Completed or failed tasks are left unchanged and return `cancelled=false`.","operationId":"cancel_task_api_v1_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","description":"Download-task identifier.","title":"Task Id"},"description":"Download-task identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/tasks":{"get":{"tags":["download"],"summary":"List all download tasks","description":"List all queued and completed download tasks with optional status filter and pagination.","operationId":"list_tasks_api_v1_tasks_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Фильтр по статусу","title":"Status"},"description":"Фильтр по статусу"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Maximum number of tasks to return.","default":100,"title":"Limit"},"description":"Maximum number of tasks to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"How many matching tasks to skip before returning results.","default":0,"title":"Offset"},"description":"How many matching tasks to skip before returning results."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TasksListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/profiles":{"get":{"tags":["files"],"summary":"List source profiles","description":"Return unique profile/channel names extracted from download paths, with file counts.","operationId":"list_profiles_api_v1_profiles_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter profiles by platform.","title":"Platform"},"description":"Filter profiles by platform."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/files":{"get":{"tags":["files"],"summary":"List downloaded files","description":"List all files in the download directory with optional filtering by media type or platform, and sorting.","operationId":"list_files_api_v1_files_get","parameters":[{"name":"sort","in":"query","required":false,"schema":{"enum":["name","size","date"],"type":"string","description":"Сортировка: name, size, date","default":"date","title":"Sort"},"description":"Сортировка: name, size, date"},{"name":"media_type","in":"query","required":false,"schema":{"anyOf":[{"enum":["video","image","audio","other"],"type":"string"},{"type":"null"}],"description":"Фильтр: video, image, audio, other","title":"Media Type"},"description":"Фильтр: video, image, audio, other"},{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Фильтр по платформе","title":"Platform"},"description":"Фильтр по платформе"},{"name":"profile","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source profile/channel name.","title":"Profile"},"description":"Filter by source profile/channel name."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]},"delete":{"tags":["files"],"summary":"Delete all downloaded files","description":"Permanently delete ALL files in the download directory and clear the Wasabi manifest. This action is irreversible. Requires confirmation query parameter `confirm=true`.","operationId":"delete_all_files_api_v1_files_delete","parameters":[{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean","description":"Must be true to confirm deletion of all files","default":false,"title":"Confirm"},"description":"Must be true to confirm deletion of all files"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/files/{file_path}":{"get":{"tags":["files"],"summary":"Download a file","description":"Download a specific file by its relative path within the download directory. Media files (video, audio, images) are served inline for browser preview; other types are served as attachments. If the file was uploaded to Wasabi and deleted locally, returns a 307 redirect to a presigned URL.","operationId":"get_file_api_v1_files__file_path__get","parameters":[{"name":"file_path","in":"path","required":true,"schema":{"type":"string","description":"Относительн��й путь к файлу","title":"File Path"},"description":"Относительн��й путь к файлу"}],"responses":{"200":{"description":"Binary file content. Content-Type varies by file extension.","content":{"application/json":{"schema":{"title":"Response Get File Api V1 Files  File Path  Get"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"307":{"description":"Redirect to Wasabi presigned URL for files stored in object storage."},"400":{"description":"Invalid or path-traversal file path."},"404":{"description":"File not found locally or in Wasabi."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]},"delete":{"tags":["files"],"summary":"Delete a file","description":"Delete a specific file and remove any resulting empty parent directories. Also removes Wasabi manifest entries.","operationId":"delete_file_api_v1_files__file_path__delete","parameters":[{"name":"file_path","in":"path","required":true,"schema":{"type":"string","description":"Относительный путь к файлу","title":"File Path"},"description":"Относительный путь к файлу"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/thumbs/{file_path}":{"get":{"tags":["files"],"summary":"Get video thumbnail","description":"Returns a cached JPEG thumbnail for a video file. Generated on first request via ffmpeg. Supports Wasabi-only files by temporarily downloading the source for thumbnail extraction.","operationId":"get_thumbnail_api_v1_thumbs__file_path__get","parameters":[{"name":"file_path","in":"path","required":true,"schema":{"type":"string","description":"Relative path to the video file","title":"File Path"},"description":"Relative path to the video file"}],"responses":{"200":{"description":"JPEG thumbnail image.","content":{"application/json":{"schema":{"title":"Response Get Thumbnail Api V1 Thumbs  File Path  Get"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Requested path is not a video file."},"404":{"description":"Source video file not found locally or in Wasabi."},"503":{"description":"ffmpeg is not available or thumbnail generation failed."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/files/archive":{"post":{"tags":["files"],"summary":"Create a ZIP archive from selected files","description":"Builds a temporary ZIP archive from the supplied relative file paths and streams it back as a binary response.","operationId":"create_archive_api_v1_files_archive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveRequest"}}},"required":true},"responses":{"200":{"description":"ZIP archive containing the requested files.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/gallery":{"post":{"tags":["files"],"summary":"Create a shareable gallery","description":"Saves a list of file paths under a unique token. The resulting /gallery/{token} URL is publicly accessible without authentication.","operationId":"create_gallery_api_v1_gallery_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GalleryCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GalleryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/gallery/{token}":{"get":{"tags":["files"],"summary":"Get gallery metadata","description":"Returns the file list for a gallery token. Publicly accessible.","operationId":"get_gallery_data_api_v1_gallery__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","description":"Unique gallery token returned when the gallery was created","title":"Token"},"description":"Unique gallery token returned when the gallery was created"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/history":{"get":{"tags":["history"],"summary":"Download history","description":"Returns past download attempts (success and error) in reverse-chronological order. Supports filtering by platform and status, and pagination via limit/offset.","operationId":"get_history_api_v1_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Maximum number of history entries to return.","default":50,"title":"Limit"},"description":"Maximum number of history entries to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"How many matching history entries to skip before returning results.","default":0,"title":"Offset"},"description":"How many matching history entries to skip before returning results."},{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Фильтр по платформе","title":"Platform"},"description":"Фильтр по платформе"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Фильтр: success, error","title":"Status"},"description":"Фильтр: success, error"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]},"delete":{"tags":["history"],"summary":"Clear download history","description":"Delete all download history entries. This action is irreversible.","operationId":"clear_history_api_v1_history_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryClearResponse"}}}},"401":{"$ref":"#/components/responses/ApiKeyUnauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"ApiKeyHeaderAuth":[]},{"LegacyApiKeyQueryAuth":[]}]}},"/api/v1/admin/login":{"post":{"tags":["admin"],"summary":"Create an admin session","description":"Authenticates an admin user and returns a session token for subsequent protected admin requests.","operationId":"admin_login_api_v1_admin_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}}}},"/api/v1/admin/logout":{"post":{"tags":["admin"],"summary":"Invalidate the current admin session","description":"Deletes the current admin session token if one is provided.","operationId":"admin_logout_api_v1_admin_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLogoutResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/me":{"get":{"tags":["admin"],"summary":"Get current admin identity","description":"Returns the user bound to the supplied `X-Admin-Token` session.","operationId":"admin_me_api_v1_admin_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMeResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/users":{"get":{"tags":["admin"],"summary":"List admin-managed users","description":"Returns all users in the admin database. Requires `admin` or `superadmin` role.","operationId":"admin_list_users_api_v1_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUsersListResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"AdminTokenAuth":[]}]},"post":{"tags":["admin"],"summary":"Create a managed user","description":"Creates a new user record in the admin database. Requires `superadmin` role.","operationId":"admin_create_user_api_v1_admin_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateUserRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/settings/api-key":{"get":{"tags":["admin"],"summary":"Get API key settings","description":"Returns the current API key authentication setting and the active key. Requires admin token.","operationId":"admin_get_api_key_settings_api_v1_admin_settings_api_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeySettingsResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"AdminTokenAuth":[]}]},"put":{"tags":["admin"],"summary":"Toggle API key requirement","description":"Enable or disable mandatory API key authentication for all `/api/*` routes. When enabled, the active key is auto-generated if none exists. Requires `superadmin` role.","operationId":"admin_toggle_api_key_api_v1_admin_settings_api_key_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyToggleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyToggleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/settings/api-key/regenerate":{"post":{"tags":["admin"],"summary":"Regenerate the API key","description":"Generates a new random API key and replaces the current one. Requires `superadmin` role.","operationId":"admin_regenerate_api_key_api_v1_admin_settings_api_key_regenerate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRegenerateResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/user/api-keys":{"get":{"tags":["admin"],"summary":"List my API keys","description":"Returns all active personal API keys for the currently authenticated admin user.","operationId":"user_list_api_keys_api_v1_admin_user_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeysListResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]},"post":{"tags":["admin"],"summary":"Create a personal API key","description":"Generates a new personal API key for the current user. The full key is returned ONCE — save it immediately. Keys start with `mdl_` and are accepted by all `/api/*` endpoints via the `X-API-Key` header.","operationId":"user_create_api_key_api_v1_admin_user_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/user/api-keys/{key_id}":{"delete":{"tags":["admin"],"summary":"Revoke a personal API key","description":"Permanently deactivates the specified API key. Only the owner can revoke their own keys.","operationId":"user_revoke_api_key_api_v1_admin_user_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","description":"API key ID to revoke.","title":"Key Id"},"description":"API key ID to revoke."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyRevokeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/all-api-keys":{"get":{"tags":["admin"],"summary":"List all API keys in the system (superadmin)","description":"Returns all active personal API keys for every user. Requires `superadmin` role.","operationId":"superadmin_list_all_api_keys_api_v1_admin_all_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllApiKeysListResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]},"post":{"tags":["admin"],"summary":"Create an API key for any user (superadmin)","description":"Generates a new personal API key for the specified user. The full key is returned ONCE. Requires `superadmin` role.","operationId":"superadmin_create_api_key_api_v1_admin_all_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuperadminCreateKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/all-api-keys/{key_id}":{"delete":{"tags":["admin"],"summary":"Revoke any API key (superadmin)","description":"Permanently deactivates the specified API key regardless of owner. Requires `superadmin` role.","operationId":"superadmin_revoke_api_key_api_v1_admin_all_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","description":"API key ID to revoke.","title":"Key Id"},"description":"API key ID to revoke."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserApiKeyRevokeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/audit":{"get":{"tags":["admin"],"summary":"Read the admin audit log (superadmin)","description":"Returns security-relevant admin actions (logins, key changes, user creation), newest first. Requires `superadmin` role.","operationId":"admin_audit_log_api_v1_admin_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of entries to return.","default":100,"title":"Limit"},"description":"Maximum number of entries to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"How many entries to skip.","default":0,"title":"Offset"},"description":"How many entries to skip."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/backup":{"post":{"tags":["admin"],"summary":"Run a backup now (superadmin)","description":"Snapshots the admin DB and cookies/sessions to Wasabi immediately. Requires `superadmin` role.","operationId":"admin_run_backup_api_v1_admin_backup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupRunResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"}},"security":[{"AdminTokenAuth":[]}]}},"/api/v1/admin/backups":{"get":{"tags":["admin"],"summary":"List backup snapshots (superadmin)","description":"Returns the available backup snapshot prefixes in Wasabi, newest first. Requires `superadmin` role.","operationId":"admin_list_backups_api_v1_admin_backups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupListResponse"}}}},"401":{"$ref":"#/components/responses/AdminUnauthorized"}},"security":[{"AdminTokenAuth":[]}]}}},"components":{"schemas":{"ActiveAuthSessionInfo":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Interactive auth-session identifier."},"platform":{"type":"string","title":"Platform","description":"Normalized platform identifier."},"created_at":{"type":"number","title":"Created At","description":"Unix timestamp when the browser session was created."},"age_sec":{"type":"integer","title":"Age Sec","description":"Current session age in seconds."},"current_url":{"type":"string","title":"Current Url","description":"Current browser URL."},"expired":{"type":"boolean","title":"Expired","description":"Whether the server considers the session expired."}},"type":"object","required":["session_id","platform","created_at","age_sec","current_url","expired"],"title":"ActiveAuthSessionInfo"},"AdminCreateUserRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email нового пользователя"},"password":{"type":"string","minLength":6,"title":"Password","description":"Пароль (минимум 6 символов)"},"role":{"type":"string","title":"Role","description":"Роль: superadmin, admin, user","default":"user"}},"type":"object","required":["email","password"],"title":"AdminCreateUserRequest"},"AdminCreateUserResponse":{"properties":{"user":{"$ref":"#/components/schemas/AdminUserInfo","description":"Created user identity."}},"type":"object","required":["user"],"title":"AdminCreateUserResponse"},"AdminLoginRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Email пользователя"},"password":{"type":"string","title":"Password","description":"Пароль"}},"type":"object","required":["email","password"],"title":"AdminLoginRequest","examples":[{"email":"admin@example.com","password":"your-password"}]},"AdminLoginResponse":{"properties":{"token":{"type":"string","title":"Token","description":"Admin session token for `X-Admin-Token`."},"user":{"$ref":"#/components/schemas/AdminUserInfo","description":"Authenticated admin identity."}},"type":"object","required":["token","user"],"title":"AdminLoginResponse"},"AdminLogoutResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Logout outcome."}},"type":"object","required":["status"],"title":"AdminLogoutResponse"},"AdminMeResponse":{"properties":{"user":{"$ref":"#/components/schemas/AdminUserInfo","description":"Current admin identity."}},"type":"object","required":["user"],"title":"AdminMeResponse"},"AdminUserInfo":{"properties":{"id":{"type":"integer","title":"Id","description":"Numeric user identifier."},"email":{"type":"string","title":"Email","description":"User email address."},"role":{"type":"string","title":"Role","description":"Assigned authorization role."}},"type":"object","required":["id","email","role"],"title":"AdminUserInfo"},"AdminUserRecord":{"properties":{"id":{"type":"integer","title":"Id","description":"Numeric user identifier."},"email":{"type":"string","title":"Email","description":"User email address."},"role":{"type":"string","title":"Role","description":"Assigned authorization role."},"is_active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Is Active","description":"Whether the user is currently active."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"Creation timestamp as returned by the admin store."},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last-update timestamp as returned by the admin store."}},"type":"object","required":["id","email","role"],"title":"AdminUserRecord"},"AdminUsersListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/AdminUserRecord"},"type":"array","title":"Users","description":"Managed users visible to the caller."}},"type":"object","title":"AdminUsersListResponse"},"AllApiKeyRecord":{"properties":{"id":{"type":"integer","title":"Id","description":"Key identifier."},"user_id":{"type":"integer","title":"User Id","description":"Owner user ID."},"user_email":{"type":"string","title":"User Email","description":"Owner email."},"key_prefix":{"type":"string","title":"Key Prefix","description":"First 12 characters of the key."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Optional key label."},"created_at":{"type":"string","title":"Created At","description":"Creation timestamp."},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At","description":"Last use timestamp."}},"type":"object","required":["id","user_id","user_email","key_prefix","created_at"],"title":"AllApiKeyRecord"},"AllApiKeysListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/AllApiKeyRecord"},"type":"array","title":"Keys","description":"All active API keys in the system."}},"type":"object","required":["keys"],"title":"AllApiKeysListResponse"},"AllCookiesStatusResponse":{"properties":{"platforms":{"additionalProperties":{"$ref":"#/components/schemas/PlatformCookieStatus"},"type":"object","title":"Platforms","description":"Cookie status keyed by supported platform identifier."}},"type":"object","title":"AllCookiesStatusResponse"},"ApiKeyRegenerateResponse":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"The newly generated API key."},"message":{"type":"string","title":"Message","description":"Human-readable summary."}},"type":"object","required":["api_key","message"],"title":"ApiKeyRegenerateResponse"},"ApiKeySettingsResponse":{"properties":{"api_key_required":{"type":"boolean","title":"Api Key Required","description":"Whether API key authentication is currently required for /api/* routes."},"api_key":{"type":"string","title":"Api Key","description":"The active API key (masked for non-superadmin)."},"api_key_source":{"type":"string","title":"Api Key Source","description":"Where the active key comes from: `database`, `env`, or `generated`."}},"type":"object","required":["api_key_required","api_key","api_key_source"],"title":"ApiKeySettingsResponse"},"ApiKeyToggleRequest":{"properties":{"required":{"type":"boolean","title":"Required","description":"Set to true to require API key, false to allow unauthenticated access."}},"type":"object","required":["required"],"title":"ApiKeyToggleRequest","examples":[{"required":true}]},"ApiKeyToggleResponse":{"properties":{"api_key_required":{"type":"boolean","title":"Api Key Required","description":"New state of the API key requirement."},"api_key":{"type":"string","title":"Api Key","description":"The active API key (shown when enabling)."},"message":{"type":"string","title":"Message","description":"Human-readable summary."}},"type":"object","required":["api_key_required","api_key","message"],"title":"ApiKeyToggleResponse"},"ArchiveRequest":{"properties":{"files":{"items":{"type":"string"},"type":"array","title":"Files","description":"Список файлов для архивации"}},"type":"object","title":"ArchiveRequest","example":{"files":["youtube/video-123.mp4","instagram/post-987.jpg"]}},"AuditLogEntry":{"properties":{"id":{"type":"integer","title":"Id","description":"Audit record identifier."},"ts":{"type":"number","title":"Ts","description":"Unix timestamp of the action."},"actor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor","description":"Email of the admin who performed the action (if known)."},"action":{"type":"string","title":"Action","description":"Action identifier, e.g. login_success, api_key_regenerate."},"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target","description":"Action target (user, key prefix, etc.)."},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip","description":"Client IP that performed the action."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail","description":"Extra context."}},"type":"object","required":["id","ts","action"],"title":"AuditLogEntry"},"AuditLogResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/AuditLogEntry"},"type":"array","title":"Entries","description":"Audit-log entries, newest first."}},"type":"object","required":["entries"],"title":"AuditLogResponse"},"AuthActionRequest":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"ID сессии авторизации"},"action":{"type":"string","enum":["click","type","press","goto","scroll","wait","clear_and_type","fill"],"title":"Action","description":"Действие: click, type, press, goto, scroll, wait, clear_and_type, fill"},"selector":{"type":"string","title":"Selector","description":"CSS-селектор элемента","default":""},"text":{"type":"string","title":"Text","description":"Текст для ввода","default":""},"key":{"type":"string","title":"Key","description":"Клавиша для press","default":"Enter"},"x":{"type":"number","title":"X","description":"X координата для click","default":0},"y":{"type":"number","title":"Y","description":"Y координата для click","default":0},"url":{"type":"string","title":"Url","description":"URL для goto (только http/https)","default":""},"direction":{"type":"string","enum":["up","down"],"title":"Direction","description":"Направление scroll: up/down","default":"down"},"ms":{"type":"integer","maximum":5000.0,"minimum":100.0,"title":"Ms","description":"Миллисекунды для wait","default":1000}},"type":"object","required":["session_id","action"],"title":"AuthActionRequest"},"AuthActionResponse":{"properties":{"action":{"type":"string","title":"Action","description":"Browser action that was attempted."},"success":{"type":"boolean","title":"Success","description":"Whether the action completed successfully."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Short error summary when the action fails."},"url":{"type":"string","title":"Url","description":"Current browser URL after the action."},"screenshot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screenshot","description":"Base64-encoded PNG screenshot after the action."},"authenticated":{"type":"boolean","title":"Authenticated","description":"Whether the required platform cookies are already present."},"found_cookies":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Found Cookies","description":"Per-cookie presence flags for the platform auth check."}},"type":"object","required":["action","success","url","authenticated"],"title":"AuthActionResponse"},"AuthCloseResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Interactive auth-session identifier."},"closed":{"type":"boolean","title":"Closed","description":"Whether the session was successfully closed."}},"type":"object","required":["session_id","closed"],"title":"AuthCloseResponse"},"AuthFinishResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Interactive auth-session identifier."},"saved":{"type":"boolean","title":"Saved","description":"Whether cookies were successfully extracted and persisted."},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform","description":"Normalized platform identifier."},"filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filepath","description":"Cookie file path written by the operation."},"cookies_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cookies Count","description":"Number of cookies extracted from the browser context."},"required_cookies":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Required Cookies","description":"Per-cookie requirement satisfaction map."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason the save operation failed, if applicable."},"found":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Found","description":"Per-cookie presence map captured before closing the session."}},"type":"object","required":["session_id","saved"],"title":"AuthFinishResponse"},"AuthScreenshotResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Interactive auth-session identifier."},"screenshot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screenshot","description":"Base64-encoded PNG screenshot."},"url":{"type":"string","title":"Url","description":"Current browser URL."},"authenticated":{"type":"boolean","title":"Authenticated","description":"Whether the required platform cookies are already present."},"found_cookies":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Found Cookies","description":"Per-cookie presence flags for the platform auth check."}},"type":"object","required":["session_id","url","authenticated"],"title":"AuthScreenshotResponse"},"AuthSessionsListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/ActiveAuthSessionInfo"},"type":"array","title":"Sessions","description":"Active interactive auth sessions."},"total":{"type":"integer","title":"Total","description":"Number of active interactive auth sessions."}},"type":"object","required":["total"],"title":"AuthSessionsListResponse"},"AuthStartRequest":{"properties":{"platform":{"type":"string","title":"Platform","description":"Платформа: instagram, facebook, twitter, tiktok, youtube, pinterest"}},"type":"object","required":["platform"],"title":"AuthStartRequest","examples":[{"platform":"instagram"}]},"AuthStartResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Interactive auth-session identifier."},"platform":{"type":"string","title":"Platform","description":"Normalized platform identifier."},"url":{"type":"string","title":"Url","description":"Current browser URL."},"screenshot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screenshot","description":"Base64-encoded PNG screenshot."}},"type":"object","required":["session_id","platform","url"],"title":"AuthStartResponse"},"AuthStatusResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Interactive auth-session identifier."},"platform":{"type":"string","title":"Platform","description":"Normalized platform identifier."},"url":{"type":"string","title":"Url","description":"Current browser URL."},"authenticated":{"type":"boolean","title":"Authenticated","description":"Whether the required platform cookies are already present."},"found_cookies":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Found Cookies","description":"Per-cookie presence flags for the platform auth check."},"total_cookies":{"type":"integer","title":"Total Cookies","description":"Number of cookies currently visible in the browser context."}},"type":"object","required":["session_id","platform","url","authenticated","total_cookies"],"title":"AuthStatusResponse"},"BackupListResponse":{"properties":{"backups":{"items":{"type":"string"},"type":"array","title":"Backups","description":"Backup snapshot prefixes, newest first."}},"type":"object","required":["backups"],"title":"BackupListResponse"},"BackupRunResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","description":"Whether the backup completed successfully."},"prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix","description":"Wasabi key prefix of this snapshot."},"uploaded":{"items":{"type":"string"},"type":"array","title":"Uploaded","description":"Object keys written."},"pruned":{"type":"integer","title":"Pruned","description":"Old snapshots removed by retention.","default":0},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Failure reason, if any."}},"type":"object","required":["ok"],"title":"BackupRunResponse"},"BatchDownloadRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1,"title":"Urls","description":"Список URL для скачивания (макс. 50)"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy","description":"Optional outbound proxy URL shared by all queued downloads."},"download_all":{"type":"boolean","title":"Download All","description":"Whether to fetch all media items from supported multi-item posts.","default":false},"quality":{"type":"string","pattern":"^(max|high|medium|low|audio)$","title":"Quality","description":"Качество: max, high, medium, low, audio (MP3)","default":"max"},"max_items":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Max Items","description":"Макс. кол-во элементов для профиля/плейлиста"}},"type":"object","required":["urls"],"title":"BatchDownloadRequest","examples":[{"download_all":false,"quality":"high","urls":["https://www.youtube.com/watch?v=jNQXAC9IVRw","https://www.tiktok.com/@example/video/1234567890"]}]},"BatchDownloadResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskStatusInfo"},"type":"array","title":"Tasks","description":"Task objects created for every accepted URL."}},"type":"object","required":["tasks"],"title":"BatchDownloadResponse"},"CobaltStatusResponse":{"properties":{"running":{"type":"boolean","title":"Running","description":"Whether a reachable Cobalt instance is available."},"url":{"type":"string","title":"Url","description":"Base URL used by this application to contact Cobalt."},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"Reported Cobalt version, if reachable."},"services":{"items":{"type":"string"},"type":"array","title":"Services","description":"Services/providers reported by Cobalt."},"services_count":{"type":"integer","title":"Services Count","description":"Number of available Cobalt services."}},"type":"object","required":["running","url","services_count"],"title":"CobaltStatusResponse"},"CookiesStatusResponse":{"properties":{"has_cookies_file":{"type":"boolean","title":"Has Cookies File","description":"Whether the primary Instagram cookies file exists and is non-empty."},"cookies_file_path":{"type":"string","title":"Cookies File Path","description":"Resolved path to the primary Instagram cookies file."},"browser_available":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Browser Available","description":"Detected browser name that could be used for cookie import, if known."},"instagram_session":{"type":"boolean","title":"Instagram Session","description":"Whether the cookie file currently exposes a usable Instagram `sessionid`.","default":false}},"type":"object","required":["has_cookies_file","cookies_file_path"],"title":"CookiesStatusResponse"},"DebugExtractResponse":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Extracted media title from the sample probe."},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration","description":"Extracted media duration in seconds."},"uploader":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploader","description":"Extracted uploader or channel name."}},"type":"object","title":"DebugExtractResponse"},"DebugInfoResponse":{"properties":{"yt_dlp_version":{"type":"string","title":"Yt Dlp Version","description":"Installed yt-dlp version."},"ffmpeg_available":{"type":"boolean","title":"Ffmpeg Available","description":"Whether ffmpeg is currently available in PATH."},"ffmpeg_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ffmpeg Version","description":"ffmpeg version banner when available."},"cookies_configured":{"type":"boolean","title":"Cookies Configured","description":"Whether the primary Instagram cookies file exists."},"test_extract":{"anyOf":[{"$ref":"#/components/schemas/DebugExtractResponse"},{"type":"null"}],"description":"Result of the sample extractor probe, if successful."},"test_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Error","description":"Short error summary when the sample extractor probe fails."}},"type":"object","required":["yt_dlp_version","ffmpeg_available","cookies_configured"],"title":"DebugInfoResponse"},"DeleteResponse":{"properties":{"deleted":{"type":"string","title":"Deleted","description":"Identifier of the deleted resource or `ALL` for bulk deletion."}},"type":"object","required":["deleted"],"title":"DeleteResponse"},"DownloadMethodInfo":{"properties":{"name":{"type":"string","title":"Name","description":"Method identifier."},"description":{"type":"string","title":"Description","description":"Human-readable explanation of the method."},"available":{"type":"boolean","title":"Available","description":"Whether the method is currently available for use."},"has_cookies":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Cookies","description":"Whether compatible cookies are currently available."},"sessions_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sessions Count","description":"Number of loaded sessions relevant to this method."},"has_credentials":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Credentials","description":"Whether explicit credentials are configured for this method."},"has_session_file":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Session File","description":"Whether the method has a persisted session/settings file."}},"type":"object","required":["name","description","available"],"title":"DownloadMethodInfo"},"DownloadRequest":{"properties":{"url":{"type":"string","minLength":5,"title":"Url","description":"URL медиа для скачивания"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy","description":"Optional outbound proxy URL to use for this download."},"download_all":{"type":"boolean","title":"Download All","description":"Whether to fetch all media items from supported multi-item posts.","default":false},"quality":{"type":"string","pattern":"^(max|high|medium|low|audio)$","title":"Quality","description":"Качество: max, high, medium, low, audio (MP3)","default":"max"},"max_items":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Max Items","description":"Макс. кол-во элементов для профиля/плейлиста (по умолчанию 50)"}},"type":"object","required":["url"],"title":"DownloadRequest","examples":[{"download_all":false,"max_items":20,"quality":"max","url":"https://www.instagram.com/p/Cx12345abc/"}]},"FileInfo":{"properties":{"name":{"type":"string","title":"Name","description":"Relative filename or path."},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes."},"size_human":{"type":"string","title":"Size Human","description":"Human-readable file size."},"modified":{"type":"number","title":"Modified","description":"Unix timestamp of the last modification time."},"media_type":{"type":"string","title":"Media Type","description":"Best-effort media classification.","default":"unknown"},"source_profile":{"type":"string","title":"Source Profile","description":"Profile/channel name the file was downloaded from (extracted from path).","default":""},"source_platform":{"type":"string","title":"Source Platform","description":"Platform folder the file belongs to (e.g. Instagram, TikTok, YouTube).","default":""},"wasabi":{"type":"boolean","title":"Wasabi","description":"True when the file exists only in Wasabi (deleted locally).","default":false},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url","description":"API path to download this file, e.g. `/api/v1/files/{name}`."},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url","description":"API path to the video thumbnail (video files only)."},"source_url":{"type":"string","title":"Source Url","description":"Original media URL on the source platform.","default":""},"profile_url":{"type":"string","title":"Profile Url","description":"Profile/channel URL of the content author on the source platform.","default":""}},"type":"object","required":["name","size_bytes","size_human","modified"],"title":"FileInfo"},"FilesListResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Number of files in the response after filtering."},"files":{"items":{"$ref":"#/components/schemas/FileInfo"},"type":"array","title":"Files","description":"File metadata entries."}},"type":"object","required":["total","files"],"title":"FilesListResponse"},"GalleryCreateRequest":{"properties":{"files":{"items":{"type":"string"},"type":"array","title":"Files","description":"Relative file paths to include in the gallery"},"title":{"type":"string","maxLength":120,"title":"Title","description":"Optional display title for the gallery","default":""}},"type":"object","required":["files"],"title":"GalleryCreateRequest"},"GalleryResponse":{"properties":{"token":{"type":"string","title":"Token","description":"Unique token identifying the gallery"},"url":{"type":"string","title":"Url","description":"Public URL to access the gallery"}},"type":"object","required":["token","url"],"title":"GalleryResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Top-level service status."},"version":{"type":"string","title":"Version","description":"Application version."},"uptime_seconds":{"type":"number","title":"Uptime Seconds","description":"Seconds since the process started."},"download_dir":{"type":"string","title":"Download Dir","description":"Absolute path to the active download directory."},"total_files":{"type":"integer","title":"Total Files","description":"Total number of files currently present in the download directory."},"total_size_human":{"type":"string","title":"Total Size Human","description":"Human-readable cumulative size of all downloaded files."},"active_tasks":{"type":"integer","title":"Active Tasks","description":"Number of currently active background tasks."},"proxy_pool":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Proxy Pool","description":"Embedded proxy-pool statistics snapshot."},"ffmpeg_available":{"type":"boolean","title":"Ffmpeg Available","description":"Whether ffmpeg is currently available in PATH.","default":false},"cookies_configured":{"type":"boolean","title":"Cookies Configured","description":"Whether the primary Instagram cookies file exists.","default":false},"instagram_sessions":{"type":"integer","title":"Instagram Sessions","description":"Number of loaded Instagram session files.","default":0},"instagrapi_available":{"type":"boolean","title":"Instagrapi Available","description":"Whether the optional instagrapi dependency is available.","default":false},"download_methods":{"items":{"type":"string"},"type":"array","title":"Download Methods","description":"Current download-method cascade in preference order."},"redis_connected":{"type":"boolean","title":"Redis Connected","description":"Whether the configured Redis endpoint responded successfully.","default":false},"wasabi_configured":{"type":"boolean","title":"Wasabi Configured","description":"Whether Wasabi/S3 integration is configured.","default":false},"wasabi_bucket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wasabi Bucket","description":"Configured Wasabi bucket name, if enabled."},"platform_info":{"additionalProperties":true,"type":"object","title":"Platform Info","description":"Runtime platform details such as OS, release, Python version, and architecture."}},"type":"object","required":["status","version","uptime_seconds","download_dir","total_files","total_size_human","active_tasks"],"title":"HealthResponse"},"HistoryClearResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Clear-operation outcome."},"cleared":{"type":"integer","title":"Cleared","description":"Number of history entries removed."}},"type":"object","required":["status","cleared"],"title":"HistoryClearResponse"},"HistoryEntry":{"properties":{"url":{"type":"string","title":"Url","description":"Original media URL."},"platform":{"type":"string","title":"Platform","description":"Detected platform identifier."},"status":{"type":"string","title":"Status","description":"Final result status, typically `success` or `error`."},"info":{"type":"string","title":"Info","description":"Human-readable completion summary."},"files":{"items":{"type":"string"},"type":"array","title":"Files","description":"Relative paths of files produced by the attempt."},"timestamp":{"type":"number","title":"Timestamp","description":"Unix timestamp when the history record was stored."},"elapsed_seconds":{"type":"number","title":"Elapsed Seconds","description":"Runtime of the completed attempt in seconds."},"total_items":{"type":"integer","title":"Total Items","description":"Total items determined for download (e.g. videos in account).","default":0},"downloaded_items":{"type":"integer","title":"Downloaded Items","description":"How many items were actually downloaded.","default":0},"source_url":{"type":"string","title":"Source Url","description":"Original media URL on the source platform.","default":""},"profile_url":{"type":"string","title":"Profile Url","description":"Profile/channel URL of the content author on the source platform.","default":""}},"type":"object","required":["url","platform","status","info","files","timestamp","elapsed_seconds"],"title":"HistoryEntry"},"HistoryListResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total number of matching history entries before pagination."},"offset":{"type":"integer","title":"Offset","description":"Pagination offset applied to the result set."},"limit":{"type":"integer","title":"Limit","description":"Pagination limit applied to the result set."},"entries":{"items":{"$ref":"#/components/schemas/HistoryEntry"},"type":"array","title":"Entries","description":"History entries in the current page."}},"type":"object","required":["total","offset","limit"],"title":"HistoryListResponse"},"ImportBrowserCookiesResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Import outcome."},"browser":{"type":"string","title":"Browser","description":"Browser the cookies were imported from."},"cookies_file":{"type":"string","title":"Cookies File","description":"Target Netscape-format cookie file path."},"message":{"type":"string","title":"Message","description":"Human-readable import summary."}},"type":"object","required":["status","browser","cookies_file","message"],"title":"ImportBrowserCookiesResponse"},"InstagramSessionInfo":{"properties":{"name":{"type":"string","title":"Name","description":"Logical session name."},"available":{"type":"boolean","title":"Available","description":"Whether the session is currently eligible for use."},"fail_count":{"type":"integer","title":"Fail Count","description":"Consecutive failure counter tracked for the session."},"blocked_remaining_sec":{"type":"integer","title":"Blocked Remaining Sec","description":"Seconds remaining before the session becomes usable again."},"last_used_ago_sec":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Used Ago Sec","description":"Seconds since the session was last used."},"has_sessionid":{"type":"boolean","title":"Has Sessionid","description":"Whether the backing cookie file contains an Instagram `sessionid`."}},"type":"object","required":["name","available","fail_count","blocked_remaining_sec","has_sessionid"],"title":"InstagramSessionInfo"},"ManualCookiesRequest":{"properties":{"sessionid":{"type":"string","minLength":10,"title":"Sessionid","description":"Instagram sessionid cookie"},"csrftoken":{"type":"string","title":"Csrftoken","description":"Instagram csrftoken (опционально)","default":""},"ds_user_id":{"type":"string","title":"Ds User Id","description":"Instagram ds_user_id (опционально)","default":""}},"type":"object","required":["sessionid"],"title":"ManualCookiesRequest","examples":[{"csrftoken":"abcdef1234567890abcdef1234567890","ds_user_id":"12345678","sessionid":"12345678%3AAbCdEfGhIjKlMn%3A12"}]},"ManualCookiesResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Persistence outcome."},"cookies_file":{"type":"string","title":"Cookies File","description":"Target Netscape-format cookie file path."},"session_count":{"type":"integer","title":"Session Count","description":"Number of Instagram sessions visible after reload."},"message":{"type":"string","title":"Message","description":"Human-readable persistence summary."}},"type":"object","required":["status","cookies_file","session_count","message"],"title":"ManualCookiesResponse"},"MethodsResponse":{"properties":{"methods":{"items":{"$ref":"#/components/schemas/DownloadMethodInfo"},"type":"array","title":"Methods","description":"Availability snapshot for each download method."},"cascade_order":{"items":{"type":"string"},"type":"array","title":"Cascade Order","description":"Current fallback order used by the downloader."}},"type":"object","required":["methods","cascade_order"],"title":"MethodsResponse"},"OllamaModelInfo":{"properties":{"name":{"type":"string","title":"Name","description":"Model identifier reported by the Ollama server."},"size_gb":{"type":"number","title":"Size Gb","description":"Approximate model size in gigabytes."},"parameter_size":{"type":"string","title":"Parameter Size","description":"Parameter-size descriptor, if supplied by Ollama."},"quantization":{"type":"string","title":"Quantization","description":"Quantization descriptor, if supplied by Ollama."}},"type":"object","required":["name","size_gb","parameter_size","quantization"],"title":"OllamaModelInfo"},"OllamaServerStatus":{"properties":{"available":{"type":"boolean","title":"Available","description":"Whether the Ollama endpoint responded successfully."},"models":{"items":{"$ref":"#/components/schemas/OllamaModelInfo"},"type":"array","title":"Models","description":"Models visible on the endpoint."},"model_count":{"type":"integer","title":"Model Count","description":"Number of reported models."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Short error summary when the endpoint is unavailable."}},"type":"object","required":["available","model_count"],"title":"OllamaServerStatus"},"OllamaStatusResponse":{"properties":{"servers":{"additionalProperties":{"$ref":"#/components/schemas/OllamaServerStatus"},"type":"object","title":"Servers","description":"Availability and model catalog keyed by Ollama base URL."},"default_model":{"type":"string","title":"Default Model","description":"Default model configured for AML extraction workloads."}},"type":"object","required":["default_model"],"title":"OllamaStatusResponse"},"PlatformCookieStatus":{"properties":{"has_file":{"type":"boolean","title":"Has File","description":"Whether a cookie file exists for the platform."},"filepath":{"type":"string","title":"Filepath","description":"Resolved cookie file path."},"has_auth":{"type":"boolean","title":"Has Auth","description":"Whether the stored cookies appear sufficient for authenticated access."},"cookies_count":{"type":"integer","title":"Cookies Count","description":"Number of cookies present in the file."},"cookie_names":{"items":{"type":"string"},"type":"array","title":"Cookie Names","description":"Cookie names discovered in the file."}},"type":"object","required":["has_file","filepath","has_auth","cookies_count"],"title":"PlatformCookieStatus"},"PlatformCookiesRequest":{"properties":{"platform":{"type":"string","title":"Platform","description":"Платформа: twitter, tiktok, facebook, youtube, pinterest, instagram"},"cookies":{"additionalProperties":{"type":"string"},"type":"object","minProperties":1,"title":"Cookies","description":"Словарь cookies {имя: значение}"}},"type":"object","required":["platform","cookies"],"title":"PlatformCookiesRequest","description":"Универсальный запрос для сохранения cookies любой платформы.","examples":[{"cookies":{"sessionid":"abc123def456","tt_webid_v2":"7123456789012345678"},"platform":"tiktok"}]},"PlatformCookiesResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Persistence outcome."},"platform":{"type":"string","title":"Platform","description":"Normalized platform identifier."},"cookies_file":{"type":"string","title":"Cookies File","description":"Target Netscape-format cookie file path."},"cookies_saved":{"type":"integer","title":"Cookies Saved","description":"Number of cookies persisted."},"message":{"type":"string","title":"Message","description":"Human-readable persistence summary."}},"type":"object","required":["status","platform","cookies_file","cookies_saved","message"],"title":"PlatformCookiesResponse"},"ProfileInfo":{"properties":{"profile":{"type":"string","title":"Profile","description":"Profile or channel name."},"platform":{"type":"string","title":"Platform","description":"Platform folder (e.g. Instagram, TikTok)."},"file_count":{"type":"integer","title":"File Count","description":"Number of files from this profile."},"total_bytes":{"type":"integer","title":"Total Bytes","description":"Total size of files from this profile."}},"type":"object","required":["profile","platform","file_count","total_bytes"],"title":"ProfileInfo"},"ProfilesListResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Number of unique profiles."},"profiles":{"items":{"$ref":"#/components/schemas/ProfileInfo"},"type":"array","title":"Profiles","description":"Profile summaries."}},"type":"object","required":["total","profiles"],"title":"ProfilesListResponse"},"ProxyInfo":{"properties":{"address":{"type":"string","title":"Address","description":"Proxy address in host:port format."},"speed_ms":{"type":"integer","title":"Speed Ms","description":"Measured response time of the proxy in milliseconds."},"verified_ago_sec":{"type":"number","title":"Verified Ago Sec","description":"How long ago the proxy was last verified."},"protocol":{"type":"string","title":"Protocol","description":"Proxy protocol: http, socks4, or socks5."},"https_tunnel":{"type":"boolean","title":"Https Tunnel","description":"Whether the proxy supports HTTPS tunneling."},"country_code":{"type":"string","title":"Country Code","description":"ISO 3166-1 alpha-2 country code (e.g. US).","default":""},"country_name":{"type":"string","title":"Country Name","description":"Full country name.","default":""}},"type":"object","required":["address","speed_ms","verified_ago_sec","protocol","https_tunnel"],"title":"ProxyInfo"},"ProxyStatsResponse":{"properties":{"total_parsed":{"type":"integer","title":"Total Parsed","description":"Total proxies parsed from configured sources during refresh cycles."},"verified_pool_size":{"type":"integer","title":"Verified Pool Size","description":"Number of currently verified and usable proxies."},"https_capable":{"type":"integer","title":"Https Capable","description":"How many verified proxies support HTTPS."},"socks5_count":{"type":"integer","title":"Socks5 Count","description":"How many verified proxies use SOCKS5."},"socks4_count":{"type":"integer","title":"Socks4 Count","description":"How many verified proxies use SOCKS4.","default":0},"blacklisted":{"type":"integer","title":"Blacklisted","description":"How many proxies are temporarily blacklisted due to failures."},"dead_purged_total":{"type":"integer","title":"Dead Purged Total","description":"Total number of dead proxies purged from the pool."},"avg_speed_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Speed Ms","description":"Average proxy speed in milliseconds."},"fastest_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fastest Ms","description":"Best observed proxy speed in milliseconds."},"last_refresh_ago_sec":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Refresh Ago Sec","description":"Seconds since the last full proxy refresh."},"refresh_cycles":{"type":"integer","title":"Refresh Cycles","description":"Number of background refresh cycles executed since startup."},"active_assignments":{"additionalProperties":{"type":"string"},"type":"object","title":"Active Assignments","description":"Currently pinned proxies by target or consumer."},"refresh_interval_sec":{"type":"integer","title":"Refresh Interval Sec","description":"Configured background refresh interval in seconds."},"sources_count":{"type":"integer","title":"Sources Count","description":"Number of proxy sources currently configured."},"top_proxies":{"items":{"$ref":"#/components/schemas/ProxyInfo"},"type":"array","title":"Top Proxies","description":"Top verified proxies sorted by current quality."},"refreshing":{"type":"boolean","title":"Refreshing","description":"True while a background refresh cycle is executing.","default":false},"refresh_started_ago_sec":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Refresh Started Ago Sec","description":"Seconds since the current refresh cycle started (only set while refreshing=true)."}},"type":"object","required":["total_parsed","verified_pool_size","https_capable","socks5_count","blacklisted","dead_purged_total","refresh_cycles","refresh_interval_sec","sources_count"],"title":"ProxyStatsResponse"},"SessionAddResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Registration outcome."},"name":{"type":"string","title":"Name","description":"Logical name of the session that was added."},"total":{"type":"integer","title":"Total","description":"Total number of configured sessions after the add operation."}},"type":"object","required":["status","name","total"],"title":"SessionAddResponse"},"SessionsListResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Number of configured sessions."},"sessions":{"items":{"$ref":"#/components/schemas/InstagramSessionInfo"},"type":"array","title":"Sessions","description":"Session status records."},"instagrapi_available":{"type":"boolean","title":"Instagrapi Available","description":"Whether the optional instagrapi dependency is available."},"instagrapi_configured":{"type":"boolean","title":"Instagrapi Configured","description":"Whether instagrapi credentials are configured."}},"type":"object","required":["total","instagrapi_available","instagrapi_configured"],"title":"SessionsListResponse"},"SessionsReloadResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Reload outcome."},"total":{"type":"integer","title":"Total","description":"Number of sessions loaded after reload."},"sessions":{"items":{"$ref":"#/components/schemas/InstagramSessionInfo"},"type":"array","title":"Sessions","description":"Session status records after reload."}},"type":"object","required":["status","total"],"title":"SessionsReloadResponse"},"SuperadminCreateKeyRequest":{"properties":{"user_id":{"type":"integer","title":"User Id","description":"ID of the user to create the key for."},"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Label","description":"Optional label."}},"type":"object","required":["user_id"],"title":"SuperadminCreateKeyRequest"},"TaskCancelResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Task identifier."},"cancelled":{"type":"boolean","title":"Cancelled","description":"Whether the task was actually transitioned into a cancelled/error state."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason the task could not be cancelled, if applicable."}},"type":"object","required":["id","cancelled"],"title":"TaskCancelResponse"},"TaskStatusInfo":{"properties":{"id":{"type":"string","title":"Id","description":"Task identifier."},"url":{"type":"string","title":"Url","description":"Original media URL."},"status":{"type":"string","enum":["pending","downloading","uploading","completed","error"],"title":"Status","description":"Current task status. `pending` — queued, `downloading` — in progress, `uploading` — transferring to object storage, `completed` — finished, `error` — failed."},"progress":{"type":"number","title":"Progress","description":"Progress value between 0 and 100."},"info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info","description":"Human-readable progress or completion message."},"files":{"items":{"type":"string"},"type":"array","title":"Files","description":"Relative paths of files already produced by the task."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message when the task fails or is cancelled."},"platform":{"type":"string","title":"Platform","description":"Detected platform identifier."},"created_at":{"type":"number","title":"Created At","description":"Unix timestamp when the task was created."},"elapsed_seconds":{"type":"number","title":"Elapsed Seconds","description":"Task age or total runtime in seconds."},"total_items":{"type":"integer","title":"Total Items","description":"Expected item count for playlist/profile-style downloads.","default":0},"downloaded_items":{"type":"integer","title":"Downloaded Items","description":"How many items have already been downloaded.","default":0},"wasabi_urls":{"additionalProperties":{"type":"string"},"type":"object","title":"Wasabi Urls","description":"Presigned URLs for Wasabi-uploaded files"},"status_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Message","description":"Current step/stage description (updated in real-time during download)."},"source_url":{"type":"string","title":"Source Url","description":"Original media URL on the source platform.","default":""},"profile_url":{"type":"string","title":"Profile Url","description":"Profile/channel URL of the content author on the source platform.","default":""}},"type":"object","required":["id","url","status","progress","platform","created_at","elapsed_seconds"],"title":"TaskStatusInfo","examples":[{"created_at":1700000000.0,"downloaded_items":1,"elapsed_seconds":4.2,"files":["instagram/Cx12345abc.mp4"],"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","info":"Downloaded 1 file","platform":"instagram","progress":100.0,"status":"completed","total_items":1,"url":"https://www.instagram.com/p/Cx12345abc/","wasabi_urls":{}}]},"TasksListResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total number of matching tasks before pagination."},"offset":{"type":"integer","title":"Offset","description":"Pagination offset applied to the result set."},"limit":{"type":"integer","title":"Limit","description":"Pagination limit applied to the result set."},"tasks":{"items":{"$ref":"#/components/schemas/TaskStatusInfo"},"type":"array","title":"Tasks","description":"Task records in the current page."}},"type":"object","required":["total","offset","limit"],"title":"TasksListResponse"},"UserApiKeyCreateRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Label","description":"Optional label to identify this key."}},"type":"object","title":"UserApiKeyCreateRequest"},"UserApiKeyCreatedResponse":{"properties":{"key":{"type":"string","title":"Key","description":"Full API key — save this now, it will NOT be shown again."},"record":{"$ref":"#/components/schemas/UserApiKeyRecord","description":"Key metadata."}},"type":"object","required":["key","record"],"title":"UserApiKeyCreatedResponse"},"UserApiKeyRecord":{"properties":{"id":{"type":"integer","title":"Id","description":"Key identifier."},"key_prefix":{"type":"string","title":"Key Prefix","description":"First 12 characters of the key for identification."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Optional label for this key."},"created_at":{"type":"string","title":"Created At","description":"Creation timestamp."},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At","description":"Last use timestamp."}},"type":"object","required":["id","key_prefix","created_at"],"title":"UserApiKeyRecord"},"UserApiKeyRevokeResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","description":"Revocation outcome."},"id":{"type":"integer","title":"Id","description":"Revoked key ID."}},"type":"object","required":["status","id"],"title":"UserApiKeyRevokeResponse"},"UserApiKeysListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/UserApiKeyRecord"},"type":"array","title":"Keys","description":"Active API keys for this user."}},"type":"object","required":["keys"],"title":"UserApiKeysListResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ErrorResponse":{"properties":{"detail":{"description":"Human-readable error message suitable for logs and debugging.","title":"Detail","type":"string"}},"required":["detail"],"title":"ErrorResponse","type":"object"}},"securitySchemes":{"ApiKeyHeaderAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Primary API key transport for non-admin API routes."},"LegacyApiKeyQueryAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Legacy API key transport kept only for backward compatibility. Prefer `X-API-Key`."},"AdminTokenAuth":{"type":"apiKey","in":"header","name":"X-Admin-Token","description":"Admin session token returned by `POST /api/v1/admin/login`."}},"responses":{"ApiKeyUnauthorized":{"description":"Missing or invalid API key for a protected route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"API key is required. Pass it in X-API-Key."}}}},"AdminUnauthorized":{"description":"Missing or invalid admin session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Authorization required. Pass the token in X-Admin-Token."}}}},"Forbidden":{"description":"Authenticated but not allowed to perform the requested action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Insufficient permissions."}}}},"BadRequest":{"description":"Request was syntactically valid but could not be processed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"The request payload is incomplete or invalid for this operation."}}}},"NotFound":{"description":"Requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Requested resource was not found."}}}},"Conflict":{"description":"Request conflicts with existing server state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Resource already exists."}}}},"InternalError":{"description":"Unexpected server-side failure while processing the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Internal server error."}}}},"RateLimited":{"description":"Too many requests from the current client.","headers":{"Retry-After":{"description":"Seconds until a new request may be retried.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Per-minute request quota applied by the server.","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Remaining requests within the current rate-limit window.","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Unix timestamp for the next rate-limit window reset.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Too many requests. Please wait a minute."}}}},"ValidationFailed":{"description":"Request body, query string, or path parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"tags":[{"name":"system","description":"Health, diagnostics, runtime capabilities, and external dependency status."},{"name":"download","description":"Asynchronous download orchestration, task polling, and cancellation."},{"name":"files","description":"Downloaded file listing, retrieval, archival, and cleanup operations."},{"name":"history","description":"Download audit trail for successful and failed jobs."},{"name":"cookies","description":"Platform cookie import, status, and storage endpoints."},{"name":"sessions","description":"Instagram multi-session management backed by cookie files."},{"name":"auth","description":"Interactive browser automation used to establish authenticated platform sessions."},{"name":"admin","description":"Administrative authentication and user management."}],"servers":[{"url":"https://medialoader.69media.pro","description":"Production server"},{"url":"http://localhost:18652","description":"Local development"}]}