### Start Nginx with Docker Compose Source: https://docs.bedolagam.ru/getting-started/docker-deployment Command to start the Nginx Docker container after SSL certificate setup. ```bash docker compose up -d ``` -------------------------------- ### Full Configuration Example Source: https://docs.bedolagam.ru/bot/traffic-monitoring This is a comprehensive example of the environment variables used to configure the traffic monitoring system. It covers global settings, fast and daily checks, node monitoring, exclusions, notifications, and performance parameters. ```env # Глобальный переключатель TRAFFIC_MONITORING_ENABLED=true # Быстрая проверка: каждые 5 минут, порог 3 ГБ TRAFFIC_FAST_CHECK_ENABLED=true TRAFFIC_FAST_CHECK_INTERVAL_MINUTES=5 TRAFFIC_FAST_CHECK_THRESHOLD_GB=3.0 # Ежедневная проверка: в полночь, порог 30 ГБ TRAFFIC_DAILY_CHECK_ENABLED=true TRAFFIC_DAILY_CHECK_TIME=00:00 TRAFFIC_DAILY_THRESHOLD_GB=30.0 # Мониторить только определённые ноды TRAFFIC_MONITORED_NODES=uuid-prod-node-1,uuid-prod-node-2 # Исключить сервисные аккаунты TRAFFIC_EXCLUDED_USER_UUIDS=uuid-tunnel-account # Уведомления: кулдаун 30 минут, в отдельный топик TRAFFIC_NOTIFICATION_COOLDOWN_MINUTES=30 SUSPICIOUS_NOTIFICATIONS_TOPIC_ID=123 # Производительность TRAFFIC_CHECK_BATCH_SIZE=500 TRAFFIC_CHECK_CONCURRENCY=5 TRAFFIC_SNAPSHOT_TTL_HOURS=48 ``` -------------------------------- ### Retrieve Landing Page Configuration via API Source: https://docs.bedolagam.ru/cabinet/landings Example response from the public GET /landing/config/{slug} endpoint. ```json { "slug": "promo-2025", "title": "Быстрый VPN", "subtitle": "Безопасное подключение", "features": [...], "footer_text": "...", "gift_enabled": true, "custom_css": null, "tariffs": [ { "id": 15, "name": "Стандарт", "periods": [ {"days": 30, "price_kopeks": 30000}, {"days": 90, "price_kopeks": 80000} ] } ], "payment_methods": [ { "method_id": "yookassa", "display_name": "ЮKassa", "sub_options": [ {"id": "card", "name": "Карта"}, {"id": "sbp", "name": "СБП"} ] } ], "discount": { "percent": 20, "ends_at": "2025-12-31T23:59:59Z", "badge_text": "Новогодняя скидка!" } } ``` -------------------------------- ### GET /partner/settings Source: https://docs.bedolagam.ru/api-reference/cabinet-admin-partners/get-partner-settings Retrieves the current system settings for a partner. ```APIDOC ## GET /partner/settings ### Description Retrieves the current system settings for a partner. ### Method GET ### Endpoint /partner/settings ### Response #### Success Response (200) - **settings** (object) - The configuration settings for the partner. ``` -------------------------------- ### Complete .env Configuration for Multiple OAuth Providers Source: https://docs.bedolagam.ru/cabinet/oauth-setup Example .env file demonstrating the configuration for multiple OAuth providers including Google, Yandex, Discord, and VK. Ensure all required keys and secrets are correctly populated. ```env # === CABINET === CABINET_ENABLED=true CABINET_URL=https://cabinet.example.com CABINET_JWT_SECRET=your_jwt_secret_here CABINET_ALLOWED_ORIGINS=https://cabinet.example.com # === OAUTH === # Google OAUTH_GOOGLE_ENABLED=true OAUTH_GOOGLE_CLIENT_ID=123456789-abcdefg.apps.googleusercontent.com OAUTH_GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxx # Яндекс OAUTH_YANDEX_ENABLED=true OAUTH_YANDEX_CLIENT_ID=abcdef1234567890 OAUTH_YANDEX_CLIENT_SECRET=yandex_secret # Discord OAUTH_DISCORD_ENABLED=true OAUTH_DISCORD_CLIENT_ID=1234567890123456789 OAUTH_DISCORD_CLIENT_SECRET=discord_secret # VK OAUTH_VK_ENABLED=true OAUTH_VK_CLIENT_ID=12345678 OAUTH_VK_CLIENT_SECRET=vk_secret ``` -------------------------------- ### Verify Discount Configuration via API Source: https://docs.bedolagam.ru/cabinet/landings Command to fetch and inspect the discount object for a specific landing page. ```bash curl -s https://cabinet.example.com/api/landing/config/{slug} | jq '.discount' ``` -------------------------------- ### GET /cabinet/admin/traffic/enrichment Source: https://docs.bedolagam.ru/api-reference/admin-traffic/get-traffic-enrichment Retrieves traffic enrichment data for administrators. This includes information such as the number of connected devices, total spending in kopeks, subscription start and end dates, and the name of the last used node. ```APIDOC ## GET /cabinet/admin/traffic/enrichment ### Description Retrieves traffic enrichment data, including device counts, spending, subscription dates, and the last node used. ### Method GET ### Endpoint /cabinet/admin/traffic/enrichment ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **data** (object) - An object containing enrichment data for each user. The keys are user identifiers, and the values are UserTrafficEnrichment objects. ##### UserTrafficEnrichment Object - **devices_connected** (integer) - The number of devices connected. - **total_spent_kopeks** (integer) - The total amount spent in kopeks. - **subscription_start_date** (string | null) - The start date of the subscription. - **subscription_end_date** (string | null) - The end date of the subscription. - **last_node_name** (string | null) - The name of the last node used. #### Response Example ```json { "data": { "user123": { "devices_connected": 2, "total_spent_kopeks": 5000, "subscription_start_date": "2023-01-01", "subscription_end_date": "2024-01-01", "last_node_name": "node-a" }, "user456": { "devices_connected": 1, "total_spent_kopeks": 1500, "subscription_start_date": null, "subscription_end_date": null, "last_node_name": "node-b" } } } ``` ``` -------------------------------- ### Install Certbot Source: https://docs.bedolagam.ru/getting-started/docker-deployment Command to install Certbot on a Debian/Ubuntu based system for obtaining SSL certificates. ```bash sudo apt update && sudo apt install certbot -y ``` -------------------------------- ### GET /cabinet/info/public-offer Source: https://docs.bedolagam.ru/api-reference/cabinet-info/get-public-offer Retrieves the public offer content. This endpoint allows you to get the current public offer document. ```APIDOC ## GET /cabinet/info/public-offer ### Description Get public offer. ### Method GET ### Endpoint /cabinet/info/public-offer ### Parameters #### Query Parameters - **language** (string) - Optional - The language code for the public offer. Defaults to 'ru'. Must be between 2 and 10 characters long. ### Response #### Success Response (200) - **content** (string) - The content of the public offer. - **updated_at** (string or null) - The timestamp when the public offer was last updated. #### Response Example ```json { "content": "This is the public offer content.", "updated_at": "2023-10-27T10:00:00Z" } ``` #### Error Response (422) - **detail** (array) - A list of validation errors. #### Response Example ```json { "detail": [ { "loc": ["query", "language"], "msg": "invalid_choice", "type": "value_error", "input": "en-US", "ctx": {"choices": ["ru"]} } ] } ``` ``` -------------------------------- ### POST /miniapp/subscription/tariff/switch/preview Source: https://docs.bedolagam.ru/api-reference/miniapp/preview-tariff-switch-endpoint Preview the switch of a subscription tariff for a miniapp. ```APIDOC ## POST /miniapp/subscription/tariff/switch/preview ### Description This endpoint allows you to preview the changes associated with switching a subscription tariff within the miniapp context. ### Method POST ### Endpoint /miniapp/subscription/tariff/switch/preview ### Parameters #### Request Body - **tariff_id** (integer) - Required - The ID of the target tariff to switch to. - **user_id** (integer) - Required - The ID of the user for whom the tariff switch is being previewed. ### Request Example ```json { "tariff_id": 123, "user_id": 456 } ``` ### Response #### Success Response (200) - **preview_data** (object) - Contains details about the tariff switch preview. - **old_tariff** (object) - Information about the current tariff. - **new_tariff** (object) - Information about the target tariff. - **price_change** (number) - The difference in price after switching. - **valid_until** (string) - The date until which the preview is valid. #### Response Example ```json { "preview_data": { "old_tariff": { "id": 101, "name": "Basic Plan" }, "new_tariff": { "id": 123, "name": "Pro Plan" }, "price_change": 15.50, "valid_until": "2024-12-31T23:59:59Z" } } ``` ``` -------------------------------- ### SOCKS5 Proxy URL Examples Source: https://docs.bedolagam.ru/getting-started/proxy-setup Examples of PROXY_URL formats for local and remote SOCKS proxies, including SOCKS4. Ensure the scheme matches your proxy server's capabilities. ```env # Локальный прокси (SSH-туннель) PROXY_URL=socks5://127.0.0.1:1080 # Удалённый прокси с авторизацией PROXY_URL=socks5://user:pass@proxy.example.com:1080 # SOCKS4 PROXY_URL=socks4://proxy.example.com:1080 ``` -------------------------------- ### GET /settings Source: https://docs.bedolagam.ru/api-reference/cabinet-admin-ban-system/get-settings Retrieves all current configuration settings for the Ban System. ```APIDOC ## GET /settings ### Description Retrieves all Ban System settings. ### Method GET ### Endpoint /settings ### Response #### Success Response (200) - **settings** (object) - The complete collection of Ban System configuration settings. ``` -------------------------------- ### POST /servers Source: https://docs.bedolagam.ru/api-reference/servers/create-server-endpoint Creates a new server with the provided details. Requires API key authentication. ```APIDOC ## POST /servers ### Description Creates a new server. ### Method POST ### Endpoint /servers ### Request Body - **squadUuid** (string) - Required - The UUID of the squad. - **displayName** (string) - Required - The display name of the server. - **originalName** (string | null) - Optional - The original name of the server. - **countryCode** (string | null) - Optional - The country code where the server is located. - **priceKopeks** (integer) - Optional - The price of the server in kopeks. Defaults to 0. - **description** (string | null) - Optional - A description for the server. - **maxUsers** (integer | null) - Optional - The maximum number of users allowed on the server. - **isAvailable** (boolean) - Optional - Indicates if the server is available. Defaults to true. - **isTrialEligible** (boolean) - Optional - Indicates if the server is eligible for a trial. Defaults to false. - **sortOrder** (integer) - Optional - The sort order for the server. Defaults to 0. - **promoGroupIds** (array[integer] | null) - Optional - A list of promo group IDs available on the server. ### Request Example ```json { "squadUuid": "string", "displayName": "string", "originalName": null, "countryCode": null, "priceKopeks": 0, "description": null, "maxUsers": null, "isAvailable": true, "isTrialEligible": false, "sortOrder": 0, "promoGroupIds": null } ``` ### Response #### Success Response (201) - **id** (integer) - The unique identifier of the created server. - **squadUuid** (string) - The UUID of the squad. - **displayName** (string) - The display name of the server. - **originalName** (string | null) - The original name of the server. - **countryCode** (string | null) - The country code where the server is located. - **isAvailable** (boolean) - Indicates if the server is available. - **isTrialEligible** (boolean) - Indicates if the server is eligible for a trial. - **priceKopeks** (integer) - The price of the server in kopeks. - **priceRubles** (number) - The price of the server in rubles. - **description** (string | null) - A description for the server. - **sortOrder** (integer) - The sort order for the server. - **maxUsers** (integer | null) - The maximum number of users allowed on the server. - **currentUsers** (integer) - The current number of users on the server. - **createdAt** (string) - The timestamp when the server was created. #### Response Example ```json { "id": 0, "squadUuid": "string", "displayName": "string", "originalName": null, "countryCode": null, "isAvailable": true, "isTrialEligible": false, "priceKopeks": 0, "priceRubles": 0.0, "description": null, "sortOrder": 0, "maxUsers": null, "currentUsers": 0, "createdAt": "string" } ``` #### Error Response (422) - Description: Validation Error - Content: application/json schema referencing '#/components/schemas/HTTPValidationError' ``` -------------------------------- ### GET /webhooks/stats Source: https://docs.bedolagam.ru/api-reference/webhooks/get-webhook-stats Retrieves statistics related to webhooks. ```APIDOC ## GET /webhooks/stats ### Description Retrieves statistics related to webhooks. ### Method GET ### Endpoint /webhooks/stats ### Parameters #### Query Parameters - **start_date** (string) - Optional - The start date for the statistics. - **end_date** (string) - Optional - The end date for the statistics. ### Response #### Success Response (200) - **total_requests** (integer) - The total number of webhook requests. - **successful_requests** (integer) - The number of successfully processed webhook requests. - **failed_requests** (integer) - The number of failed webhook requests. - **average_response_time** (number) - The average response time in milliseconds. #### Response Example ```json { "total_requests": 1500, "successful_requests": 1450, "failed_requests": 50, "average_response_time": 120.5 } ``` ``` -------------------------------- ### GET /settings/{key} Source: https://docs.bedolagam.ru/api-reference/settings/get-setting Retrieves the definition and current state of a specific system setting by its unique key. ```APIDOC ## GET /settings/{key} ### Description Получение значения конкретной настройки по ключу. ### Method GET ### Endpoint /settings/{key} ### Parameters #### Path Parameters - **key** (string) - Required - The unique identifier of the setting. ### Response #### Success Response (200) - **key** (string) - The setting key. - **name** (string) - The display name of the setting. - **category** (object) - The category reference. - **type** (string) - The data type of the setting. - **is_optional** (boolean) - Whether the setting is optional. - **current** (any) - The current value. - **original** (any) - The original value. - **has_override** (boolean) - Whether the setting has an override. - **read_only** (boolean) - Whether the setting is read-only. - **choices** (array) - List of available choices for the setting. #### Response Example { "key": "example_key", "name": "Example Setting", "category": { "key": "general", "label": "General" }, "type": "string", "is_optional": true, "current": "value", "original": "default", "has_override": false, "read_only": false, "choices": [] } ``` -------------------------------- ### GET /stats/full Source: https://docs.bedolagam.ru/api-reference/stats/%D0%BF%D0%BE%D0%BB%D0%BD%D0%B0%D1%8F-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0 Retrieves comprehensive statistics for the system. ```APIDOC ## GET /stats/full ### Description Retrieves comprehensive statistics for the system. ### Method GET ### Endpoint /stats/full ### Parameters #### Query Parameters - **full** (boolean) - Optional - If true, returns full statistics. ### Response #### Success Response (200) - **data** (object) - Contains detailed statistics. - **users_count** (integer) - Total number of users. - **active_users_count** (integer) - Number of active users. - **transactions_count** (integer) - Total number of transactions. - **revenue** (number) - Total revenue generated. #### Response Example ```json { "data": { "users_count": 1000, "active_users_count": 500, "transactions_count": 250, "revenue": 1250.75 } } ``` ``` -------------------------------- ### Установка Node.js через NVM Source: https://docs.bedolagam.ru/cabinet/setup Подготовьте среду Node.js для сборки без Docker. ```bash # Установка NVM curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash source ~/.bashrc # Установка Node.js LTS nvm install --lts ``` -------------------------------- ### GET /stats/overview Source: https://docs.bedolagam.ru/api-reference/stats/%D0%BE%D0%B1%D1%89%D0%B0%D1%8F-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0 Retrieves an overview of system statistics. ```APIDOC ## GET /stats/overview ### Description Retrieves an overview of system statistics. ### Method GET ### Endpoint /stats/overview ### Parameters #### Query Parameters - **date_from** (string) - Optional - Start date for statistics. - **date_to** (string) - Optional - End date for statistics. ### Response #### Success Response (200) - **total_users** (integer) - Total number of users. - **active_users** (integer) - Number of active users. - **new_users** (integer) - Number of new users. - **total_revenue** (number) - Total revenue generated. - **transactions_count** (integer) - Number of transactions. #### Response Example ```json { "total_users": 15000, "active_users": 12000, "new_users": 500, "total_revenue": 75000.50, "transactions_count": 3000 } ``` ``` -------------------------------- ### Configure Subscription Periods and Prices Source: https://docs.bedolagam.ru/bot/subscriptions Set available subscription periods in days and their corresponding prices in kopecks. Base subscription price can also be adjusted. ```env # Доступные периоды (дни, через запятую) AVAILABLE_SUBSCRIPTION_PERIODS=30,90,180 # Доступные периоды для продления (могут отличаться) AVAILABLE_RENEWAL_PERIODS=30,90,180 # Цены за каждый период (в копейках) PRICE_14_DAYS=7000 PRICE_30_DAYS=10000 PRICE_60_DAYS=25900 PRICE_90_DAYS=36900 PRICE_180_DAYS=69900 PRICE_360_DAYS=109900 # Базовая надбавка к цене (в копейках, по умолчанию 0) BASE_SUBSCRIPTION_PRICE=0 ``` -------------------------------- ### GET /remnawave/sync/recommendations Source: https://docs.bedolagam.ru/api-reference/remnawave/get-sync-recommendations Retrieves synchronization recommendations for RemnaWave. ```APIDOC ## GET /remnawave/sync/recommendations ### Description Получение рекомендаций по синхронизации с RemnaWave. ### Method GET ### Endpoint /remnawave/sync/recommendations ### Response #### Success Response (200) - **success** (boolean) - Success status - **detail** (string|null) - Detail information - **data** (object|null) - Sync data #### Response Example { "success": true, "detail": "string", "data": {} } ``` -------------------------------- ### GET /partners/stats Source: https://docs.bedolagam.ru/api-reference/partners/get-global-partner-stats Retrieves statistics related to partners. ```APIDOC ## GET /partners/stats ### Description Retrieves statistics related to partners. ### Method GET ### Endpoint /partners/stats ### Parameters #### Query Parameters - **startDate** (string) - Optional - The start date for the statistics. - **endDate** (string) - Optional - The end date for the statistics. ### Response #### Success Response (200) - **data** (object) - Contains the partner statistics. - **totalPartners** (integer) - The total number of partners. - **activePartners** (integer) - The number of active partners. - **totalReferrals** (integer) - The total number of referrals. - **totalEarnings** (number) - The total earnings from partners. #### Response Example ```json { "data": { "totalPartners": 150, "activePartners": 75, "totalReferrals": 300, "totalEarnings": 15000.50 } } ``` ``` -------------------------------- ### POST /menu-layout/preview Source: https://docs.bedolagam.ru/api-reference/menu-layout/preview-menu Endpoint to generate a preview of the menu based on specific user context parameters. ```APIDOC ## POST /menu-layout/preview ### Description Предпросмотр меню для указанного контекста пользователя. ### Method POST ### Endpoint /menu-layout/preview ### Parameters #### Request Body - **language** (string) - Optional - Язык для предпросмотра (default: ru) - **is_admin** (boolean) - Optional - Режим админа (default: false) - **is_moderator** (boolean) - Optional - Режим модератора (default: false) - **has_active_subscription** (boolean) - Optional - Есть активная подписка (default: false) - **subscription_is_active** (boolean) - Optional - Подписка активна (default: false) - **balance_kopeks** (integer) - Optional - Баланс в копейках (default: 0) ### Request Example { "language": "ru", "is_admin": false, "is_moderator": false, "has_active_subscription": false, "subscription_is_active": false, "balance_kopeks": 0 } ### Response #### Success Response (200) - **rows** (array) - Список строк меню - **total_buttons** (integer) - Общее количество кнопок #### Response Example { "rows": [], "total_buttons": 0 } ``` -------------------------------- ### GET /campaigns/overview Source: https://docs.bedolagam.ru/api-reference/cabinet-admin-campaigns/get-overview Retrieves high-level statistics for campaigns. ```APIDOC ## GET /campaigns/overview ### Description Get campaigns overview statistics. ### Method GET ### Endpoint /campaigns/overview ``` -------------------------------- ### GET /cabinet/admin/payments Source: https://docs.bedolagam.ru/api-reference/cabinet-admin-broadcasts/list-broadcasts Retrieves a list of all payment transactions. ```APIDOC ## GET /cabinet/admin/payments ### Description Retrieves a list of all payment transactions. ### Method GET ### Endpoint /cabinet/admin/payments ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of payments to return. - **offset** (integer) - Optional - The number of payments to skip. - **user_id** (integer) - Optional - Filter payments by user ID. - **status** (string) - Optional - Filter payments by status (e.g., 'completed', 'failed', 'pending'). ### Response #### Success Response (200) - **payments** (array) - A list of payment transaction objects. - **id** (integer) - The unique identifier of the payment. - **user_id** (integer) - The ID of the user who made the payment. - **amount** (number) - The amount of the payment. - **currency** (string) - The currency of the payment. - **status** (string) - The status of the payment. - **created_at** (string) - The timestamp when the payment was created. #### Response Example { "payments": [ { "id": 1001, "user_id": 101, "amount": 19.99, "currency": "USD", "status": "completed", "created_at": "2023-10-26T14:00:00Z" } ] } ``` -------------------------------- ### Создание дампа базы данных Source: https://docs.bedolagam.ru/getting-started/troubleshooting Выполнение ручного дампа PostgreSQL через Docker-контейнер. ```bash docker exec remnawave_bot_db pg_dump -Fc -U postgres remnawave_bot > backup_$(date +%Y%m%d_%H%M%S).dump ``` -------------------------------- ### GET /cabinet/admin/subscriptions Source: https://docs.bedolagam.ru/api-reference/cabinet-admin-broadcasts/list-broadcasts Retrieves a list of all user subscriptions. ```APIDOC ## GET /cabinet/admin/subscriptions ### Description Retrieves a list of all user subscriptions. ### Method GET ### Endpoint /cabinet/admin/subscriptions ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of subscriptions to return. - **offset** (integer) - Optional - The number of subscriptions to skip. - **user_id** (integer) - Optional - Filter subscriptions by user ID. ### Response #### Success Response (200) - **subscriptions** (array) - A list of subscription objects. - **id** (integer) - The unique identifier of the subscription. - **user_id** (integer) - The ID of the user associated with the subscription. - **plan_name** (string) - The name of the subscription plan. - **expires_at** (string) - The expiration date of the subscription. #### Response Example { "subscriptions": [ { "id": 501, "user_id": 101, "plan_name": "Premium", "expires_at": "2024-12-31T23:59:59Z" } ] } ``` -------------------------------- ### Configure Simple Subscription Source: https://docs.bedolagam.ru/bot/interface-settings Enables and defines parameters for the one-click purchase mode. ```env SIMPLE_SUBSCRIPTION_ENABLED=true SIMPLE_SUBSCRIPTION_PERIOD_DAYS=30 SIMPLE_SUBSCRIPTION_DEVICE_LIMIT=1 SIMPLE_SUBSCRIPTION_TRAFFIC_GB=0 ``` -------------------------------- ### Интеграция OpenDKIM с Postfix Source: https://docs.bedolagam.ru/getting-started/smtp-setup Подключите OpenDKIM к Postfix, добавив соответствующие директивы в файл `main.cf`. Это позволит Postfix использовать milter для подписи писем. ```ini # OpenDKIM milter_default_action = accept milter_protocol = 6 smtpd_milters = inet:localhost:8891 non_smtpd_milters = inet:localhost:8891 ``` -------------------------------- ### GET /tokens Source: https://docs.bedolagam.ru/api-reference/auth/get-tokens Retrieves a list of API tokens. ```APIDOC ## GET /tokens ### Description Retrieves a list of API tokens. ### Method GET ### Endpoint /tokens ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the token. - **name** (string) - The name of the token. - **prefix** (string) - The first characters of the token for identification. - **description** (string | null) - An optional description for the token. - **is_active** (boolean) - Indicates if the token is currently active. - **created_at** (string) - The timestamp when the token was created. - **updated_at** (string | null) - The timestamp when the token was last updated. - **expires_at** (string | null) - The timestamp when the token expires. - **last_used_at** (string | null) - The timestamp when the token was last used. - **last_used_ip** (string | null) - The IP address from which the token was last used. - **created_by** (string | null) - The identifier of the user who created the token. #### Response Example ```json [ { "id": 1, "name": "Example Token", "prefix": "tok_abc", "description": "This is an example token.", "is_active": true, "created_at": "2023-10-27T10:00:00Z", "updated_at": null, "expires_at": null, "last_used_at": "2023-10-27T10:05:00Z", "last_used_ip": "192.168.1.1", "created_by": "user123" } ] ``` ``` -------------------------------- ### GET /promocodes Source: https://docs.bedolagam.ru/api-reference/admin-promocodes/list-promocodes Retrieves a list of all available promocodes. ```APIDOC ## GET /promocodes ### Description Get list of all promocodes. ### Method GET ### Endpoint /promocodes ``` -------------------------------- ### POST /cabinet/balance/topup Source: https://docs.bedolagam.ru/api-reference/cabinet-balance/create-topup Initiates a balance top-up process for the user's account. ```APIDOC ## POST /cabinet/balance/topup ### Description Initiates a balance top-up process for the user's account. ### Method POST ### Endpoint /cabinet/balance/topup ``` -------------------------------- ### POST /cabinet/admin/broadcasts Source: https://docs.bedolagam.ru/api-reference/cabinet-admin-broadcasts/create-broadcast Creates and starts a new broadcast operation. ```APIDOC ## POST /cabinet/admin/broadcasts ### Description Create and start a broadcast. ### Method POST ### Endpoint /cabinet/admin/broadcasts ### Request Body - **target** (string) - Required - The target for the broadcast. - **message_text** (string) - Required - The content of the message (1-4000 characters). - **selected_buttons** (array of strings) - Optional - List of buttons to include. - **media** (object) - Optional - Media attachment details. ### Request Example { "target": "all_users", "message_text": "Hello everyone!", "selected_buttons": [], "media": null } ### Response #### Success Response (201) - **id** (integer) - Broadcast ID - **target_type** (string) - Type of target - **message_text** (string) - Message content - **has_media** (boolean) - Whether media is attached - **media_type** (string) - Type of media - **media_file_id** (string) - ID of the media file - **media_caption** (string) - Caption for media - **total_count** (integer) - Total recipients - **sent_count** (integer) - Count of sent messages - **failed_count** (integer) - Count of failed messages - **blocked_count** (integer) - Count of blocked users - **status** (string) - Current status - **admin_id** (integer) - ID of the admin who created it - **admin_name** (string) - Name of the admin - **created_at** (string) - Creation timestamp - **completed_at** (string) - Completion timestamp - **progress_percent** (number) - Progress percentage - **channel** (string) - Communication channel - **email_subject** (string) - Email subject line #### Response Example { "id": 1, "target_type": "all_users", "message_text": "Hello everyone!", "has_media": false, "total_count": 100, "sent_count": 0, "failed_count": 0, "blocked_count": 0, "status": "pending", "progress_percent": 0, "channel": "telegram" } ``` -------------------------------- ### POST /miniapp/subscription/purchase/options Source: https://docs.bedolagam.ru/api-reference/miniapp/get-subscription-purchase-options-endpoint Retrieves the available subscription purchase options for the user. ```APIDOC ## POST /miniapp/subscription/purchase/options ### Description Получение доступных вариантов покупки подписки. ### Method POST ### Endpoint /miniapp/subscription/purchase/options ### Request Body - **initData** (string) - Required - Initdata ### Response #### Success Response (200) - **success** (boolean) - Success - **currency** (string) - Currency - **balanceKopeks** (integer/null) - Balancekopeks - **balanceLabel** (string/null) - Balancelabel - **subscriptionId** (integer/null) - Subscriptionid - **data** (object) - Data #### Response Example { "success": true, "currency": "RUB", "balanceKopeks": 1000, "balanceLabel": "10.00 RUB", "subscriptionId": 1, "data": {} } ``` -------------------------------- ### POST /menu-layout/import Source: https://docs.bedolagam.ru/api-reference/menu-layout/import-menu-layout Imports the menu layout configuration for the bot. ```APIDOC ## POST /menu-layout/import ### Description Imports a new menu layout configuration for the bot. ### Method POST ### Endpoint /menu-layout/import ``` -------------------------------- ### GET /health/payment-webhooks Source: https://docs.bedolagam.ru/getting-started/troubleshooting Returns the status of activated payment integrations. ```APIDOC ## GET /health/payment-webhooks ### Description Returns the status of activated payment integrations. ### Method GET ### Endpoint /health/payment-webhooks ``` -------------------------------- ### Управление Docker-контейнерами Source: https://docs.bedolagam.ru/development/contributing Команды для управления жизненным циклом контейнеров через Makefile. ```bash make up # Запуск контейнеров make up-follow # Запуск с логами make down # Остановка make reload # Перезапуск ``` -------------------------------- ### GET /overview Source: https://docs.bedolagam.ru/bot/campaigns Retrieves high-level overview statistics for all campaigns. ```APIDOC ## GET /overview ### Description Retrieves summary statistics including total, active, and inactive campaigns, total registrations, and total balance/subscription accruals. ### Method GET ### Endpoint /overview ``` -------------------------------- ### GET /remnawave/nodes/realtime Source: https://docs.bedolagam.ru/api-reference/remnawave/get-nodes-realtime-usage Retrieves real-time usage data for nodes. ```APIDOC ## GET /remnawave/nodes/realtime ### Description Получение данных об использовании нод в реальном времени. ### Method GET ### Endpoint /remnawave/nodes/realtime ### Response #### Success Response (200) - **data** (array) - List of node usage objects. #### Response Example [ { "node_id": "node_01", "usage": "active" } ] ``` -------------------------------- ### POST /welcome-texts Source: https://docs.bedolagam.ru/api-reference/welcome-texts/create-welcome-text-endpoint Creates a new welcome text entry in the system. ```APIDOC ## POST /welcome-texts ### Description Создание нового приветственного текста. ### Method POST ### Endpoint /welcome-texts ### Request Body - **text** (string) - Required - The content of the welcome text (max 4000 chars). - **is_enabled** (boolean) - Optional - Whether the text is enabled (default: true). - **is_active** (boolean) - Optional - Whether the text is active (default: true). ### Request Example { "text": "Welcome to our service!", "is_enabled": true, "is_active": true } ### Response #### Success Response (201) - **id** (integer) - Unique identifier - **text** (string) - The welcome text content - **is_active** (boolean) - Active status - **is_enabled** (boolean) - Enabled status - **created_by** (integer/null) - ID of the creator - **created_at** (string) - Creation timestamp - **updated_at** (string) - Last update timestamp #### Response Example { "id": 1, "text": "Welcome to our service!", "is_active": true, "is_enabled": true, "created_by": 123, "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### GET /remnawave/nodes/realtime Source: https://docs.bedolagam.ru/api-reference/remnawave/get-nodes-realtime-usage Retrieves real-time data for Remnawave nodes. ```APIDOC ## GET /remnawave/nodes/realtime ### Description Retrieves real-time status and data for Remnawave nodes. ### Method GET ### Endpoint /remnawave/nodes/realtime ``` -------------------------------- ### Проверка логов конфигурации меню Source: https://docs.bedolagam.ru/cabinet/menu-editor Команда для поиска ошибок валидации конфигурации меню в логах Docker-контейнера. ```bash docker logs 2>&1 | grep -i "menu_layout" ``` -------------------------------- ### Minimal Environment Configuration Source: https://docs.bedolagam.ru/bot/recurrent-payments Basic environment variables for enabling auto-renewal and setting up YooKassa for recurring payments. Ensure to replace placeholders with actual credentials. ```env # Автопродление с баланса ENABLE_AUTOPAY=true # Рекуррентные платежи через YooKassa YOOKASSA_ENABLED=true YOOKASSA_SHOP_ID=123456 YOOKASSA_SECRET_KEY=live_xxxxxxxxxxxxx YOOKASSA_RECURRENT_ENABLED=true ``` -------------------------------- ### GET /pages/service-rules Source: https://docs.bedolagam.ru/api-reference/pages/get-service-rules Retrieves the service rules information page. ```APIDOC ## GET /pages/service-rules ### Description Retrieves the content of the service rules page. ### Method GET ### Endpoint /pages/service-rules ``` -------------------------------- ### Configure Selectable Traffic Packages Source: https://docs.bedolagam.ru/bot/subscriptions Enable selectable traffic packages where users choose from a list. Configure packages with GB, price in kopeks, and a boolean for unlimited display. ```env TRAFFIC_SELECTION_MODE=selectable TRAFFIC_PACKAGES_CONFIG="5:2000:false,10:3500:false,50:11000:true,100:15000:true,0:20000:true" ``` -------------------------------- ### GET /pages/public-offer Source: https://docs.bedolagam.ru/api-reference/pages/get-public-offer Retrieves the content of the public offer page. ```APIDOC ## GET /pages/public-offer ### Description Retrieves the public offer document content for the service. ### Method GET ### Endpoint /pages/public-offer ``` -------------------------------- ### Получение frontend через Docker Source: https://docs.bedolagam.ru/cabinet/setup Извлеките статические файлы из официального Docker-образа. ```bash docker pull ghcr.io/bedolaga-dev/bedolaga-cabinet:latest # Извлечь статику docker create --name tmp_cabinet ghcr.io/bedolaga-dev/bedolaga-cabinet:latest docker cp tmp_cabinet:/usr/share/nginx/html ./cabinet-dist docker rm tmp_cabinet ``` -------------------------------- ### GET /menu-layout/export Source: https://docs.bedolagam.ru/api-reference/menu-layout/export-menu-layout Exports the current menu layout configuration. ```APIDOC ## GET /menu-layout/export ### Description Exports the current menu layout configuration for the bot. ### Method GET ### Endpoint /menu-layout/export ``` -------------------------------- ### GET /menu-layout/history Source: https://docs.bedolagam.ru/api-reference/menu-layout/get-menu-layout-history Retrieves the history of menu layout changes. ```APIDOC ## GET /menu-layout/history ### Description Retrieves the history of menu layout changes. ### Method GET ### Endpoint /menu-layout/history ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of history entries to return. - **offset** (integer) - Optional - The number of history entries to skip. ### Response #### Success Response (200) - **history** (array) - An array of menu layout history entries. - **timestamp** (string) - The timestamp of the change. - **user** (string) - The user who made the change. - **action** (string) - The action performed (e.g., "update", "create"). - **details** (object) - Details about the change. #### Response Example ```json { "history": [ { "timestamp": "2023-10-27T10:00:00Z", "user": "admin_user", "action": "update", "details": { "field": "button_text", "old_value": "Old Text", "new_value": "New Text" } } ] } ``` ``` -------------------------------- ### Configure Minimal Webhook Environment Variables Source: https://docs.bedolagam.ru/getting-started/docker-deployment Use these settings for a basic production setup requiring HTTPS. Ensure tokens are generated securely. ```env # Обязательные базовые настройки BOT_TOKEN=1234567890:AABBCCdd... ADMIN_IDS=123456789,987654321 # Настройки webhook BOT_RUN_MODE=webhook WEBHOOK_URL=https://hooks.domain.com WEBHOOK_PATH=/webhook WEBHOOK_SECRET_TOKEN=super-secret-token # Настройки Web API WEB_API_ENABLED=true WEB_API_PORT=8080 WEB_API_ALLOWED_ORIGINS=https://miniapp.domain.com WEB_API_DEFAULT_TOKEN=super-secret-token # Настройки Remnawave REMNAWAVE_API_URL=https://your-panel.com REMNAWAVE_API_KEY=your_api_key ``` -------------------------------- ### GET /cabinet/admin/settings Source: https://docs.bedolagam.ru/api-reference/admin-settings/list-settings Retrieves a list of all system settings, optionally filtered by a specific category key. ```APIDOC ## GET /cabinet/admin/settings ### Description Get list of all settings or settings for a specific category. ### Method GET ### Endpoint /cabinet/admin/settings ### Parameters #### Query Parameters - **category_key** (string) - Optional - The key of the category to filter settings by. ### Response #### Success Response (200) - **settings** (array) - A list of setting definitions. #### Response Example [ { "key": "site_name", "name": "Site Name", "category": { "key": "general", "label": "General" }, "type": "string", "is_optional": false, "has_override": false } ] ``` -------------------------------- ### GET /cabinet/referral/withdrawal/history Source: https://docs.bedolagam.ru/api-reference/cabinet-withdrawal/get-withdrawal-history Retrieves the withdrawal history for the referral program. ```APIDOC ## GET /cabinet/referral/withdrawal/history ### Description Retrieves the withdrawal history for the referral program. ### Method GET ### Endpoint /cabinet/referral/withdrawal/history ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of records to return. - **offset** (integer) - Optional - Number of records to skip. ### Response #### Success Response (200) - **data** (array) - List of withdrawal records. - **id** (integer) - Withdrawal ID. - **amount** (number) - Withdrawal amount. - **currency** (string) - Currency of the withdrawal. - **status** (string) - Status of the withdrawal (e.g., 'completed', 'pending', 'failed'). - **created_at** (string) - Timestamp when the withdrawal was requested. - **completed_at** (string) - Timestamp when the withdrawal was completed. #### Response Example ```json { "data": [ { "id": 1, "amount": 100.50, "currency": "USD", "status": "completed", "created_at": "2023-10-27T10:00:00Z", "completed_at": "2023-10-27T10:05:00Z" } ] } ``` ```