openapi: 3.0.3 info: title: NoCopy API - Files, Payments, Payouts, Search, User description: | API для работы с файлами, платежами, выплатами, поиском и пользователями. Включает контроллеры: - FileController (GET/POST файлы, защита, проверка) - GlobalSearchController (глобальный поиск, нарушения, статус) - PaymentController (платежи, методы оплаты, авто-продление) - PayoutController (выплаты, методы выплат, управление) - SearchSettingsController (настройки поисковых систем) - UserController (профиль, регистрация, смена пароля) - ApiKeyController (управление API ключами) - HealtCheckController (мониторинг здоровья, информация о приложении) - MigrationController (администраторские инструменты миграции) version: 1.0.0 contact: name: NoCopy servers: - url: http://localhost:8080 description: Локальный - url: https://dev-workspace.not-copy.com/ description: Дев tags: - name: Files description: Работа с файлами (публичный доступ, защита, проверка) - name: Search description: Глобальный поиск и настройки поисковых систем - name: Payments description: Платежи и управление методами оплаты - name: Payouts description: Выплаты и управление методами выплат - name: User description: Управление пользователями и профилем - name: API Keys description: Управление API ключами пользователя - name: Health Check description: Мониторинг здоровья приложения - name: Migration description: Администраторские инструменты миграции paths: /api/files/public/{fileId}: get: tags: - Files summary: Публичное получение файла description: | Получение файла по ID без авторизации. Поддерживает стриминг для больших файлов. operationId: getPublicFile parameters: - name: fileId in: path required: true schema: type: string description: ID файла responses: '200': description: Файл content: application/octet-stream: schema: type: string format: binary image/jpeg: schema: type: string format: binary image/png: schema: type: string format: binary application/pdf: schema: type: string format: binary headers: Content-Disposition: schema: type: string description: Имя файла example: 'inline; filename="document.pdf"' Cache-Control: schema: type: string example: "public, max-age=3600" '404': description: Файл не найден '500': description: Внутренняя ошибка сервера /api/files/public/file-info/{fileId}: get: tags: - Files summary: Публичная информация о файле description: Получение метаданных файла по ID без авторизации operationId: getPublicFileInfo parameters: - name: fileId in: path required: true schema: type: string description: ID файла responses: '200': description: Информация о файле content: application/json: schema: $ref: '#/components/schemas/FileEntityResponse' '404': description: Файл не найден /api/files/protected/{fileId}/{type}: get: tags: - Files summary: Получение защищённого файла description: | Получение защищённого файла или его миниатюры. Доступен только для защищённых файлов. operationId: getProtectedFile parameters: - name: fileId in: path required: true schema: type: string description: ID файла - name: type in: path required: true schema: type: string enum: [file, thumbnail] description: Тип файла (file или thumbnail) example: file responses: '200': description: Защищённый файл или миниатюра content: application/octet-stream: schema: type: string format: binary image/jpeg: schema: type: string format: binary image/png: schema: type: string format: binary headers: Content-Disposition: schema: type: string example: 'inline; filename*=UTF-8''''document_nocopy_protected.pdf' '404': description: Файл не найден '500': description: Файл не защищён или ошибка обработки /api/files/public/{fileId}/{type}: get: tags: - Files summary: Публичное получение файла с типом description: Получение файла или миниатюры по ID и типу operationId: getPublicFileWithType parameters: - name: fileId in: path required: true schema: type: string description: ID файла - name: type in: path required: true schema: type: string enum: [file, thumbnail] description: Тип файла (file или thumbnail) responses: '200': description: Файл или миниатюра content: application/octet-stream: schema: type: string format: binary '404': description: Файл не найден /api/files/check-file/status/{userId}: get: tags: - Files summary: Статус проверки файлов пользователя description: Получение текущего статуса лимитов проверки файлов operationId: getCheckStatus parameters: - name: userId in: path required: true schema: type: integer format: int64 description: ID пользователя responses: '200': description: Статус проверки content: application/json: schema: $ref: '#/components/schemas/CheckStatus' /api/files/check-file/update-limit/{userId}/{limit}: post: tags: - Files summary: Обновление лимита проверок description: Обновление лимита проверок файлов для пользователя operationId: updateCheckLimit parameters: - name: userId in: path required: true schema: type: integer format: int64 description: ID пользователя - name: limit in: path required: true schema: type: integer description: Новый лимит проверок responses: '200': description: Лимит обновлён content: application/json: schema: $ref: '#/components/schemas/ProtectedFileCheck' /api/files/protect/{fileId}/{convertTo}: post: tags: - Files summary: Защита файла description: Запуск процесса защиты файла с конвертацией в указанный формат operationId: protectFile parameters: - name: fileId in: path required: true schema: type: string description: ID файла - name: convertTo in: path required: true schema: type: string description: Формат конвертации (например, protected) example: protected responses: '200': description: Информация о защите файла content: application/json: schema: $ref: '#/components/schemas/FileInfo' /api/files/download/user-passport/archive/{userId}: get: tags: - Files summary: Скачивание архива паспорта description: Сборка и скачивание ZIP-архива с данными паспорта пользователя operationId: downloadPassportZip parameters: - name: userId in: path required: true schema: type: integer format: int64 description: ID пользователя responses: '200': description: ZIP архив content: application/zip: schema: type: string format: binary headers: Content-Disposition: schema: type: string example: 'attachment; filename=passport_123.zip' '500': description: Ошибка сборки архива /api/v1/global-search/start: post: tags: - Search summary: Запуск глобального поиска description: Запуск задачи глобального поиска по файлам пользователя operationId: startGlobalSearch security: - BearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/GlobalSearchStartRequest' responses: '200': description: Задача поиска создана или файлы не найдены content: application/json: schema: oneOf: - $ref: '#/components/schemas/GlobalSearchStartResponse' - type: string example: "Files for search not found" /api/v1/global-search/actual-task: get: tags: - Search summary: Получение активной задачи поиска description: Получение текущей активной (PROCESSING) задачи поиска пользователя operationId: getActualSearchTask security: - BearerAuth: [] responses: '200': description: Активная задача или сообщение об отсутствии content: application/json: schema: oneOf: - $ref: '#/components/schemas/GlobalSearchTask' - type: string example: "Task not found" /api/v1/global-search/violation-summary: get: tags: - Search summary: Сводка по нарушениям description: Получение сводки по нарушениям для файлов пользователя operationId: getViolationSummary security: - BearerAuth: [] responses: '200': description: Сводка по нарушениям content: application/json: schema: type: array items: $ref: '#/components/schemas/FileViolationSummaryDTO' /api/v1/global-search/violation-summary-with-files: post: tags: - Search summary: Сводка по нарушениям с пагинацией description: Получение сводки по нарушениям с фильтрацией и пагинацией operationId: getViolationSummaryWithFiles security: - BearerAuth: [] requestBody: required: true content: application/json: schema: type: object properties: file_name: type: string sort_direction: type: string enum: [asc, desc] page: type: integer size: type: integer start_date: type: string end_date: type: string responses: '200': description: Сводка по нарушениям с пагинацией content: application/json: schema: type: object properties: content: type: array items: $ref: '#/components/schemas/FileViolationSummaryDTO' total_elements: type: integer total_pages: type: integer number: type: integer size: type: integer /api/v1/global-search/status/{taskId}: get: tags: - Search summary: Статус задачи поиска description: Получение статуса и прогресса задачи глобального поиска operationId: getSearchTaskStatus security: - BearerAuth: [] parameters: - name: taskId in: path required: true schema: type: string description: ID задачи поиска responses: '200': description: Статус задачи content: application/json: schema: oneOf: - $ref: '#/components/schemas/GlobalSearchStatusResponse' - type: string example: "Task not found" /api/payments/create: post: tags: - Payments summary: Создание платежа description: Создание нового платежа для пользователя operationId: createPayment parameters: - name: email in: query required: true schema: type: string description: Email пользователя - name: tariffId in: query required: true schema: type: integer format: int64 description: ID тарифа - name: operationType in: query required: true schema: type: string description: Тип операции - name: operationUuid in: query required: true schema: type: string description: UUID операции responses: '200': description: Платёж создан content: application/json: schema: $ref: '#/components/schemas/Payment' '404': description: Тариф или пользователь не найден /api/payments/webhook/yookassa: post: tags: - Payments summary: Webhook ЮKassa description: Обработка уведомлений от ЮKassa operationId: handleYooKassaNotification requestBody: required: true content: application/json: schema: type: object responses: '200': description: Уведомление обработано /api/payments/auto-renewal: post: tags: - Payments summary: Управление автопродлением description: Включение или отключение автопродления подписки operationId: setAutoRenewal security: - BearerAuth: [] parameters: - name: renewal in: query required: true schema: type: boolean description: Включить (true) или отключить (false) автопродление responses: '200': description: Статус автопродления изменён content: application/json: schema: type: object properties: message: type: string '404': description: Пользователь не найден /api/payments/methods: get: tags: - Payments summary: Список методов оплаты description: Получение сохранённых методов оплаты пользователя operationId: getPaymentMethods security: - BearerAuth: [] responses: '200': description: Список методов оплаты content: application/json: schema: type: array items: type: object '404': description: Пользователь не найден /api/payments/methods/{paymentMethodId}: delete: tags: - Payments summary: Удаление метода оплаты description: Удаление сохранённого метода оплаты operationId: deletePaymentMethod security: - BearerAuth: [] parameters: - name: paymentMethodId in: path required: true schema: type: string description: ID метода оплаты responses: '200': description: Метод оплаты удалён content: application/json: schema: type: object properties: message: type: string '404': description: Пользователь не найден /api/payouts/create-request: post: tags: - Payouts summary: Создание заявки на выплату description: Создание новой заявки на выплату средств operationId: createPayoutRequest security: - BearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PayoutRequestDTO' responses: '201': description: Заявка создана content: application/json: schema: $ref: '#/components/schemas/PayoutRequest' '404': description: Пользователь не найден '409': description: Недостаточно средств, уже есть активная заявка или неверный метод выплаты /api/payouts/requests: get: tags: - Payouts summary: Список заявок на выплату description: Получение всех заявок на выплату пользователя operationId: getUserPayoutRequests security: - BearerAuth: [] responses: '200': description: Список заявок content: application/json: schema: type: array items: $ref: '#/components/schemas/PayoutRequest' '404': description: Пользователь не найден /api/payouts/requests/{requestId}: get: tags: - Payouts summary: Получение заявки по ID description: Получение конкретной заявки на выплату operationId: getPayoutRequest security: - BearerAuth: [] parameters: - name: requestId in: path required: true schema: type: integer format: int64 description: ID заявки responses: '200': description: Заявка найдена content: application/json: schema: $ref: '#/components/schemas/PayoutRequest' '404': description: Пользователь не найден /api/payouts/requests/{requestId}/process: post: tags: - Payouts summary: Обработка заявки на выплату description: Запуск обработки заявки на выплату (административное действие) operationId: processPayoutRequest parameters: - name: requestId in: path required: true schema: type: integer format: int64 description: ID заявки responses: '200': description: Заявка обработана content: application/json: schema: $ref: '#/components/schemas/PayoutRequest' /api/payouts/requests/{requestId}/cancel: post: tags: - Payouts summary: Отмена заявки на выплату description: Отмена заявки на выплату пользователем operationId: cancelPayoutRequest security: - BearerAuth: [] parameters: - name: requestId in: path required: true schema: type: integer format: int64 description: ID заявки responses: '200': description: Заявка отменена content: application/json: schema: $ref: '#/components/schemas/PayoutRequest' '404': description: Пользователь не найден /api/payouts/user/payout-methods: get: tags: - Payouts summary: Методы выплат пользователя description: Получение сохранённых методов выплат пользователя operationId: getUserPayoutMethods security: - BearerAuth: [] responses: '200': description: Список методов выплат content: application/json: schema: type: array items: $ref: '#/components/schemas/PayoutMethodDTO' '404': description: Пользователь не найден /api/payouts/payout-methods: get: tags: - Payouts summary: Доступные типы методов выплат description: Получение списка доступных типов методов выплат operationId: getAvailablePayoutMethodTypes responses: '200': description: Список типов методов выплат content: application/json: schema: type: array items: $ref: '#/components/schemas/PayoutMethodTypeDTO' /api/payouts/payout-method/card: post: tags: - Payouts summary: Добавление карты для выплат description: Добавление банковской карты как метода выплаты operationId: addCardPayoutMethod security: - BearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AddCardRequest' responses: '201': description: Карта добавлена content: application/json: schema: $ref: '#/components/schemas/PayoutMethodDTO' '404': description: Пользователь не найден /api/payouts/payout-method/bank-transfer: post: tags: - Payouts summary: Добавление банковского перевода для выплат description: Добавление банковского счёта как метода выплаты operationId: addBankTransferPayoutMethod security: - BearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AddBankTransferRequest' responses: '201': description: Банковский перевод добавлен content: application/json: schema: $ref: '#/components/schemas/PayoutMethodDTO' '404': description: Пользователь не найден /api/payouts/payout-method/{methodId}/default: put: tags: - Payouts summary: Установка метода выплаты по умолчанию description: Установка указанного метода выплаты как основного operationId: setDefaultPayoutMethod security: - BearerAuth: [] parameters: - name: methodId in: path required: true schema: type: integer format: int64 description: ID метода выплаты responses: '200': description: Метод установлен по умолчанию '404': description: Пользователь не найден /api/search/settings: get: tags: - Search summary: Получение настроек поиска description: Получение текущих настроек поисковых систем и прокси operationId: getSearchSettings responses: '200': description: Настройки поиска content: application/json: schema: $ref: '#/components/schemas/BaseResponse' put: tags: - Search summary: Обновление настроек поиска description: Обновление настроек поисковых систем и прокси operationId: updateSearchSettings requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SearchSettingsDto' responses: '200': description: Настройки обновлены content: application/json: schema: $ref: '#/components/schemas/BaseResponse' /v1/api/user: get: tags: - User summary: Получение информации о пользователе description: Получение полной информации о пользователе по email operationId: getUserByEmail parameters: - name: email in: query required: true schema: type: string description: Email пользователя responses: '200': description: Информация о пользователе content: application/json: schema: $ref: '#/components/schemas/UserDTO' '404': description: Пользователь не найден patch: tags: - User summary: Обновление пользователя description: Частичное обновление данных пользователя operationId: updateUser security: - BearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UserRequest' responses: '200': description: Пользователь обновлён content: application/json: schema: $ref: '#/components/schemas/UserDTO' /v1/api/user/change-password: post: tags: - User summary: Смена пароля description: Смена пароля пользователя operationId: changePassword security: - BearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChangePasswordRequest' responses: '200': description: Пароль изменён content: application/json: schema: $ref: '#/components/schemas/UserDTO' /v1/api/user/create-user: post: tags: - User summary: Создание пользователя description: Создание нового пользователя (административное действие) operationId: createUser requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegRequest' responses: '200': description: Пользователь создан content: application/json: schema: type: object properties: user: type: object token: type: string /v1/api/user/delete-user/{userId}: delete: tags: - User summary: Удаление пользователя description: Удаление пользователя по ID operationId: deleteUser parameters: - name: userId in: path required: true schema: type: integer format: int64 description: ID пользователя responses: '200': description: Пользователь удалён content: application/json: schema: type: object properties: userId: type: integer deleted: type: string example: "true" /api/user/api-keys: post: tags: - API Keys summary: Создание API ключа description: Создаёт новый API ключ для текущего пользователя operationId: createApiKey security: - BearerAuth: [] requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: Название ключа example: "Production Key" responses: '200': description: API ключ создан content: application/json: schema: $ref: '#/components/schemas/BaseResponse' get: tags: - API Keys summary: Получение списка API ключей description: Получение всех API ключей текущего пользователя operationId: listApiKeys security: - BearerAuth: [] responses: '200': description: Список API ключей content: application/json: schema: $ref: '#/components/schemas/BaseResponse' /api/user/api-keys/{keyId}: delete: tags: - API Keys summary: Отзыв API ключа description: Деактивирует API ключ пользователя operationId: revokeApiKey security: - BearerAuth: [] parameters: - name: keyId in: path required: true schema: type: integer format: int64 description: ID ключа для отзыва responses: '200': description: Ключ отозван content: application/json: schema: $ref: '#/components/schemas/BaseResponse' /check/api/healt: get: tags: - Health Check summary: Проверка здоровья приложения description: Проверяет, работает ли приложение operationId: healthCheck responses: '200': description: Приложение работает нормально /check/api/build: get: tags: - Health Check summary: Информация о сборке description: Получение информации о времени сборки приложения operationId: getBuildInfo responses: '200': description: Информация о сборке content: application/json: schema: type: object properties: buildTimeBack: type: string example: "2025-06-30T10:30:00Z" /check/api/api/debug/memory: get: tags: - Health Check summary: Информация о памяти description: Получение информации об использовании памяти JVM operationId: getMemoryInfo responses: '200': description: Информация о памяти content: application/json: schema: type: object properties: maxMemory (MB): type: string totalMemory (MB): type: string freeMemory (MB): type: string usedMemory (MB): type: string availableProcessors: type: string /check/api/test/monitoring/{fileId}: post: tags: - Health Check summary: Тестирование мониторинга description: Запускает тестовый мониторинг для файла operationId: testMonitoring parameters: - name: fileId in: path required: true schema: type: string description: ID файла для тестирования responses: '200': description: Мониторинг запущен content: application/json: schema: type: object properties: status: type: string example: "OK" /api/admin/migration/start: post: tags: - Migration summary: Запуск миграции description: Запускает миграцию файлов в S3 хранилище operationId: startMigration responses: '200': description: Миграция запущена content: application/json: schema: type: object properties: message: type: string example: "Migration started. Check logs for progress." /api/admin/migration/status: post: tags: - Migration summary: Статус миграции description: Получение статуса выполняемой миграции operationId: getMigrationStatus responses: '200': description: Статус миграции content: application/json: schema: type: object properties: message: type: string /api/admin/migration/fill-dock-view: post: tags: - Migration summary: Заполнение dock view description: Заполнение данных просмотров документов из миграции operationId: fillDockView responses: '200': description: Данные заполнены content: application/json: schema: type: object properties: message: type: string components: schemas: BaseResponse: type: object properties: msg_id: type: integer message_code: type: integer message_desc: type: string message_body: type: object FileEntityResponse: type: object properties: id: type: string user_id: type: integer format: int64 original_file_name: type: string stored_file_name: type: string file_path: type: string protected_file_path: type: string thumbnail_file_url: type: string file_size: type: integer format: int64 mime_type: type: string file_extension: type: string checksum: type: string upload_session_id: type: string status: type: string created_at: type: string format: date-time updated_at: type: string format: date-time formatted_size: type: string download_url: type: string exists_on_disk: type: boolean support_id: type: integer protect_status: type: string owner_name: type: string owner_email: type: string owner_company: type: string file_name: type: string file_format: type: string checks_count: type: integer file_upload_date: type: string format: date-time monitoring: type: string permissions: type: object appeal_infos: type: array items: type: object CheckStatus: type: object properties: checks_today: type: integer checks_limit: type: integer can_check: type: boolean ProtectedFileCheck: type: object properties: id: type: integer user_id: type: integer checks_today: type: integer checks_limit: type: integer last_check_date: type: string format: date-time FileInfo: type: object properties: id: type: string file_name: type: string file_path: type: string mime_type: type: string GlobalSearchStartRequest: type: object properties: search_type: type: string file_types: type: array items: type: string date_from: type: string date_to: type: string GlobalSearchStartResponse: type: object properties: task_id: type: string status: type: string total_files: type: integer GlobalSearchTask: type: object properties: task_id: type: string status: type: string total_files: type: integer processed_files: type: integer created_at: type: string format: date-time GlobalSearchStatusResponse: type: object properties: task_id: type: string status: type: string search_type: type: string progress: type: integer FileViolationSummaryDTO: type: object properties: file_id: type: string support_id: type: integer file_name: type: string file_size: type: integer format: int64 mime_type: type: string status: type: string created_at: type: string format: date-time violation_count: type: integer format: int64 count_law_case: type: integer format: int64 count_complaint: type: integer format: int64 latest_violation_date: type: string format: date-time Payment: type: object properties: id: type: integer format: int64 status: type: string payment_uuid: type: string amount: type: number created_at: type: string format: date-time updated_at: type: string format: date-time operation_type: type: string PayoutRequestDTO: type: object properties: amount: type: number payout_method_id: type: integer format: int64 payout_type: type: string PayoutRequest: type: object properties: id: type: integer format: int64 amount: type: number status: type: string created_at: type: string format: date-time updated_at: type: string format: date-time PayoutMethodDTO: type: object properties: id: type: integer format: int64 type: type: string display_name: type: string masked_details: type: string card_number: type: string is_default: type: boolean is_verified: type: boolean PayoutMethodTypeDTO: type: object properties: code: type: string name: type: string AddCardRequest: type: object properties: card_number: type: string card_holder: type: string expiry_date: type: string AddBankTransferRequest: type: object properties: bank_name: type: string bic: type: string correspondent_account: type: string account_number: type: string account_holder: type: string inn: type: string kpp: type: string SearchSettingsDto: type: object properties: engines: type: object additionalProperties: type: boolean example: yandex: true google: true proxy_enabled: type: boolean UserDTO: type: object properties: id: type: integer format: int64 email: type: string full_name: type: string phone: type: string verified_status: type: string active: type: boolean company: type: string tariffs: type: array items: type: object tariff_info: $ref: '#/components/schemas/TariffInfoDTO' gender_type: type: string birthday: type: string created_at: type: string format: date-time permission: type: object TariffInfoDTO: type: object properties: id: type: string status: type: string start_tariff: type: string format: date-time end_tariff: type: string format: date-time tariff_id: type: integer format: int64 tariff_name: type: string tokens: type: integer max_file_on_disk: type: integer format: int64 current_file_on_disk: type: integer format: int64 current_file_counts: type: integer max_file_counts: type: integer UserRequest: type: object properties: full_name: type: string phone: type: string gender_type: type: string birthday: type: string ChangePasswordRequest: type: object properties: email: type: string old_password: type: string new_password: type: string RegRequest: type: object properties: full_name: type: string email: type: string password: type: string phone: type: string securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: JWT description: JWT токен для авторизации security: - BearerAuth: []