> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bedolagam.ru/llms.txt
> Use this file to discover all available pages before exploring further.

# Update User Endpoint

> Частичное обновление данных пользователя.



## OpenAPI

````yaml /openapi.json patch /users/{user_id}
openapi: 3.1.0
info:
  title: Remnawave Bot Admin API
  version: 1.0.0
servers: []
security: []
tags:
  - name: health
    description: Проверка состояния сервера и базы данных
  - name: stats
    description: Общая и детальная статистика системы
  - name: logs
    description: Просмотр логов и ошибок
  - name: users
    description: Управление пользователями бота
  - name: subscriptions
    description: Управление подписками и ключами подключения
  - name: transactions
    description: Финансовые операции и платежи
  - name: partners
    description: Партнёрская программа
  - name: broadcasts
    description: Массовые рассылки пользователям
  - name: pages
    description: Информационные страницы (оферта, политика и др.)
  - name: welcome-texts
    description: Приветственные сообщения
  - name: main-menu
    description: Настройки главного меню бота
  - name: menu-layout
    description: Конструктор расположения кнопок меню
  - name: pinned-messages
    description: Закреплённые сообщения в чатах
  - name: notifications
    description: Системные уведомления
  - name: promo-codes
    description: Промокоды для скидок и бонусов
  - name: promo-groups
    description: Группы промо-акций
  - name: promo-offers
    description: Рекламные предложения
  - name: campaigns
    description: Рекламные кампании с UTM-трекингом
  - name: contests
    description: Конкурсы, розыгрыши и ежедневные задания
  - name: polls
    description: Опросы пользователей
  - name: remnawave
    description: RemnaWave интеграция (ноды, сквады, инбаунды)
  - name: servers
    description: Управление VPN-серверами
  - name: settings
    description: Настройки бота
  - name: backups
    description: Резервное копирование данных
  - name: auth
    description: Аутентификация и токены Web API
  - name: webhooks
    description: Webhook-обработчики внешних событий
  - name: miniapp
    description: API для Telegram Mini App
  - name: media
    description: Загрузка и хранение медиафайлов
  - name: support
    description: Система тикетов поддержки
  - name: ban-notifications
    description: Уведомления о банах пользователей
  - name: Landing Pages
    description: Публичные лендинги для привлечения клиентов
  - name: Cabinet Auth
    description: Авторизация через Telegram, email, виджет
  - name: Cabinet OAuth
    description: OAuth 2.0 провайдеры (Google, Яндекс, Discord, VK)
  - name: Cabinet Account Linking
    description: Привязка и отвязка аккаунтов провайдеров
  - name: Cabinet Account Merge
    description: Объединение нескольких аккаунтов в один
  - name: Cabinet Subscription
    description: Управление подписками, тарифами и ключами
  - name: Cabinet Balance
    description: Баланс, пополнение и сохранённые карты
  - name: Cabinet Gift
    description: Подарочные подписки — покупка и активация
  - name: Fortune Wheel
    description: Колесо фортуны с бонусами
  - name: Cabinet Withdrawal
    description: Вывод партнёрских средств
  - name: Cabinet Referral
    description: Реферальная программа
  - name: Cabinet Partner
    description: Партнёрская программа для пользователей
  - name: Cabinet Promo
    description: Промо-акции в личном кабинете
  - name: Cabinet Promocode
    description: Применение промокодов
  - name: Cabinet Contests
    description: Участие в конкурсах
  - name: Cabinet Polls
    description: Участие в опросах
  - name: Cabinet Tickets
    description: Тикеты поддержки
  - name: Cabinet Ticket Notifications
    description: Уведомления по тикетам
  - name: Cabinet Notifications
    description: Системные уведомления
  - name: Cabinet Info
    description: Информация о сервисе, FAQ, контакты
  - name: Cabinet Media
    description: Медиафайлы личного кабинета
  - name: Branding
    description: Брендирование и оформление кабинета
  - name: Cabinet Admin Users
    description: Управление пользователями через админ-панель
  - name: Cabinet Admin Ban System
    description: Система банов и блокировок
  - name: Admin RBAC
    description: Управление ролями и разрешениями
  - name: Admin RBAC Policies
    description: Политики контроля доступа
  - name: Admin RBAC Audit Log
    description: Журнал аудита действий
  - name: Cabinet Admin Tariffs
    description: Управление тарифами
  - name: Cabinet Admin Servers
    description: Управление серверами
  - name: Cabinet Admin RemnaWave
    description: RemnaWave интеграция из админ-панели
  - name: Cabinet Admin Payments
    description: Просмотр и управление платежами
  - name: Cabinet Admin Payment Methods
    description: Настройка способов оплаты
  - name: Admin Traffic
    description: Мониторинг трафика
  - name: Cabinet Admin Broadcasts
    description: Массовые рассылки из админ-панели
  - name: Cabinet Admin Campaigns
    description: Управление рекламными кампаниями
  - name: Cabinet Admin Channels
    description: Обязательные подписки на каналы
  - name: Cabinet Admin Pinned Messages
    description: Закреплённые сообщения
  - name: Cabinet Admin Landings
    description: Управление лендинговыми страницами
  - name: Cabinet Admin Apps
    description: VPN-приложения для скачивания
  - name: Cabinet Admin Updates
    description: Проверка обновлений бота
  - name: Admin Menu Layout
    description: Конструктор меню админ-панели
  - name: Admin Promo Groups
    description: Управление промо-группами
  - name: Admin Promo Offers
    description: Управление промо-предложениями
  - name: Admin Promocodes
    description: Управление промокодами
  - name: Admin Fortune Wheel
    description: Настройка колеса фортуны
  - name: Admin Email Templates
    description: Email-шаблоны
  - name: Admin Button Styles
    description: Стили кнопок интерфейса
  - name: Cabinet Admin Stats
    description: Статистика и аналитика
  - name: Cabinet Admin Sales Stats
    description: Статистика продаж и доходов
  - name: Cabinet Admin Referral Network
    description: Граф реферальной сети
  - name: Cabinet Admin Partners
    description: Управление партнёрами
  - name: Cabinet Admin Tickets
    description: Тикеты поддержки из админ-панели
  - name: Cabinet Admin Ticket Notifications
    description: Уведомления по тикетам
  - name: Cabinet Admin Withdrawals
    description: Выводы партнёрских средств
  - name: Admin Settings
    description: Системные настройки
paths:
  /users/{user_id}:
    patch:
      tags:
        - users
      summary: Update User Endpoint
      description: Частичное обновление данных пользователя.
      operationId: update_user_endpoint_users__user_id__patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app__webapi__schemas__users__UserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    UserUpdateRequest:
      properties:
        username:
          anyOf:
            - type: string
            - type: 'null'
          title: Username
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        promo_group_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Promo Group Id
        referral_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Referral Code
        has_had_paid_subscription:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Had Paid Subscription
        has_made_first_topup:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Made First Topup
      type: object
      title: UserUpdateRequest
    app__webapi__schemas__users__UserResponse:
      properties:
        id:
          type: integer
          title: Id
        telegram_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Telegram Id
        username:
          anyOf:
            - type: string
            - type: 'null'
          title: Username
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        status:
          type: string
          title: Status
        language:
          type: string
          title: Language
        balance_kopeks:
          type: integer
          title: Balance Kopeks
        balance_rubles:
          type: number
          title: Balance Rubles
        referral_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Referral Code
        referred_by_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Referred By Id
        has_had_paid_subscription:
          type: boolean
          title: Has Had Paid Subscription
        has_made_first_topup:
          type: boolean
          title: Has Made First Topup
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        last_activity:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Activity
        promo_group:
          anyOf:
            - $ref: '#/components/schemas/PromoGroupSummary'
            - type: 'null'
        subscription:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionSummary'
            - type: 'null'
      type: object
      required:
        - id
        - status
        - language
        - balance_kopeks
        - balance_rubles
        - has_had_paid_subscription
        - has_made_first_topup
        - created_at
        - updated_at
      title: UserResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PromoGroupSummary:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        server_discount_percent:
          type: integer
          title: Server Discount Percent
        traffic_discount_percent:
          type: integer
          title: Traffic Discount Percent
        device_discount_percent:
          type: integer
          title: Device Discount Percent
        apply_discounts_to_addons:
          type: boolean
          title: Apply Discounts To Addons
          default: true
      type: object
      required:
        - id
        - name
        - server_discount_percent
        - traffic_discount_percent
        - device_discount_percent
      title: PromoGroupSummary
    SubscriptionSummary:
      properties:
        id:
          type: integer
          title: Id
        status:
          type: string
          title: Status
        actual_status:
          type: string
          title: Actual Status
        is_trial:
          type: boolean
          title: Is Trial
        start_date:
          type: string
          format: date-time
          title: Start Date
        end_date:
          type: string
          format: date-time
          title: End Date
        traffic_limit_gb:
          type: integer
          title: Traffic Limit Gb
        traffic_used_gb:
          type: number
          title: Traffic Used Gb
        device_limit:
          type: integer
          title: Device Limit
        autopay_enabled:
          type: boolean
          title: Autopay Enabled
        autopay_days_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Autopay Days Before
        subscription_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Url
        subscription_crypto_link:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Crypto Link
        connected_squads:
          items:
            type: string
          type: array
          title: Connected Squads
      type: object
      required:
        - id
        - status
        - actual_status
        - is_trial
        - start_date
        - end_date
        - traffic_limit_gb
        - traffic_used_gb
        - device_limit
        - autopay_enabled
      title: SubscriptionSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````