{"openapi":"3.1.0","info":{"title":"Rukki Identity Service — core PostgreSQL API v1","description":"Микросервис аутентификации и авторизации через SMS.ru и Firebase для платформы Rukki 5.0, а также создание и обновление JWT-токенов (access/refresh)\n\n**Группа core-v1** — канонический REST API identity-service: пользователи, роли, профессии и источники лида в **PostgreSQL**, локальная выдача JWT, Firebase-идентичности, JWKS.\n\n**REST API v1 (PostgreSQL, core-v1):**\n- `/api/v1/users` — пользователи (GET list/count/{id}, `/me`, CRM-квалификация `/qualifications`)\n- `/api/v1/roles` — справочник ролей (GET list/count/{id})\n- `/api/v1/professions` — справочник профессий (GET list/count/{id}; мутации — ADMIN/SUPERADMIN)\n- `/api/v1/lead-sources` — справочник источников лида CRM (GET list/count/{id}; мутации — ADMIN/SUPERADMIN)\n- `/api/v1/auth` — аутентификация (Call Flow, Telegram, OAuth2 refresh, logout)\n- `/api/v1/identities` — Firebase-идентичности, устройства, админ-назначение профессий\n- `/.well-known/jwks.json` — публичный JWKS; `/api/v1/auth/keys/rotate`, `/api/v1/auth/tokens/revoke`, `/api/v1/auth/tokens/revoke-by-user` — админ-операции с ключами и отзывом JWT\n\n\n**1. Аутентификация по звонку (Call Flow STOMP) (основная):** Главным методом входа в **Rukki 5.0** является бесплатный звонок-сброс (Call Auth) через интеграцию с SMS.RU.\n\n**Как это работает:**\n1. Клиент запрашивает сессию звонка (`POST /api/v1/auth/call`), передавая номер в поле `phone` (10–15 цифр, префикс `+` необязателен: `+79991234567` или `79991234567`).\n2. Сервер возвращает сервисный номер телефона `call_phone` (на который нужно позвонить) и уникальный ID сессии `checkId`.\n3. Клиент подписывается на WebSocket STOMP канал `/topic/auth-status/core/{checkId}` и ждет.\n4. Пользователь совершает бесплатный гудок-сброс на предоставленный номер `call_phone`.\n5. SMS.RU принимает звонок и присылает Webhook на скрытый эндпоинт.\n6. Наш бэкенд мгновенно проверяет статус, находит или создаёт профиль в PostgreSQL, при **первой регистрации** публикует `USER_REGISTERED` (Transactional Outbox → Kafka), генерирует пару JWT (`access_token`, `refresh_token`, `rukki_id`, …) и пушит `TokenResponseV1` в WebSocket (STOMP) клиенту.\n\nДля наглядного (интерфейсного) тестирования этого потока через WebSockets, перейдите на специальную страницу: **[ws-login.html](/ws-login.html)**.\n\n**1a. Call Flow из Telegram (Mini App):** Тот же сценарий звонка и STOMP, но точка входа — `POST /api/v1/auth/telegram/phone/telegram/phone` (тело `{ \"phone\": \"...\" }` как у `/call`, ответ `call_phone` + `check_id`). Используется Mini App и legacy-клиентами, где нужен звонок-сброс.\n\n**2. Вход по номеру через Telegram Gateway (web, как web.telegram.org):** OTP приходит в **приложение Telegram** на номер, привязанный к аккаунту. Без STOMP и без звонка SMS.RU. Основной сценарий BFF demo — [login.html](https://bff.rukki.pro/login.html) («Войти через Telegram»).\n\n**Как это работает:**\n1. `POST /api/v1/auth/telegram/code` — тело `{ \"phone\": \"...\" }` (10–15 цифр, `+` необязателен); ответ `201` с `request_id`, `phone_number` (E.164), `ttl`.\n2. Пользователь вводит код из Telegram.\n3. `POST /api/v1/auth/telegram/code/verify` — тело `{ \"phone\", \"code\", \"request_id\" }`; ответ `201` — пара JWT (`TokenResponseV1`).\n\nТребует `TELEGRAM_GATEWAY_ENABLED=true` и access token с [gateway.telegram.org](https://gateway.telegram.org).\n\n**3. Аутентификация через Telegram Login Widget:** Платформа поддерживает вход и регистрацию через официальный виджет Telegram Login (бот **@RukkiAuthBot**).\nДля авторизации передайте данные виджета с криптографической подписью (ID, auth_date, hash) в эндпоинт `POST /api/v1/auth/telegram`. Если пользователь заходит впервые, система автоматически создаст ему профиль, опубликует `USER_REGISTERED` в Kafka (Transactional Outbox) и выдаст пару JWT токенов. Для уже авторизованных пользователей (базово по телефону) доступна привязка профиля командой `POST /api/v1/auth/telegram/link`, которая устраняет проблему дублирования аккаунтов.\nДемо-страницы identity для виджета нет — интегрируйте виджет на своём фронтенде или проверяйте через Swagger / `http-requests/auth.http`.\n\n\n**3. Локальные JWT (access / refresh) — Call Flow, Telegram, Web/микросервисы:**\n\nПара токенов выдаётся после успешного входа (**STOMP Call Flow** — `POST /api/v1/auth/call` или `POST /api/v1/auth/telegram/phone`; **Telegram Gateway** — `POST /api/v1/auth/telegram/code` + `POST /api/v1/auth/telegram/code/verify`; либо **Login Widget** — `POST /api/v1/auth/telegram`) в формате OAuth2 token response (`TokenResponseV1`).\n\n| Токен | Назначение | Где передавать |\n|---|---|---|\n| **access** (`access_token`) | Авторизация API-запросов | Заголовок `Authorization: Bearer <access_token>` |\n| **refresh** (`refresh_token`) | Обновление пары без повторного логина | Только на token endpoint (`/api/v1/auth/token` или `/api/v1/auth/refresh`), **не** в Bearer |\n\n**Access JWT** — короткоживущий (TTL: `expires_in`, сек.), claim `token_type=access`, роли в `realm_access.roles`, идентификатор пользователя в `sub` (UUID) и `rukki_id` в теле ответа при выдаче.\n\n**Refresh JWT** — долгоживущий (`refresh_expires_in`), claim `token_type=refresh`, только для обмена на новую пару. При успешном refresh старый refresh **отзывается (rotation)** — повторное использование того же refresh вернёт `invalid_grant`.\n\n**Обновление пары:**\n- Keycloak/OAuth2: `POST /api/v1/auth/token` (`application/x-www-form-urlencoded`): `grant_type=refresh_token`, `refresh_token`, опционально `client_id`.\n- JSON-алиас: `POST /api/v1/auth/refresh` — тело `{\"refreshToken\":\"...\"}` или `{\"refresh_token\":\"...\"}`, опционально `client_id`.\n\n**Logout:** `POST /api/v1/auth/logout` с Bearer **access** JWT — отзыв текущего access по `jti` (blacklist в Redis до `exp`). В теле можно передать `refreshToken` / `refresh_token` той же сессии — тогда отзывается и refresh. Для полного выхода из Firebase-контура — `POST /api/v1/identities/auth/logout`.\n\n**Валидация токенов сторонними сервисами:** публичный JWKS — `GET /.well-known/jwks.json` (RS256, `kid` в header JWT). Отозванные access/refresh отклоняются по blacklist `jti` на стороне identity-service; другие микросервисы проверяют подпись и claims локально.\n\n**Ошибки token endpoint** — OAuth2-формат: `{\"error\":\"...\", \"error_description\":\"...\"}` (`invalid_grant`, `invalid_client`, `unsupported_grant_type`, `invalid_request`).\n\n\n**4. Интеграция с file-service (Kafka `rukki.file.deleted.v1`):**\n- **Назначение:** после удаления файла в file-service снять ссылки в PostgreSQL: `user.avatar_file_id`.\n- **REST:** ссылка задаётся полем `avatarFileId`; проверка существования файла в file-service при create/update **не выполняется**.\n- **Consumer group:** `identity-service-group` (по умолчанию).\n- **Идемпотентность:** таблица `processed_integration_events` по `eventId`. Повторная доставка — no-op.\n\n\n**5. Гео-данные профиля (`geoData` в `GET/PATCH /api/v1/users/{id}`, `PUT/PATCH /api/v1/users/me`):**\n- **Назначение:** 0..N зон обслуживания пользователя — `latitude`, `longitude` (WGS-84, градусы), `radiusMeters` (метры, `BIGINT`, сотни км и более).\n- **Хранение:** PostgreSQL `user_geo_data` — `DOUBLE PRECISION` + расширения `cube`/`earthdistance` (миграция `V16`), **без PostGIS**.\n- **Spatial search:** `nearLatitude`/`nearLongitude`, `coverPoint=true` (зона покрывает точку) или `coverPoint=false` + `maxDistanceMeters` (близость центра); GiST на `ll_to_earth(latitude, longitude)`.\n- **REST:** чтение в `UserResponseV1.geoData`; запись через `PUT /me` (полная замена) или `PATCH` (замена при явной передаче `geoData`); лимит зон на пользователя — `MAX_GEO_ZONES_PER_USER` (по умолчанию 20).\n- **Outbox** `USER_PROFILE_UPDATED`: payload включает `geoData` (тот же формат, что REST).\n- **Фильтрация списка** (`GET /api/v1/users`, `GET /api/v1/users/count`): `hasGeoData` (`false` — только без зон, без других гео-параметров), `minRadiusMeters`/`maxRadiusMeters`, bounding box, `nearLatitude`/`nearLongitude`, `coverPoint`, `maxDistanceMeters`.\n\n\n**6. Справочник профессий (`profession`, `user_professions`):**\n- **Справочник** — `/api/v1/professions`: CRUD для **ADMIN**/**SUPERADMIN**; чтение (list/count/{id}) — любой аутентифицированный пользователь.\n- **Категории:** **A** — операторы спецтехники (жёсткая привязка к `equipment_type`); **B** — сопутствующие профессии на объекте.\n- **Seed:** 26 системных профессий (миграция `V19`, `updatable=false`, `deletable=false`).\n- **Self-service:** `/api/v1/users/me/professions` — GET списка, PUT полная замена, POST/DELETE по `{professionId}`; операции **идемпотентны** (повтор без изменений не шлёт уведомление).\n- **Админ (Identity):** `/api/v1/identities/{id}/professions` — GET; `.../assign` и `.../revoke` — массовое назначение/отзыв (идемпотентно).\n- **Профиль:** `UserResponseV1.professions` (0..N, сортировка по названию); outbox `USER_PROFILE_UPDATED` включает тот же блок.\n- **Удаление из справочника:** запрещено для seed и назначенных пользователям профессий (**409 Conflict**).\n\n\n**8. Почтовые адреса (`user_address`, `addresses` в профиле):**\n- **Административный API** — `/api/v1/user-addresses`: GET list/count/{id}, POST/PUT/PATCH/DELETE по `{id}` (**ADMIN**/**SUPERADMIN** для мутаций; чтение — **ADMIN**, **MANAGER**, **SUPERVISOR**).\n- **Админ по пользователю** — `/api/v1/users/{id}/addresses`: GET списка, POST создание, PUT полная замена, GET/PUT/PATCH/DELETE по `{addressId}`.\n- **Self-service** — `/api/v1/users/me/addresses`: GET списка, POST создание, PUT полная замена, GET/PUT/PATCH/DELETE по `{addressId}`.\n- **Профиль:** `UserResponseV1.addresses` (0..N); запись также через `PUT/PATCH /api/v1/users/me` с полем `addresses` (полная замена списка).\n- **Лимит:** не более `app.user.address.max-addresses-per-user` адресов (по умолчанию 10); не более одного `primary: true`.\n- **Outbox** `USER_PROFILE_UPDATED`: payload включает `addresses` (тот же формат, что REST).\n\n\n**7. CRM-квалификация лида (`status`, `clientType`, `leadQualification`, `leadSource`):**\n- **Чтение/запись** — `GET/PATCH /api/v1/users/{id}/qualifications` (**ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**).\n  PATCH: `status`, `clientType`, `leadQualification`, `leadSourceId` и/или `clearLeadSource=true`.\n- **История** — `GET /api/v1/users/{id}/qualifications/history` (пагинация + query-фильтры); админ-список — `/api/v1/user-lead-qualification-histories`.\n- **Справочник источников** — `/api/v1/lead-sources` (13 системных значений из seed, флаги `updatable`/`deletable`).\n- **Профиль пользователя** (`UserResponseV1`) — без CRM-квалификации/менеджера; связь Bitrix — поле `bitrix`; **`isActive`** — признак активности (для сотрудников B24 синхронизируется при импорте); **`createdBy`/`updatedBy`** — JPA audit (JWT `sub` или `ANONYMOUS`).\n- **Идемпотентность** — повторный PATCH без фактических изменений не шлёт уведомление (`onlyIfMutated`).\n- **Демо UI** — `/qualification-demo.html` (ручная проверка без отдельного фронтенда).\n\n\n**9. Менеджер и CRM timeline:**\n- **Текущий менеджер** — `GET/PATCH /api/v1/users/{id}/manager` (**ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**); ответ `UserManagerResponseV1` (`userId`, `managerId`).\n- **Журнал назначений** — `GET /api/v1/users/{id}/manager-assignments` (пагинация + query-фильтры); админ-список — `/api/v1/user-manager-assignment-histories`.\n- **CRM timeline Bitrix24** — `GET /api/v1/users/{id}/crm/timeline` (пагинация + query-фильтры); админ-список — `/api/v1/user-crm-timelines`.\n- **Связи Bitrix24** — админ-список `/api/v1/user-bitrix-links` (+ поле `bitrix` в профиле).\n- **Импорт Bitrix24** — `POST /api/v1/integrations/bitrix/import` (только **SUPERADMIN**, feature-flag; при `app.bitrix24.enabled=false` — **404**).\n  Сотрудники: `user.get` с `ACTIVE=true` и `ACTIVE=false`; `UserResponseV1.isActive` = `ACTIVE` в Bitrix.\n- **Плановая синхронизация** — `GET/PATCH /api/v1/integrations/bitrix/scheduled-sync` (runtime toggle; UI BFF **Super Admin** — `https://bff.rukki.pro/bff-demo.html#super-admin`).\n- Поля менеджера и квалификации **не дублируются** в `UserResponseV1` — только отдельные sub-resources (+ `bitrix` link).\n\n\n**Авторизация (JWT, локальный issuer identity-service):**\n- Заголовок `Authorization: Bearer <access_token>`.\n- В Swagger UI нажмите **Authorize** и вставьте **только значение токена** (префикс `Bearer` подставляется автоматически).\n  Получить пару токенов: Call Flow ([ws-login.html](/ws-login.html)), Telegram Gateway на BFF ([login.html](https://bff.rukki.pro/login.html)),\n  Login Widget (`POST /api/v1/auth/telegram`, бот **RukkiAuthBot** на клиенте) или OAuth2 refresh (`POST /api/v1/auth/token`, `/api/v1/auth/refresh`).\n- Роли — claim `realm_access.roles` (см. `/api/v1/roles` и тег **Role API V1**).\n- Идентификатор пользователя — claim `sub` (UUID v4).\n- JWKS: `GET /.well-known/jwks.json` (RS256, `kid` в header JWT); отзыв access — blacklist `jti` в Redis.\n\n\n**Пагинация и сортировка** (`GET /api/v1/users`, `GET /api/v1/roles`, `GET /api/v1/professions` и другие списки с `PagedResponse`):\n- Query: `page`, `size`, `sort` (в Swagger — отдельные параметры).\n- **`page`** — номер страницы **с 1** (`page=1` — первая; `page=0` не используется).\n- **`size`** — элементов на странице (по умолчанию из `app.web.pageable.default-page-size`, максимум 100).\n- **`sort`** — `поле,направление` (например `createdAt,desc`); недопустимое поле → **400**.\n- Ответ: `PagedResponse` — `content`, `currentPage` (с 1), `pageSize`, `totalElements`.\n\n| Список | Допустимые поля `sort` |\n|--------|-------------------------|\n| users | `phoneAuth`, `firstName`, `lastName`, `middleName`, `email`, `status`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n\nQuery-фильтры `GET /api/v1/users` (и `/count`): `status`, `isActive`, `clientType`, `leadQualification`, `role`, гео-параметры — см. `UserFilterRequestV1`.\n| roles | `name`, `description`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n| professions | `code`, `name`, `category`, `minRank`, `maxRank`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n| lead-sources | `code`, `description`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n| user-addresses | `label`, `city`, `region`, `street`, `postalCode`, `createdAt`, `updatedAt`, `primaryAddress`, `createdBy`, `updatedBy` |\n| user-bitrix-links | `bitrixUserId`, `bitrixContactId`, `bitrixCompanyId`, `bitrixLeadId`, `companyName`, `importedAt`, `lastSyncedAt` |\n| user-crm-timelines | `occurredAt`, `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n| user-manager-assignment-histories | `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n| user-lead-qualification-histories | `createdAt`, `updatedAt`, `createdBy`, `updatedBy` |\n\n\n**Модель ролей (JWT):**\n- Справочник — `/api/v1/roles` (PostgreSQL); системные роли защищены от удаления и изменения.\n- **USER** — self-service (`/api/v1/users/me`), базовые операции профиля.\n- **MANAGER, SUPERVISOR, ADMIN, SUPERADMIN** — административное чтение пользователей; создание (`POST /api/v1/users`) — те же роли; прочие мутации — **ADMIN**, **SUPERADMIN**.\n- Назначение ролей — `/api/v1/users/{id}/roles` (Identity API).\n\n\n**Идемпотентные мутации (без лишних уведомлений):**\nПовтор ban/unban, добавление/удаление канала, категории уведомлений или профессии без фактического изменения данных возвращает успех, но **не** публикует Kafka-уведомление (`@NotifyOnSuccess(onlyIfMutated = true)`).\n","version":"1.0.0-SNAPSHOT"},"servers":[{"url":"https://auth.rukki.pro","description":"Production Server"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"User Bitrix Link API V1","description":"Связи пользователей с Bitrix24 (`/api/v1/user-bitrix-links`).\nАдминистративный список с фильтрацией; в профиле пользователя — поле `bitrix`."},{"name":"Identity API V1","description":"Firebase-идентичности, устройства и административные операции с учётными записями (`/api/v1/identities`).\nНазначение/отзыв профессий пользователю — `GET|POST .../{id}/professions` (assign/revoke).\nПолный logout из Firebase-контура — `POST /api/v1/identities/auth/logout`."},{"name":"Profession API V1","description":"Управление справочником профессий auth.rukki.pro (`/api/v1/professions`).\nКатегория A — операторы спецтехники (жёсткая привязка к equipment_type);\nкатегория B — сопутствующие профессии на объекте."},{"name":"Role API V1","description":"Управление справочником ролей приложения (`/api/v1/roles`).\nСистемные роли (SUPERADMIN, ADMIN, MANAGER, USER, CUSTOMER, EXECUTOR и др.) защищены от удаления и изменения."},{"name":"User Address API V1","description":"Почтовые адреса пользователей auth.rukki.pro (`/api/v1/user-addresses`).\nАдминистративный список с фильтрацией; self-service — `/api/v1/users/me/addresses`."},{"name":"Auth API V1","description":"Аутентификация (Call Flow, Telegram Gateway, Telegram Login Widget), выдача пары **access/refresh JWT**, обновление токенов и logout.\nAccess передаётся в `Authorization: Bearer`; refresh — только на `POST /token` или `POST /refresh`.\nПодробный сценарий — в описании группы **core-v1** (раздел «Локальные JWT»)."},{"name":"User CRM Timeline API V1","description":"CRM timeline Bitrix24 (`/api/v1/user-crm-timelines`).\nАдминистративный список с фильтрацией; по пользователю —\n`GET /api/v1/users/{id}/crm/timeline`."},{"name":"User Lead Qualification History API V1","description":"Журнал квалификации лида (`/api/v1/user-lead-qualification-histories`).\nАдминистративный список с фильтрацией; по пользователю —\n`GET /api/v1/users/{id}/qualifications/history`."},{"name":"Integrations API V1","description":"Интеграции Identity (Bitrix24 и др.)"},{"name":"Lead Source API V1","description":"Справочник источников лида (`/api/v1/lead-sources`) для CRM: стабильный `code` и `description` для UI.\nСистемные значения (Входящий, Сайт, Telegram, Авито и др.) защищены флагами `updatable`/`deletable`."},{"name":"User Manager Assignment History API V1","description":"Журнал назначений менеджера (`/api/v1/user-manager-assignment-histories`).\nАдминистративный список с фильтрацией; по пользователю —\n`GET /api/v1/users/{id}/manager-assignments`."},{"name":"JWT API V1","description":"JWKS (`/.well-known/jwks.json`) и администрирование ключей подписи JWT.\nРотация ключа, точечный отзыв и отзыв сессий пользователя — **ADMIN**, **SUPERADMIN**."},{"name":"User API V1","description":"**Канонический REST API пользователей** под префиксом **`/api/v1/users`** (PostgreSQL).\n\nПоддерживает self-service сценарии (`/me`: просмотр, обновление, удаление учетной записи, управление каналами/категориями уведомлений, профессиями)\nи административные операции (список пользователей, создание, поиск, изменения по `id`, ban/unban, роли, CRM-квалификация).\n\n**Доступ и роли.** Endpoints `/me/**` доступны любому аутентифицированному пользователю (валидный Bearer access JWT).\nАдминистративное чтение (список, count, GET по id) — **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**;\nсоздание пользователя (`POST /`) — **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**; прочие мутации — **ADMIN**, **SUPERADMIN**.\nCRM-квалификация (`GET/PATCH /{id}/qualifications`, `GET /{id}/qualifications/history`),\nменеджер (`GET/PATCH /{id}/manager`, `GET /{id}/manager-assignments`) и CRM timeline\n(`GET /{id}/crm/timeline`) — **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\n\nПоле `avatarFileId` (UUID в file-service); при удалении файла ссылки снимает Kafka `rukki.file.deleted.v1` (см. core-v1 info).\nГео-данные (`geoData`): 0..N точек с координатами и `radiusMeters`; управление через PUT/PATCH профиля.\nПрофессии (`/me/professions`): назначение из справочника `/api/v1/professions`; идемпотентные PUT/POST/DELETE.\nАдреса (`/me/addresses`, `/api/v1/user-addresses`): почтовые адреса 0..N; CRUD и полная замена списка."}],"paths":{"/api/v1/auth/webhook/smsru":{"get":{"tags":["Auth API V1"],"summary":"Обработка вебхука от SMS.RU","description":"Принимает асинхронные события от SMS.RU при успешном подтверждении номера (CallCheck). Всегда возвращает строку '100'.","operationId":"handleSmsRuCallWebhook","parameters":[{"name":"payload","in":"query","required":true,"schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]},"post":{"tags":["Auth API V1"],"summary":"Обработка вебхука от SMS.RU","description":"Принимает асинхронные события от SMS.RU при успешном подтверждении номера (CallCheck). Всегда возвращает строку '100'.","operationId":"handleSmsRuCallWebhook_1","parameters":[{"name":"payload","in":"query","required":true,"schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/users/{id}":{"get":{"tags":["User API V1"],"summary":"Получить детали пользователя по ID","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**. Возвращает полную информацию о пользователе по его уникальному идентификатору (UUID),\nвключая `avatarFileId` (UUID файла в file-service или отсутствует).","operationId":"findById","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Успешное получение данных пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"summary":"Полное обновление пользователя по ID","description":"Доступно: **ADMIN**, **SUPERADMIN**. Полностью перезаписывает персональные данные указанного пользователя\n(имя, фамилия, отчество, email, ИНН, телефоны, УКЭП, каналы и категории уведомлений, `avatarFileId`, `geoData`).\n`avatarFileId` — UUID файла в file-service; `null` снимает аватар; `geoData` — `null` или `[]` удаляет все зоны.","operationId":"update","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequestV1"}}},"required":true},"responses":{"200":{"description":"Данные пользователя успешно обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User API V1"],"summary":"Частично изменить пользователя по ID","description":"Доступно: **ADMIN**, **SUPERADMIN**. Частично обновляет личную информацию указанного пользователя.\nПоля со значением `null` не меняются. `clientType`, `leadQualification` и `leadSource` здесь недоступны —\nиспользуйте `PATCH /api/v1/users/{id}/qualifications`.\n`avatarFileId` (UUID в file-service) устанавливается только при явной передаче UUID;\nснять аватар через PATCH нельзя — используйте PUT с `avatarFileId: null`.","operationId":"partialUpdate","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateUserRequestV1"}}},"required":true},"responses":{"200":{"description":"Данные пользователя успешно обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/addresses":{"get":{"tags":["User API V1"],"summary":"Получить адреса пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"getAddresses","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Список адресов получен","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"summary":"Заменить список адресов пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**. Пустой список очищает адреса. Идемпотентно.","operationId":"replaceAddresses","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceUserAddressesRequestV1"}}},"required":true},"responses":{"200":{"description":"Адреса обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["User API V1"],"summary":"Создать адрес пользователю","description":"Доступно: **ADMIN**, **SUPERADMIN**.","operationId":"createAddress","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressRequestV1"}}},"required":true},"responses":{"201":{"description":"Адрес создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/addresses/{addressId}":{"get":{"tags":["User API V1"],"operationId":"getAddress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"operationId":"updateAddress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressRequestV1"}}},"required":true},"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User API V1"],"operationId":"deleteAddress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User API V1"],"operationId":"partialUpdateAddress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateUserAddressRequestV1"}}},"required":true},"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me":{"get":{"tags":["User API V1"],"summary":"Получить данные текущего пользователя","description":"Доступно: Любому авторизованному пользователю. Возвращает полную информацию о текущем авторизованном пользователе\n(UUID из JWT), включая `avatarFileId` (UUID файла в file-service или отсутствует).","operationId":"getMe","responses":{"200":{"description":"Успешное получение данных пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"summary":"Полное обновление данных пользователя","description":"Доступно: Любому авторизованному пользователю. Полностью перезаписывает персональные данные текущего пользователя\n(имя, фамилия, отчество, email, ИНН, телефон СБП, телефон MAX, ID УКЭП, каналы и категории уведомлений, `avatarFileId`).\n`avatarFileId` — UUID файла в file-service; `null` снимает аватар.","operationId":"updateMe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequestV1"}}},"required":true},"responses":{"200":{"description":"Данные пользователя успешно обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User API V1"],"summary":"Удаление собственной учетной записи","description":"Доступно: Любому авторизованному пользователю. Выполняет безопасное (мягкое) удаление и анонимизацию собственной учетной записи, а также генерирует системное событие USER_DELETED (Outbox) для очистки данных пользователя во всех остальных микросервисах платформы.","operationId":"deleteMe","responses":{"204":{"description":"Учетная запись успешно удалена"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User API V1"],"summary":"Частичное обновление данных пользователя","description":"Доступно: Любому авторизованному пользователю. Частично обновляет персональные данные пользователя.\nПоля со значением `null` не меняются. `clientType`, `leadQualification` и `leadSource` через `/me` изменить нельзя\n(только чтение в ответе); изменение — `PATCH /api/v1/users/{id}/qualifications` (роли **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**).\n`avatarFileId` устанавливается только при явной передаче UUID;\nснять аватар через PATCH нельзя — используйте PUT с `avatarFileId: null`.","operationId":"partialUpdateMe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateUserRequestV1"}}},"required":true},"responses":{"200":{"description":"Данные пользователя успешно обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me/professions":{"get":{"tags":["User API V1"],"summary":"Получить свои профессии","description":"Доступно: любому авторизованному пользователю.","operationId":"getProfessionsMe","responses":{"200":{"description":"Список профессий получен","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfessionSummaryResponseV1"}}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"summary":"Заменить набор своих профессий","description":"Доступно: любому авторизованному пользователю. Пустой список очищает профессии. Идемпотентно.","operationId":"replaceProfessionsMe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceUserProfessionsRequestV1"}}},"required":true},"responses":{"200":{"description":"Профессии обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me/addresses":{"get":{"tags":["User API V1"],"summary":"Получить свои адреса","description":"Доступно: любому авторизованному пользователю.","operationId":"getAddressesMe","responses":{"200":{"description":"Список адресов получен","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"summary":"Заменить список своих адресов","description":"Доступно: любому авторизованному пользователю. Пустой список очищает адреса. Идемпотентно.","operationId":"replaceAddressesMe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceUserAddressesRequestV1"}}},"required":true},"responses":{"200":{"description":"Адреса обновлены","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["User API V1"],"summary":"Добавить свой адрес","description":"Доступно: любому авторизованному пользователю.","operationId":"createAddressMe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressRequestV1"}}},"required":true},"responses":{"201":{"description":"Адрес создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me/addresses/{addressId}":{"get":{"tags":["User API V1"],"operationId":"getAddressMe","parameters":[{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User API V1"],"operationId":"updateAddressMe","parameters":[{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressRequestV1"}}},"required":true},"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User API V1"],"operationId":"deleteAddressMe","parameters":[{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User API V1"],"operationId":"partialUpdateAddressMe","parameters":[{"name":"addressId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateUserAddressRequestV1"}}},"required":true},"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-addresses/{id}":{"get":{"tags":["User Address API V1"],"summary":"Получить адрес по ID","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"findById_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Адрес получен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["User Address API V1"],"summary":"Полностью обновить адрес","description":"Доступно: **ADMIN**, **SUPERADMIN**.","operationId":"update_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressRequestV1"}}},"required":true},"responses":{"200":{"description":"Адрес обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User Address API V1"],"summary":"Удалить адрес","description":"Доступно: **ADMIN**, **SUPERADMIN**.","operationId":"deleteById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Адрес удалён"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User Address API V1"],"summary":"Частично обновить адрес","description":"Доступно: **ADMIN**, **SUPERADMIN**.","operationId":"partialUpdate_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateUserAddressRequestV1"}}},"required":true},"responses":{"200":{"description":"Адрес обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/roles/{id}":{"get":{"tags":["Role API V1"],"summary":"Получить детали роли по ID","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**. Возвращает полную информацию об указанной роли по её уникальному идентификатору.","operationId":"findById_2","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор роли","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Успешное получение данных роли","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["Role API V1"],"summary":"Полное редактирование существующей роли","description":"Доступно: ADMIN, SUPERADMIN. Полноценно обновляет название и/или описание существующей роли (PUT). Если поле description не передано, оно затирается.","operationId":"update_2","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор обновляемой роли","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequestV1"}}},"required":true},"responses":{"200":{"description":"Роль успешно обновлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["Role API V1"],"summary":"Удалить существующую роль","description":"Доступно: ADMIN, SUPERADMIN. Удаляет существующую роль из справочника.","operationId":"deleteById_1","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор удаляемой роли","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Роль успешно удалена"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["Role API V1"],"summary":"Частично редактировать существующую роль","description":"Доступно: ADMIN, SUPERADMIN. Частично обновляет название и/или описание существующей роли. Поля, переданные со значением null, игнорируются.","operationId":"partialUpdate_2","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор обновляемой роли","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateRoleRequestV1"}}},"required":true},"responses":{"200":{"description":"Роль успешно обновлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/professions/{id}":{"get":{"tags":["Profession API V1"],"summary":"Получить детали профессии по ID","description":"Доступно: любому авторизованному пользователю.","operationId":"findById_3","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор профессии","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Успешное получение данных профессии","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["Profession API V1"],"summary":"Полное редактирование существующей профессии","description":"Доступно: **ADMIN**, **SUPERADMIN**. Полноценно обновляет все поля (PUT).","operationId":"update_3","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор обновляемой профессии","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfessionRequestV1"}}},"required":true},"responses":{"200":{"description":"Профессия успешно обновлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["Profession API V1"],"summary":"Удалить существующую профессию","description":"Доступно: **ADMIN**, **SUPERADMIN**. Нельзя удалить профессию, назначенную пользователям (**409 Conflict**).","operationId":"deleteById_2","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор удаляемой профессии","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Профессия успешно удалена"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["Profession API V1"],"summary":"Частично редактировать существующую профессию","description":"Доступно: **ADMIN**, **SUPERADMIN**. Обновляет только переданные поля. После слияния проверяется согласованность категории A/B и `equipmentBinding` (несовместимое сочетание → **400**).","operationId":"partialUpdate_3","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор обновляемой профессии","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateProfessionRequestV1"}}},"required":true},"responses":{"200":{"description":"Профессия успешно обновлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/lead-sources/{id}":{"get":{"tags":["Lead Source API V1"],"summary":"Получить детали источника лида по ID","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**. Возвращает полную информацию об указанном источнике лида по его уникальному идентификатору.","operationId":"findById_4","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор источника лида","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Успешное получение данных источника лида","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSourceResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"put":{"tags":["Lead Source API V1"],"summary":"Полное редактирование существующего источника лида","description":"Доступно: **ADMIN**, **SUPERADMIN**. Полноценно обновляет код и/или описание существующего источника лида (PUT).","operationId":"update_4","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор обновляемого источника лида","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadSourceRequestV1"}}},"required":true},"responses":{"200":{"description":"Источник лида успешно обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSourceResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["Lead Source API V1"],"summary":"Удалить существующий источник лида","description":"Доступно: **ADMIN**, **SUPERADMIN**. Удаляет существующий источник лида из справочника. Системные записи из seed и источники, на которые ссылаются пользователи, удалить нельзя (**409**).","operationId":"deleteById_3","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор удаляемого источника лида","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Источник лида успешно удалён"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["Lead Source API V1"],"summary":"Частично редактировать существующий источник лида","description":"Доступно: **ADMIN**, **SUPERADMIN**. Частично обновляет код и/или описание. Поля, переданные со значением null, игнорируются.","operationId":"partialUpdate_4","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор обновляемого источника лида","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialUpdateLeadSourceRequestV1"}}},"required":true},"responses":{"200":{"description":"Источник лида успешно обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSourceResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/admin/users/{id}/phone-auth":{"put":{"tags":["Identity API V1"],"summary":"Принудительная смена номера телефона","description":"Доступно: ADMIN, SUPERADMIN. Административный эндпоинт. Позволяет принудительно изменить номер телефона (логин) пользователя по RUKKI-ID. Автоматически обновляет номер в базе данных и синхронизирует изменения с провайдером аутентификации.","operationId":"updatePhoneAuth","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneRequestV1"}}},"required":true},"responses":{"200":{"description":"Номер телефона успешно изменен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneAuthResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users":{"get":{"tags":["User API V1"],"summary":"Получить список пользователей","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**. Возвращает список всех пользователей с поддержкой пагинации, сортировки и гибкой фильтрации по полям сущности.\nКаждый элемент `content` — полный `UserResponseV1`, включая `avatarFileId`, `geoData` и `isActive`.\n**Гео-фильтры** (PostgreSQL earthdistance): `hasGeoData=false` — только пользователи без зон (остальные гео-параметры → 400);\n`isActive` — признак активности (`true`/`false`, для сотрудников Bitrix24 после импорта);\n`minRadiusMeters`/`maxRadiusMeters`, bounding box, `nearLatitude`/`nearLongitude` + `coverPoint` (default `true`) или `maxDistanceMeters` при `coverPoint=false`.\nВсе гео-условия (кроме `hasGeoData=false`) относятся к одной зоне (EXISTS).","operationId":"all","parameters":[{"name":"phone","in":"query","description":"Часть номера телефона","required":false,"schema":{"type":"string"}},{"name":"firstName","in":"query","description":"Часть имени","required":false,"schema":{"type":"string"}},{"name":"lastName","in":"query","description":"Часть фамилии","required":false,"schema":{"type":"string"}},{"name":"middleName","in":"query","description":"Часть отчества","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","description":"Часть email","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Статус пользователя","required":false,"schema":{"type":"string","enum":["LEAD","ACTIVE","BANNED","DELETED"]}},{"name":"isActive","in":"query","description":"Признак активности записи (true — активен, false — деактивирован)","required":false,"schema":{"type":"boolean"}},{"name":"clientType","in":"query","description":"Тип клиента: B2C или B2B","required":false,"schema":{"type":"string","enum":["B2C","B2B"]}},{"name":"leadQualification","in":"query","description":"Квалификация лида в CRM (N, A–D, X)","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"role","in":"query","description":"Роль пользователя; повтор параметра — OR (например role=MANAGER&role=ADMIN)","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":100,"minLength":0}}},{"name":"hasGeoData","in":"query","description":"Наличие гео-зон: true — есть; false — нет (без других гео-параметров)","required":false,"schema":{"type":"boolean"}},{"name":"minRadiusMeters","in":"query","description":"Минимальный radiusMeters хотя бы у одной зоны","required":false,"schema":{"type":"integer","format":"int64","minimum":1}},{"name":"maxRadiusMeters","in":"query","description":"Максимальный radiusMeters хотя бы у одной зоны","required":false,"schema":{"type":"integer","format":"int64","minimum":1}},{"name":"geoLatitudeMin","in":"query","description":"Минимальная широта центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":90.0,"minimum":-90.0}},{"name":"geoLatitudeMax","in":"query","description":"Максимальная широта центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":90.0,"minimum":-90.0}},{"name":"geoLongitudeMin","in":"query","description":"Минимальная долгота центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":180.0,"minimum":-180.0}},{"name":"geoLongitudeMax","in":"query","description":"Максимальная долгота центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":180.0,"minimum":-180.0}},{"name":"nearLatitude","in":"query","description":"Широта точки поиска (WGS-84); пара с nearLongitude","required":false,"schema":{"type":"number","format":"double","maximum":90.0,"minimum":-90.0}},{"name":"nearLongitude","in":"query","description":"Долгота точки поиска (WGS-84); пара с nearLatitude","required":false,"schema":{"type":"number","format":"double","maximum":180.0,"minimum":-180.0}},{"name":"coverPoint","in":"query","description":"true — зона покрывает точку (default); false — центр зоны в maxDistanceMeters","required":false,"schema":{"type":"string"},"example":true},{"name":"maxDistanceMeters","in":"query","description":"При coverPoint=false — макс. расстояние до центра зоны (метры)","required":false,"schema":{"type":"integer","format":"int64","minimum":1}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Успешное получение списка пользователей","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseUserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["User API V1"],"summary":"Создать нового пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**. Создаёт пользователя в PostgreSQL и публикует событие регистрации\n(transactional outbox). Тело запроса — {@link CreateUserRequestV1}\n(код страны, телефон авторизации, имя/фамилия/отчество, опционально orgId, managerId, draftId).\nВозвращает полный профиль {@link UserResponseV1}, в отличие от {@code POST /api/v1/identities},\nгде отдаётся краткий контракт с {@code rukki_id} и {@code firebase_status}.","operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequestV1"}}},"required":true},"responses":{"201":{"description":"Пользователь успешно создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/unban":{"post":{"tags":["User API V1"],"summary":"Разблокировка учетной записи пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**. Разблокирует доступ учетной записи. Идемпотентно: повторный unban не шлёт уведомление.","operationId":"unbanUser","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Учетная запись успешно разблокирована","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/roles/revoke":{"post":{"tags":["User API V1"],"summary":"Отозвать роли у пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**. Массовый отзыв ролей у пользователя\n(базовую роль USER отозвать нельзя)","operationId":"revokeRoles","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignmentRequestV1"}}},"required":true},"responses":{"201":{"description":"Роли успешно отозваны"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/roles/assign":{"post":{"tags":["User API V1"],"summary":"Назначить роли пользователю","description":"Доступно: **ADMIN**, **SUPERADMIN**. Массовое назначение ролей пользователю","operationId":"assignRoles","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignmentRequestV1"}}},"required":true},"responses":{"201":{"description":"Роли успешно назначены"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/ban":{"post":{"tags":["User API V1"],"summary":"Блокировка учетной записи пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**. Блокирует доступ учетной записи пользователя. Идемпотентно: повторный ban не шлёт уведомление.","operationId":"banUser","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Учетная запись пользователя успешно обновлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me/professions/{professionId}":{"post":{"tags":["User API V1"],"summary":"Добавить профессию себе","description":"Доступно: любому авторизованному пользователю. Идемпотентно.","operationId":"addProfessionMe","parameters":[{"name":"professionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Профессия добавлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User API V1"],"summary":"Удалить профессию у себя","description":"Доступно: любому авторизованному пользователю. Идемпотентно.","operationId":"removeProfessionMe","parameters":[{"name":"professionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Профессия удалена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me/notification-categories/{category}":{"post":{"tags":["User API V1"],"summary":"Добавить категорию уведомлений","description":"Доступно: любому авторизованному пользователю. Идемпотентно добавляет категорию в конец списка.","operationId":"addNotificationCategoryMe","parameters":[{"name":"category","in":"path","description":"Код категории, например ORDER_CREATED","required":true,"schema":{"type":"string","enum":["ORDER_CREATED","CONTRACTOR_ASSIGNED","CONTRACTOR_ARRIVED_TO_OBJECT","CONTRACTOR_COMPLETED_WORK","CONTRACTOR_REASSIGNED","NEW_RESPONSE_TO_ORDER","PAYMENT_RECEIVED","CONTRACTOR_DEPARTED_TO_ORDER","COUNTER_OFFER"]}}],"responses":{"200":{"description":"Категория добавлена (или уже была в списке)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User API V1"],"summary":"Удалить категорию уведомлений","description":"Доступно: любому авторизованному пользователю. Идемпотентно удаляет категорию из списка.","operationId":"removeNotificationCategoryMe","parameters":[{"name":"category","in":"path","description":"Код категории","required":true,"schema":{"type":"string","enum":["ORDER_CREATED","CONTRACTOR_ASSIGNED","CONTRACTOR_ARRIVED_TO_OBJECT","CONTRACTOR_COMPLETED_WORK","CONTRACTOR_REASSIGNED","NEW_RESPONSE_TO_ORDER","PAYMENT_RECEIVED","CONTRACTOR_DEPARTED_TO_ORDER","COUNTER_OFFER"]}}],"responses":{"200":{"description":"Категория удалена (или отсутствовала)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/me/channels/{channel}":{"post":{"tags":["User API V1"],"summary":"Добавить канал уведомлений","description":"Доступно: любому авторизованному пользователю. Идемпотентно добавляет канал в конец списка; дубликат не создаётся.","operationId":"addNotificationChannelMe","parameters":[{"name":"channel","in":"path","description":"Канал: EMAIL, SMS, WHATSAPP, MAX, TELEGRAM","required":true,"schema":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","MAX","TELEGRAM"]}}],"responses":{"200":{"description":"Канал добавлен (или уже был в списке)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["User API V1"],"summary":"Удалить канал уведомлений","description":"Доступно: любому авторизованному пользователю. Идемпотентно удаляет канал из списка; отсутствие канала не считается ошибкой.","operationId":"removeNotificationChannelMe","parameters":[{"name":"channel","in":"path","description":"Канал: EMAIL, SMS, WHATSAPP, MAX, TELEGRAM","required":true,"schema":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","MAX","TELEGRAM"]}}],"responses":{"200":{"description":"Канал удалён (или отсутствовал)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-addresses":{"get":{"tags":["User Address API V1"],"summary":"Получить список адресов пользователей","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"all_1","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя-владельца адреса","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"label","in":"query","description":"Поиск по подстроке в метке адреса (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"countryCode","in":"query","description":"Фильтрация по ISO-коду страны","required":false,"schema":{"type":"string"}},{"name":"city","in":"query","description":"Поиск по подстроке в городе (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"region","in":"query","description":"Поиск по подстроке в регионе / районе (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"street","in":"query","description":"Поиск по подстроке в улице (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"postalCode","in":"query","description":"Поиск по подстроке в почтовом индексе","required":false,"schema":{"type":"string"}},{"name":"primary","in":"query","description":"Фильтрация по признаку основного адреса","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Список адресов получен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseUserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["User Address API V1"],"summary":"Создать адрес пользователю","description":"Доступно: **ADMIN**, **SUPERADMIN**.","operationId":"create_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserAddressRequestV1"}}},"required":true},"responses":{"201":{"description":"Адрес создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAddressResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/roles":{"get":{"tags":["Role API V1"],"summary":"Получить список ролей (Справочник)","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**. Возвращает список всех ролей с поддержкой пагинации, сортировки и гибкой фильтрации по полям сущности.","operationId":"all_2","parameters":[{"name":"name","in":"query","description":"Поиск по подстроке в названии роли (без учета регистра)","required":false,"schema":{"type":"string"}},{"name":"updatable","in":"query","description":"Фильтрация по флагу возможности редактирования","required":false,"schema":{"type":"boolean"}},{"name":"deletable","in":"query","description":"Фильтрация по флагу возможности удаления","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Успешное получение списка ролей","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseRoleResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["Role API V1"],"summary":"Создать новую роль","description":"Доступно: ADMIN, SUPERADMIN. Создает новую роль в справочнике. Название роли должно быть уникальным.","operationId":"create_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleRequestV1"}}},"required":true},"responses":{"201":{"description":"Роль успешно создана","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/professions":{"get":{"tags":["Profession API V1"],"summary":"Получить список профессий (Справочник)","description":"Доступно: любому авторизованному пользователю. Поддерживает пагинацию, сортировку и фильтрацию по категории, коду, названию и флагам.","operationId":"all_3","parameters":[{"name":"name","in":"query","description":"Поиск по подстроке в названии профессии (без учета регистра)","required":false,"schema":{"type":"string"}},{"name":"code","in":"query","description":"Поиск по подстроке в коде профессии (без учета регистра)","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","description":"Фильтрация по категории: A или B","required":false,"schema":{"type":"string","enum":["A","B"]}},{"name":"equipmentBinding","in":"query","description":"Фильтрация по типу привязки к технике: STRICT или OPTIONAL","required":false,"schema":{"type":"string","enum":["STRICT","OPTIONAL"]}},{"name":"updatable","in":"query","description":"Фильтрация по флагу возможности редактирования","required":false,"schema":{"type":"boolean"}},{"name":"deletable","in":"query","description":"Фильтрация по флагу возможности удаления","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Успешное получение списка профессий","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseProfessionResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["Profession API V1"],"summary":"Создать новую профессию","description":"Доступно: **ADMIN**, **SUPERADMIN**. Код профессии должен быть уникальным.","operationId":"create_3","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProfessionRequestV1"}}},"required":true},"responses":{"201":{"description":"Профессия успешно создана","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/lead-sources":{"get":{"tags":["Lead Source API V1"],"summary":"Получить список источников лида (Справочник)","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**. Возвращает список источников лида с поддержкой пагинации, сортировки и фильтрации по полям сущности.","operationId":"all_4","parameters":[{"name":"code","in":"query","description":"Поиск по подстроке в коде","required":false,"schema":{"type":"string"}},{"name":"description","in":"query","description":"Поиск по подстроке в описании","required":false,"schema":{"type":"string"}},{"name":"updatable","in":"query","description":"Фильтр по флагу updatable","required":false,"schema":{"type":"boolean"}},{"name":"deletable","in":"query","description":"Фильтр по флагу deletable","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Успешное получение списка источников лида","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseLeadSourceResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"post":{"tags":["Lead Source API V1"],"summary":"Создать новый источник лида","description":"Доступно: **ADMIN**, **SUPERADMIN**. Создаёт новый источник лида в справочнике. Код должен быть уникальным.","operationId":"create_4","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadSourceRequestV1"}}},"required":true},"responses":{"201":{"description":"Источник лида успешно создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSourceResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/integrations/bitrix/import":{"post":{"tags":["Integrations API V1"],"summary":"Массовое обновление Bitrix24 (ручной запуск)","description":"Доступно: только **SUPERADMIN**.\nUpsert сотрудников (активных и неактивных Bitrix `ACTIVE`), компаний, контактов,\nсделок/лидов (воронки C31/C39) и CRM timeline из Bitrix24.\nДля сотрудников: `user.is_active` = `ACTIVE` в Bitrix (`false` — уволенные/деактивированные).\nПлановый запуск — `GET/PATCH /api/v1/integrations/bitrix/scheduled-sync` или UI BFF **Super Admin**\n(`https://bff.rukki.pro/bff-demo.html#super-admin`).\nПараллельный запуск (ручной + плановый) → **502** («импорт уже выполняется»).\nТребует `BITRIX24_WEBHOOK_BASE_URL` / `app.bitrix24.webhook-base-url`.\nПри `app.bitrix24.enabled=false` контроллер не регистрируется — **404**.","operationId":"importAll","responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}},"502":{"description":"Bitrix24 недоступен, импорт не сконфигурирован или уже выполняется","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":502,"message":"Интеграция Bitrix24 недоступна: Импорт Bitrix24 уже выполняется","details":null,"path":"/api/v1/integrations/bitrix/import","timestamp":"2026-07-14T13:00:00Z"}}}}}}},"/api/v1/integrations/bitrix/import/cancel":{"post":{"tags":["Integrations API V1"],"summary":"Остановить выполняющийся импорт Bitrix24","description":"Доступно: только **SUPERADMIN**.\nGraceful stop: импорт завершит текущую запись/страницу и остановится между шагами.\nСтатус run → `CANCELLED`, частичные счётчики в `lastRunResult`.\nЕсли импорт не выполняется → **502**.","operationId":"cancelImport","responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}},"502":{"description":"Bitrix24 недоступен, импорт не сконфигурирован или уже выполняется","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":502,"message":"Интеграция Bitrix24 недоступна: Импорт Bitrix24 уже выполняется","details":null,"path":"/api/v1/integrations/bitrix/import","timestamp":"2026-07-14T13:00:00Z"}}}}}}},"/api/v1/identities":{"post":{"tags":["Identity API V1"],"summary":"Создать нового пользователя","description":"Используется для создания пользователя (например, при импорте из CRM или регистрации). Генерирует уникальный RUKKI-ID, сохраняет пользователя в локальную БД и запускает синхронизацию с провайдером аутентификации.","operationId":"createUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequestV1"}}},"required":true},"responses":{"201":{"description":"Пользователь успешно создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/{id}/roles/revoke":{"post":{"tags":["Identity API V1"],"summary":"Отозвать роли у пользователя","description":"Доступно: ADMIN, SUPERADMIN. Массовый отзыв ролей у пользователя (базовую роль USER отозвать нельзя)","operationId":"revokeRoles_1","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя (RUKKI-ID)","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignmentRequestV1"}}},"required":true},"responses":{"201":{"description":"Роль успешно отозвана"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/{id}/roles/assign":{"post":{"tags":["Identity API V1"],"summary":"Назначить роли пользователю","description":"Доступно: ADMIN, SUPERADMIN. Массовое назначение ролей пользователю","operationId":"assignRoles_1","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя (RUKKI-ID)","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignmentRequestV1"}}},"required":true},"responses":{"201":{"description":"Роли успешно назначены"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/{id}/professions/revoke":{"post":{"tags":["Identity API V1"],"summary":"Отозвать профессии у пользователя","description":"Доступно: ADMIN, SUPERADMIN. Массовый отзыв профессий у пользователя. Идемпотентно.","operationId":"revokeProfessions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionAssignmentRequestV1"}}},"required":true},"responses":{"201":{"description":"Профессии успешно отозваны"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/{id}/professions/assign":{"post":{"tags":["Identity API V1"],"summary":"Назначить профессии пользователю","description":"Доступно: ADMIN, SUPERADMIN. Массовое добавление профессий из справочника. Идемпотентно.","operationId":"assignProfessions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionAssignmentRequestV1"}}},"required":true},"responses":{"201":{"description":"Профессии успешно назначены"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/me/phone-change/init":{"post":{"tags":["Identity API V1"],"summary":"Инициация самостоятельной смены номера","description":"Первый шаг процесса смены номера самим пользователем. Подготавливает систему к привязке нового номера телефона.","operationId":"initPhoneChange","responses":{"201":{"description":"Успешно инициировано","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/me/phone-change/confirm":{"post":{"tags":["Identity API V1"],"summary":"Подтверждение смены номера","description":"Второй шаг процесса смены номера. Учитывает новый OTP-токен, проверяет его валидность и переназначает телефон авторизации для пользователя.","operationId":"confirmPhoneChange","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPhoneChangeRequestV1"}}},"required":true},"responses":{"200":{"description":"Успешная смена номера"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/me/devices":{"post":{"tags":["Identity API V1"],"summary":"Привязка FCM-токена устройства","description":"Добавляет новый FCM-токен в список авторизованных устройств текущего пользователя. Это необходимо для отправки таргетных push-уведомлений.","operationId":"addDeviceToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDeviceTokenRequestV1"}}},"required":true},"responses":{"201":{"description":"Устройство успешно привязано"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"delete":{"tags":["Identity API V1"],"summary":"Отвязка FCM-токена устройства","description":"Удаляет указанный токен FCM из списка устройств пользователя. Push-уведомления на это устройство больше не будут доставляться.","operationId":"removeDeviceToken","parameters":[{"name":"fcm_token","in":"query","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"204":{"description":"Токен устройства успешно отвязан/удален"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/auth/verify":{"post":{"tags":["Identity API V1"],"summary":"Верификация токена (Вход в систему)","description":"Основная точка входа. Получает idToken после успешного OTP, проверяет подпись, вшивает Custom Claims (RUKKI-ID и Role). Бэкенд свои JWT не генерирует.","operationId":"verifyAuth","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAuthRequestV1"}}},"required":true},"responses":{"201":{"description":"Успешный вход","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAuthResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/auth/logout":{"post":{"tags":["Identity API V1"],"summary":"Полный logout (access + Firebase sessions + FCM)","description":"Выполняет полный выход пользователя: очищает FCM-токены устройств, отзывает refresh-сессии в Firebase,\nотзывает текущий access JWT. Если в теле передан `refreshToken` / `refresh_token` локальной сессии identity-service —\nотзывается и он по `jti`.\nЛёгкий logout без Firebase/FCM — `POST /api/v1/auth/logout`.","operationId":"logout","parameters":[{"name":"tokenValue","in":"query","required":false,"schema":{"type":"string"}},{"name":"issuedAt","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"expiresAt","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequestV1"}}}},"responses":{"204":{"description":"Полный logout выполнен"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/admin/users/{id}/unban":{"post":{"tags":["Identity API V1"],"summary":"Разблокировка учетной записи пользователя","description":"Доступно только пользователям с ролями ADMIN и SUPERADMIN. Возвращает статус ACTIVE для профиля и снимает блокировку с учетной записи.","operationId":"unbanUser_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Учетная запись успешно разблокирована"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/admin/users/{id}/ban":{"post":{"tags":["Identity API V1"],"summary":"Блокировка учетной записи пользователя","description":"Доступно только пользователям с ролями ADMIN и SUPERADMIN. Переводит профиль в статус BANNED в локальной БД и отключает учетную запись. Доступ в систему будет немедленно закрыт.","operationId":"banUser_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Учетная запись успешно заблокирована"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/auth/tokens/revoke":{"post":{"tags":["JWT API V1"],"summary":"Точечный отзыв JWT по jti","description":"Доступно: **ADMIN**, **SUPERADMIN**. Добавляет jti в Redis blacklist до времени exp.","operationId":"revokeToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeTokenRequestV1"}}},"required":true},"responses":{"200":{"description":"Токен успешно отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeTokenResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/auth/tokens/revoke-by-user":{"post":{"tags":["JWT API V1"],"summary":"Отзыв всех JWT-сессий пользователя по userId","description":"Доступно: **ADMIN**, **SUPERADMIN**. Инвалидирует все access/refresh JWT пользователя,\nвыпущенные до вызова (по claim `iat`), и отзывает Firebase refresh-сессии при наличии привязки.\nСтатус аккаунта не меняется — пользователь может войти снова и получить новую пару JWT.","operationId":"revokeUserTokens","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeUserTokensRequestV1"}}},"required":true},"responses":{"200":{"description":"Сессии пользователя успешно отозваны","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeUserTokensResponseV1"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/auth/token":{"post":{"tags":["Auth API V1"],"summary":"OAuth2 token endpoint (refresh_token grant)","description":"Keycloak-совместимый обмен refresh JWT на новую пару. Публичный endpoint (Bearer не требуется).\nИспользованный refresh отзывается (rotation); параллельный повтор того же refresh вернёт `invalid_grant`.\nОтвет с `Cache-Control: no-store`.","operationId":"refreshTokenGrant","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","description":"Тип grant, поддерживается только `refresh_token`","minLength":1},"refresh_token":{"type":"string","description":"Компактная строка refresh JWT","minLength":1},"client_id":{"type":"string","description":"OAuth2 client_id; если не передан — значение из конфигурации JWT"}},"required":["grant_type","refresh_token"]}}},"required":true},"responses":{"200":{"description":"Новая пара JWT выдана","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"429":{"description":"Rate limit exceeded (`slow_down`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2TokenErrorResponseV1"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/auth/telegram":{"post":{"tags":["Auth API V1"],"summary":"Telegram Login Widget: авторизация","description":"Проверяет данные Telegram Login Widget (HMAC-SHA256) и выдаёт пару JWT (`TokenResponseV1`):\n`access_token`, `refresh_token`, `rukki_id`, `expires_in`, `refresh_expires_in`, `token_type=Bearer`.\nAccess используйте в Bearer; refresh храните securely и обновляйте через `POST /auth/token` или `/auth/refresh`.","operationId":"loginViaTelegramWidget","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramWidgetAuthRequestV1"}}},"required":true},"responses":{"201":{"description":"Успешная авторизация, выдана пара JWT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/auth/telegram/phone":{"post":{"tags":["Auth API V1"],"summary":"Запрос авторизации по звонку (Telegram Mini App)","description":"Инициирует Call Flow для сценария Telegram Mini App: тело как у `POST /auth/call` (`phone`),\nответ — `call_phone` и `checkId` для STOMP `/topic/auth-status/core/{checkId}`.","operationId":"startTelegramPhoneAuth","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallAuthRequestV1"}}},"required":true},"responses":{"201":{"description":"Авторизация успешно инициализирована","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallAuthResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/auth/telegram/link":{"post":{"tags":["Auth API V1"],"summary":"Telegram Login Widget: привязка к аккаунту","description":"Позволяет авторизованному пользователю привязать свой профиль Telegram.","operationId":"linkTelegramWidget","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramWidgetAuthRequestV1"}}},"required":true},"responses":{"201":{"description":"Успешная привязка"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/auth/telegram/code":{"post":{"tags":["Auth API V1"],"summary":"Telegram Gateway: отправка OTP","description":"Как web.telegram.org: OTP приходит в приложение Telegram на указанный номер.\nДалее — `POST /api/v1/auth/telegram/code/verify` с `request_id` и кодом.","operationId":"sendTelegramGatewayCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallAuthRequestV1"}}},"required":true},"responses":{"201":{"description":"OTP отправлен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramGatewayCodeSendResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/auth/telegram/code/verify":{"post":{"tags":["Auth API V1"],"summary":"Telegram Gateway: проверка OTP","description":"Проверяет код из Telegram и выдаёт пару JWT (`TokenResponseV1`).","operationId":"verifyTelegramGatewayCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramGatewayCodeVerifyRequestV1"}}},"required":true},"responses":{"201":{"description":"Успешный вход, выдана пара JWT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/auth/refresh":{"post":{"tags":["Auth API V1"],"summary":"Обновление пары JWT (JSON-алиас refresh_token grant)","description":"Эквивалент `POST /api/v1/auth/token` с `grant_type=refresh_token`, но тело в JSON (`RefreshTokenRequestV1`).\nПоля: `refreshToken` или `refresh_token`, опционально `client_id`. Публичный endpoint.","operationId":"refreshTokens","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequestV1"}}},"required":true},"responses":{"200":{"description":"Новая пара JWT выдана","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"429":{"description":"Rate limit exceeded (`slow_down`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2TokenErrorResponseV1"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/auth/logout":{"post":{"tags":["Auth API V1"],"summary":"Легкий logout (отзыв access JWT и опционально refresh)","description":"Требует Bearer **access** JWT (не refresh). Отзывает текущий access по `jti` (Redis blacklist до `exp`).\nЕсли в теле передан `refreshToken` / `refresh_token` той же сессии — отзывается и refresh по его `jti`.\nFCM и Firebase-сессии не затрагиваются; полный выход — `POST /api/v1/identities/auth/logout`.","operationId":"logout_1","parameters":[{"name":"tokenValue","in":"query","required":false,"schema":{"type":"string"}},{"name":"issuedAt","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"expiresAt","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequestV1"}}}},"responses":{"204":{"description":"Легкий logout выполнен"},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/auth/keys/rotate":{"post":{"tags":["JWT API V1"],"summary":"Принудительная ротация JWT signing key","description":"Доступно: **ADMIN**, **SUPERADMIN**. Немедленно переключает активный RSA-ключ подписи и обновляет kid.","operationId":"rotateJwtSigningKey","responses":{"200":{"description":"Ключ успешно ротирован","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateSigningKeyResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/auth/call":{"post":{"tags":["Auth API V1"],"summary":"Запрос авторизации по звонку (Call Flow)","description":"Возвращает номер телефона, на который пользователь должен позвонить для авторизации (бесплатно для звонящего). В теле поле `phone`: 10–15 цифр, префикс `+` необязателен (например `+79991234567` или `79991234567`).","operationId":"startCallAuth","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallAuthRequestV1"}}},"required":true},"responses":{"201":{"description":"Авторизация успешно инициализирована","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallAuthResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}},"/api/v1/users/{id}/qualifications":{"get":{"tags":["User API V1"],"summary":"Получить квалификацию пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nВозвращает {@code userId}, {@code status}, {@code clientType}, {@code leadQualification}\nи {@code leadSource}.","operationId":"getQualifications","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Квалификация пользователя успешно получена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserQualificationResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User API V1"],"summary":"Изменить квалификацию пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nЧастично обновляет {@code status}, {@code clientType}, {@code leadQualification}\nи/или {@code leadSourceId}; {@code clearLeadSource=true} снимает источник лида\n(нельзя вместе с {@code leadSourceId}). {@code null} в теле — не менять поле.\nХотя бы одно поле должно быть передано явно.\nПри смене {@code leadQualification} создаётся запись в журнале истории.\nИзменения только {@code status}, {@code clientType} или {@code leadSourceId}\nв историю не попадают.\nПовторный PATCH с теми же значениями идемпотентен: данные не меняются, уведомление не отправляется.","operationId":"updateQualifications","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserQualificationRequestV1"}}},"required":true},"responses":{"200":{"description":"Квалификация пользователя успешно обновлена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserQualificationResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/manager":{"get":{"tags":["User API V1"],"summary":"Текущий менеджер пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nВозвращает {@code userId} и {@code managerId}; {@code managerId} — {@code null}, если менеджер не назначен.","operationId":"getAssignedManager","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["User API V1"],"summary":"Назначить или снять менеджера","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nПередайте {@code managerId} для назначения или {@code clear: true} для снятия.\nИдемпотентный повтор не публикует событие профиля.","operationId":"updateAssignedManager","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserManagerRequestV1"}}},"required":true},"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/integrations/bitrix/scheduled-sync":{"get":{"tags":["Integrations API V1"],"summary":"Настройки плановой синхронизации Bitrix24","description":"Доступно: только **SUPERADMIN**.\nВозвращает runtime-флаг `enabled`, override cron, `effectiveCron`, `defaultCron`,\n`bitrixConfigured`, `schedulerActive`, статус последнего upsert (`lastRunStatus`, `lastRunTrigger`,\n`lastRunError`, `lastRunCurrentStep`, `lastRunResult`).\nUI: BFF **Super Admin** (`https://bff.rukki.pro/bff-demo.html#super-admin`).","operationId":"getSettings","responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}},"patch":{"tags":["Integrations API V1"],"summary":"Обновить плановую синхронизацию Bitrix24","description":"Доступно: только **SUPERADMIN**.\n`enabled` — вкл/выкл cron без redeploy.\n`cron` — override; пустая строка сбрасывает на default из `app.bitrix24.scheduled-sync.cron` / ENV.\nХотя бы одно поле обязательно. После PATCH планировщик перепланируется автоматически.","operationId":"updateSettings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBitrixScheduledSyncSettingsRequestV1"}}},"required":true},"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/roles":{"get":{"tags":["User API V1"],"summary":"Получить список ролей пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**. Возвращает массив назначенных пользователю ролей","operationId":"getRoles","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Роли успешно получены","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/qualifications/history":{"get":{"tags":["User API V1"],"summary":"История изменений квалификации лида","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nВозвращает журнал переходов {@code leadQualification} с снимком {@code leadSource}\nна момент изменения, UUID инициатора ({@code changedBy}) и Bitrix-трассировкой\n({@code bitrixEntityType}/{@code bitrixEntityId}/{@code bitrixStageId});\nсортировка по времени — новые первыми. Query {@code userId} в фильтре игнорируется —\nиспользуется path {@code {id}}. Изменения {@code clientType} и отдельная смена\n{@code leadSourceId} в журнал не записываются. Административный список —\n{@code GET /api/v1/user-lead-qualification-histories}.","operationId":"getQualificationHistory","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"previousQualification","in":"query","description":"Предыдущая квалификация лида","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"newQualification","in":"query","description":"Новая квалификация лида","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"leadSourceId","in":"query","description":"UUID источника лида на момент изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"changedBy","in":"query","description":"UUID инициатора изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixEntityType","in":"query","description":"Тип сущности Bitrix (LEAD / DEAL)","required":false,"schema":{"type":"string"}},{"name":"bitrixEntityId","in":"query","description":"ID сущности Bitrix","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixStageId","in":"query","description":"Исходный STAGE_ID Bitrix","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"type":"integer","default":0,"minimum":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"type":"integer","default":50,"minimum":1}},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["createdAt,DESC"],"items":{"type":"string"}}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/manager-assignments":{"get":{"tags":["User API V1"],"summary":"История назначений менеджера","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nЖурнал смен менеджера (включая {@code bitrixEventId} при импорте); новые записи первыми.\nQuery {@code userId} в фильтре игнорируется — используется path {@code {id}}.\nАдминистративный список — {@code GET /api/v1/user-manager-assignment-histories}.","operationId":"getManagerAssignmentHistory","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"previousManagerId","in":"query","description":"UUID предыдущего менеджера","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"newManagerId","in":"query","description":"UUID нового менеджера","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"changedBy","in":"query","description":"UUID инициатора изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"source","in":"query","description":"Источник назначения (CRM | BITRIX_IMPORT)","required":false,"schema":{"type":"string","enum":["CRM","BITRIX_IMPORT"]}},{"name":"bitrixEventId","in":"query","description":"Идемпотентный ID события Bitrix","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"type":"integer","default":0,"minimum":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"type":"integer","default":50,"minimum":1}},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["createdAt,DESC"],"items":{"type":"string"}}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/{id}/crm/timeline":{"get":{"tags":["User API V1"],"summary":"CRM timeline пользователя","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.\nКомментарии, звонки, activities и смены стадий из Bitrix24; новые события первыми.\nQuery {@code userId} в фильтре игнорируется — используется path {@code {id}}.\nАдминистративный список — {@code GET /api/v1/user-crm-timelines}.","operationId":"getCrmTimeline","parameters":[{"name":"id","in":"path","description":"Уникальный идентификатор пользователя","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixEntityType","in":"query","description":"Тип сущности Bitrix24","required":false,"schema":{"type":"string","enum":["CONTACT","COMPANY","LEAD","DEAL","ACTIVITY"]}},{"name":"bitrixEntityId","in":"query","description":"ID сущности Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"entryType","in":"query","description":"Тип записи timeline","required":false,"schema":{"type":"string","enum":["COMMENT","CALL","EMAIL","ACTIVITY","STAGE_CHANGE","LOG","OTHER"]}},{"name":"bitrixEntryId","in":"query","description":"Идемпотентный ID записи в Bitrix","required":false,"schema":{"type":"string"}},{"name":"authorUserId","in":"query","description":"RUKKI-ID автора события","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"authorBitrixId","in":"query","description":"ID автора в Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"type":"integer","default":0,"minimum":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"type":"integer","default":50,"minimum":1}},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["occurredAt,DESC"],"items":{"type":"string"}}}],"responses":{"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/users/count":{"get":{"tags":["User API V1"],"summary":"Получить количество пользователей","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**. Подсчитывает пользователей с учётом фильтра (логика совпадает с методом списка).","operationId":"count","parameters":[{"name":"phone","in":"query","description":"Часть номера телефона","required":false,"schema":{"type":"string"}},{"name":"firstName","in":"query","description":"Часть имени","required":false,"schema":{"type":"string"}},{"name":"lastName","in":"query","description":"Часть фамилии","required":false,"schema":{"type":"string"}},{"name":"middleName","in":"query","description":"Часть отчества","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","description":"Часть email","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Статус пользователя","required":false,"schema":{"type":"string","enum":["LEAD","ACTIVE","BANNED","DELETED"]}},{"name":"isActive","in":"query","description":"Признак активности записи (true — активен, false — деактивирован)","required":false,"schema":{"type":"boolean"}},{"name":"clientType","in":"query","description":"Тип клиента: B2C или B2B","required":false,"schema":{"type":"string","enum":["B2C","B2B"]}},{"name":"leadQualification","in":"query","description":"Квалификация лида в CRM (N, A–D, X)","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"role","in":"query","description":"Роль пользователя; повтор параметра — OR (например role=MANAGER&role=ADMIN)","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":100,"minLength":0}}},{"name":"hasGeoData","in":"query","description":"Наличие гео-зон: true — есть; false — нет (без других гео-параметров)","required":false,"schema":{"type":"boolean"}},{"name":"minRadiusMeters","in":"query","description":"Минимальный radiusMeters хотя бы у одной зоны","required":false,"schema":{"type":"integer","format":"int64","minimum":1}},{"name":"maxRadiusMeters","in":"query","description":"Максимальный radiusMeters хотя бы у одной зоны","required":false,"schema":{"type":"integer","format":"int64","minimum":1}},{"name":"geoLatitudeMin","in":"query","description":"Минимальная широта центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":90.0,"minimum":-90.0}},{"name":"geoLatitudeMax","in":"query","description":"Максимальная широта центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":90.0,"minimum":-90.0}},{"name":"geoLongitudeMin","in":"query","description":"Минимальная долгота центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":180.0,"minimum":-180.0}},{"name":"geoLongitudeMax","in":"query","description":"Максимальная долгота центра гео-зоны (WGS-84)","required":false,"schema":{"type":"number","format":"double","maximum":180.0,"minimum":-180.0}},{"name":"nearLatitude","in":"query","description":"Широта точки поиска (WGS-84); пара с nearLongitude","required":false,"schema":{"type":"number","format":"double","maximum":90.0,"minimum":-90.0}},{"name":"nearLongitude","in":"query","description":"Долгота точки поиска (WGS-84); пара с nearLatitude","required":false,"schema":{"type":"number","format":"double","maximum":180.0,"minimum":-180.0}},{"name":"coverPoint","in":"query","description":"true — зона покрывает точку (default); false — центр зоны в maxDistanceMeters","required":false,"schema":{"type":"string"},"example":true},{"name":"maxDistanceMeters","in":"query","description":"При coverPoint=false — макс. расстояние до центра зоны (метры)","required":false,"schema":{"type":"integer","format":"int64","minimum":1}}],"responses":{"200":{"description":"Количество успешно получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-manager-assignment-histories":{"get":{"tags":["User Manager Assignment History API V1"],"summary":"Получить журнал назначений менеджера","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"all_5","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"previousManagerId","in":"query","description":"UUID предыдущего менеджера","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"newManagerId","in":"query","description":"UUID нового менеджера","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"changedBy","in":"query","description":"UUID инициатора изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"source","in":"query","description":"Источник назначения (CRM | BITRIX_IMPORT)","required":false,"schema":{"type":"string","enum":["CRM","BITRIX_IMPORT"]}},{"name":"bitrixEventId","in":"query","description":"Идемпотентный ID события Bitrix","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["createdAt,DESC"],"items":{"type":"string"}}}],"responses":{"200":{"description":"Список получен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseUserManagerAssignmentHistoryResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-manager-assignment-histories/count":{"get":{"tags":["User Manager Assignment History API V1"],"summary":"Получить количество записей журнала менеджеров","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"count_1","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"previousManagerId","in":"query","description":"UUID предыдущего менеджера","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"newManagerId","in":"query","description":"UUID нового менеджера","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"changedBy","in":"query","description":"UUID инициатора изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"source","in":"query","description":"Источник назначения (CRM | BITRIX_IMPORT)","required":false,"schema":{"type":"string","enum":["CRM","BITRIX_IMPORT"]}},{"name":"bitrixEventId","in":"query","description":"Идемпотентный ID события Bitrix","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Количество получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-lead-qualification-histories":{"get":{"tags":["User Lead Qualification History API V1"],"summary":"Получить журнал квалификации лида","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"all_6","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"previousQualification","in":"query","description":"Предыдущая квалификация лида","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"newQualification","in":"query","description":"Новая квалификация лида","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"leadSourceId","in":"query","description":"UUID источника лида на момент изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"changedBy","in":"query","description":"UUID инициатора изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixEntityType","in":"query","description":"Тип сущности Bitrix (LEAD / DEAL)","required":false,"schema":{"type":"string"}},{"name":"bitrixEntityId","in":"query","description":"ID сущности Bitrix","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixStageId","in":"query","description":"Исходный STAGE_ID Bitrix","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["createdAt,DESC"],"items":{"type":"string"}}}],"responses":{"200":{"description":"Список получен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseUserLeadQualificationHistoryResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-lead-qualification-histories/count":{"get":{"tags":["User Lead Qualification History API V1"],"summary":"Получить количество записей журнала квалификации","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"count_2","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"previousQualification","in":"query","description":"Предыдущая квалификация лида","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"newQualification","in":"query","description":"Новая квалификация лида","required":false,"schema":{"type":"string","enum":["N","A","B","C","D","X"]}},{"name":"leadSourceId","in":"query","description":"UUID источника лида на момент изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"changedBy","in":"query","description":"UUID инициатора изменения","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixEntityType","in":"query","description":"Тип сущности Bitrix (LEAD / DEAL)","required":false,"schema":{"type":"string"}},{"name":"bitrixEntityId","in":"query","description":"ID сущности Bitrix","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixStageId","in":"query","description":"Исходный STAGE_ID Bitrix","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Количество получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-crm-timelines":{"get":{"tags":["User CRM Timeline API V1"],"summary":"Получить список CRM timeline","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"all_7","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixEntityType","in":"query","description":"Тип сущности Bitrix24","required":false,"schema":{"type":"string","enum":["CONTACT","COMPANY","LEAD","DEAL","ACTIVITY"]}},{"name":"bitrixEntityId","in":"query","description":"ID сущности Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"entryType","in":"query","description":"Тип записи timeline","required":false,"schema":{"type":"string","enum":["COMMENT","CALL","EMAIL","ACTIVITY","STAGE_CHANGE","LOG","OTHER"]}},{"name":"bitrixEntryId","in":"query","description":"Идемпотентный ID записи в Bitrix","required":false,"schema":{"type":"string"}},{"name":"authorUserId","in":"query","description":"RUKKI-ID автора события","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"authorBitrixId","in":"query","description":"ID автора в Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["occurredAt,DESC"],"items":{"type":"string"}}}],"responses":{"200":{"description":"Список получен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseUserCrmTimelineResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-crm-timelines/count":{"get":{"tags":["User CRM Timeline API V1"],"summary":"Получить количество записей CRM timeline","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"count_3","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixEntityType","in":"query","description":"Тип сущности Bitrix24","required":false,"schema":{"type":"string","enum":["CONTACT","COMPANY","LEAD","DEAL","ACTIVITY"]}},{"name":"bitrixEntityId","in":"query","description":"ID сущности Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"entryType","in":"query","description":"Тип записи timeline","required":false,"schema":{"type":"string","enum":["COMMENT","CALL","EMAIL","ACTIVITY","STAGE_CHANGE","LOG","OTHER"]}},{"name":"bitrixEntryId","in":"query","description":"Идемпотентный ID записи в Bitrix","required":false,"schema":{"type":"string"}},{"name":"authorUserId","in":"query","description":"RUKKI-ID автора события","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"authorBitrixId","in":"query","description":"ID автора в Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Количество получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-bitrix-links":{"get":{"tags":["User Bitrix Link API V1"],"summary":"Получить список связей user ↔ Bitrix24","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"all_8","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixUserId","in":"query","description":"ID сотрудника Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixContactId","in":"query","description":"ID контакта Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixCompanyId","in":"query","description":"ID компании Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixLeadId","in":"query","description":"ID лида Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"companyName","in":"query","description":"Поиск по подстроке в названии компании (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"companyUserId","in":"query","description":"UUID B2B-компании в identity","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","description":"Номер страницы (с 1; первая страница — page=1)","required":false,"schema":{"type":"integer","default":1,"minimum":1},"example":"1"},{"name":"size","in":"query","description":"Размер страницы (по умолчанию 50, макс. 100)","required":false,"schema":{"type":"integer","default":50,"maximum":100,"minimum":1},"example":"50"},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","default":["lastSyncedAt,DESC"],"items":{"type":"string"}}}],"responses":{"200":{"description":"Список получен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedResponseUserBitrixLinkResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-bitrix-links/count":{"get":{"tags":["User Bitrix Link API V1"],"summary":"Получить количество связей user ↔ Bitrix24","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"count_4","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"bitrixUserId","in":"query","description":"ID сотрудника Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixContactId","in":"query","description":"ID контакта Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixCompanyId","in":"query","description":"ID компании Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bitrixLeadId","in":"query","description":"ID лида Bitrix24","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"companyName","in":"query","description":"Поиск по подстроке в названии компании (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"companyUserId","in":"query","description":"UUID B2B-компании в identity","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Количество получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/user-addresses/count":{"get":{"tags":["User Address API V1"],"summary":"Получить количество адресов","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**.","operationId":"count_5","parameters":[{"name":"userId","in":"query","description":"RUKKI-ID пользователя-владельца адреса","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"label","in":"query","description":"Поиск по подстроке в метке адреса (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"countryCode","in":"query","description":"Фильтрация по ISO-коду страны","required":false,"schema":{"type":"string"}},{"name":"city","in":"query","description":"Поиск по подстроке в городе (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"region","in":"query","description":"Поиск по подстроке в регионе / районе (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"street","in":"query","description":"Поиск по подстроке в улице (без учёта регистра)","required":false,"schema":{"type":"string"}},{"name":"postalCode","in":"query","description":"Поиск по подстроке в почтовом индексе","required":false,"schema":{"type":"string"}},{"name":"primary","in":"query","description":"Фильтрация по признаку основного адреса","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Количество получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/roles/count":{"get":{"tags":["Role API V1"],"summary":"Получить количество ролей","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**. Подсчитывает роли с учётом фильтра (логика совпадает с методом списка).","operationId":"count_6","parameters":[{"name":"name","in":"query","description":"Поиск по подстроке в названии роли (без учета регистра)","required":false,"schema":{"type":"string"}},{"name":"updatable","in":"query","description":"Фильтрация по флагу возможности редактирования","required":false,"schema":{"type":"boolean"}},{"name":"deletable","in":"query","description":"Фильтрация по флагу возможности удаления","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Количество успешно получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/professions/count":{"get":{"tags":["Profession API V1"],"summary":"Получить количество профессий","description":"Доступно: любому авторизованному пользователю. Подсчитывает профессии с учётом фильтра.","operationId":"count_7","parameters":[{"name":"name","in":"query","description":"Поиск по подстроке в названии профессии (без учета регистра)","required":false,"schema":{"type":"string"}},{"name":"code","in":"query","description":"Поиск по подстроке в коде профессии (без учета регистра)","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","description":"Фильтрация по категории: A или B","required":false,"schema":{"type":"string","enum":["A","B"]}},{"name":"equipmentBinding","in":"query","description":"Фильтрация по типу привязки к технике: STRICT или OPTIONAL","required":false,"schema":{"type":"string","enum":["STRICT","OPTIONAL"]}},{"name":"updatable","in":"query","description":"Фильтрация по флагу возможности редактирования","required":false,"schema":{"type":"boolean"}},{"name":"deletable","in":"query","description":"Фильтрация по флагу возможности удаления","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Количество успешно получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/lead-sources/count":{"get":{"tags":["Lead Source API V1"],"summary":"Получить количество источников лида","description":"Доступно: **ADMIN**, **SUPERADMIN**, **MANAGER**, **SUPERVISOR**. Подсчитывает источники лида с учётом фильтра (логика совпадает с методом списка).","operationId":"count_8","parameters":[{"name":"code","in":"query","description":"Поиск по подстроке в коде","required":false,"schema":{"type":"string"}},{"name":"description","in":"query","description":"Поиск по подстроке в описании","required":false,"schema":{"type":"string"}},{"name":"updatable","in":"query","description":"Фильтр по флагу updatable","required":false,"schema":{"type":"boolean"}},{"name":"deletable","in":"query","description":"Фильтр по флагу deletable","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Количество успешно получено","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/{id}/roles":{"get":{"tags":["Identity API V1"],"summary":"Получить список ролей пользователя","description":"Доступно: ADMIN, SUPERADMIN. Возвращает массив назначенных пользователю ролей","operationId":"getUserRoles","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Роли успешно получены","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/{id}/professions":{"get":{"tags":["Identity API V1"],"summary":"Получить профессии пользователя","description":"Доступно: ADMIN, SUPERADMIN. Возвращает профессии пользователя из справочника.","operationId":"getProfessions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Профессии успешно получены","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfessionSummaryResponseV1"}}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/api/v1/identities/search":{"get":{"tags":["Identity API V1"],"summary":"Многопрофильный поиск пользователей","description":"Доступно только пользователям с ролями ADMIN и SUPERADMIN. Позволяет находить профили по номеру телефона (полное или частичное совпадение) или RUKKI-ID для нужд технической поддержки.","operationId":"searchUsers","parameters":[{"name":"phoneQuery","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Успешный поиск пользователей","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchUsersResponseV1"}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}}}},"/.well-known/jwks.json":{"get":{"tags":["JWT API V1"],"summary":"Получить публичный ключ (JWKS)","description":"Отдает публичный RSA-ключ в стандартизованном формате JWKS (keys[]), совместимом с OAuth2/OpenID Connect клиентами. Доступен публично, не требует авторизации.","operationId":"getJwks","responses":{"200":{"description":"Успешное получение публичного ключа","content":{"application/json":{"example":{"keys":[{"kty":"RSA","kid":"ab12cd34ef56ab78","use":"sig","alg":"RS256","n":"...","e":"AQAB"}]}}}},"400":{"description":"Некорректный запрос (ошибка валидации параметров)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":400,"message":"Validation error","details":{"phone":"Некорректный формат телефона"},"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"401":{"description":"Отсутствует или недействителен токен авторизации (JWT)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":401,"message":"Full authentication is required to access this resource","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"403":{"description":"Недостаточно прав для выполнения операции (отсутствует нужная роль)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":403,"message":"Access Denied","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"404":{"description":"Ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":404,"message":"Пользователь не найден","details":null,"path":"/api/v1/identities","timestamp":"2026-03-26T10:32:26.961Z"}}}},"422":{"description":"Нарушение бизнес-архитектуры или неверное состояние сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":422,"message":"Номер телефона уже занят","details":null,"path":"/api/v1/identities/admin/users/123/phone-auth","timestamp":"2026-04-02T10:32:26.961Z"}}}},"500":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorDto"},"example":{"status":500,"message":"Internal Server Error","details":null,"path":"/api/v1/identities","timestamp":"2026-04-02T10:32:26.961Z"}}}}},"security":[]}}},"components":{"schemas":{"ApiErrorDto":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}},"path":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"UpdateUserRequestV1":{"type":"object","properties":{"firstName":{"type":"string","maxLength":100,"minLength":0},"lastName":{"type":"string","maxLength":100,"minLength":0},"middleName":{"type":"string","maxLength":100,"minLength":0},"birthday":{"type":"string","format":"date","description":"Дата рождения пользователя"},"email":{"type":"string","format":"email","maxLength":255,"minLength":0},"inn":{"type":"string","maxLength":12,"minLength":0,"pattern":"^\\d{10}(\\d{2})?$"},"sbpPhone":{"type":"string","pattern":"^\\+?[1-9]\\d{1,14}$"},"maxPhone":{"type":"string","pattern":"^\\+?[1-9]\\d{1,14}$"},"ukepId":{"type":"string","maxLength":1024,"minLength":0},"channels":{"type":"array","description":"Каналы уведомлений; null или [] сбрасывают выбор","items":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","MAX","TELEGRAM"]}},"notificationCategories":{"type":"array","description":"Категории уведомлений; null или [] сбрасывают выбор","items":{"type":"string","enum":["ORDER_CREATED","CONTRACTOR_ASSIGNED","CONTRACTOR_ARRIVED_TO_OBJECT","CONTRACTOR_COMPLETED_WORK","CONTRACTOR_REASSIGNED","NEW_RESPONSE_TO_ORDER","PAYMENT_RECEIVED","CONTRACTOR_DEPARTED_TO_ORDER","COUNTER_OFFER"]}},"avatarFileId":{"type":"string","format":"uuid","description":"Идентификатор файла аватара (file-service)"},"geoData":{"type":"array","description":"Гео-точки; null или [] удаляют все существующие","items":{"$ref":"#/components/schemas/UserGeoDataRequestV1"}},"addresses":{"type":"array","description":"Адреса; null или [] удаляют все существующие","items":{"$ref":"#/components/schemas/UserAddressRequestV1"},"maxItems":10,"minItems":0}},"required":["firstName"]},"UserAddressRequestV1":{"type":"object","description":"Почтовый адрес пользователя","properties":{"label":{"type":"string","description":"Метка адреса (Дом, Офис и т.д.)","example":"Дом","maxLength":50,"minLength":0},"countryCode":{"type":"string","description":"ISO-код страны","example":"RU","maxLength":5,"minLength":0},"city":{"type":"string","description":"Город","example":"Москва","maxLength":255,"minLength":0},"region":{"type":"string","description":"Регион / район / область","example":"Центральный","maxLength":255,"minLength":0},"street":{"type":"string","description":"Улица","example":"Тверская","maxLength":255,"minLength":0},"house":{"type":"string","description":"Дом / строение","example":1,"maxLength":50,"minLength":0},"apartment":{"type":"string","description":"Квартира / офис","example":10,"maxLength":50,"minLength":0},"postalCode":{"type":"string","description":"Почтовый индекс","example":125009,"maxLength":20,"minLength":0},"comment":{"type":"string","description":"Комментарий к адресу (подъезд, домофон)"},"primary":{"type":"boolean","default":false,"description":"Основной адрес; не более одного в списке"}}},"UserGeoDataRequestV1":{"type":"object","description":"Гео-точка: координаты и радиус","properties":{"latitude":{"type":"number","format":"double","description":"Широта (WGS-84)","example":55.7558,"maximum":90.0,"minimum":-90.0},"longitude":{"type":"number","format":"double","description":"Долгота (WGS-84)","example":37.6173,"maximum":180.0,"minimum":-180.0},"radiusMeters":{"type":"integer","format":"int64","description":"Радиус зоны в метрах (BIGINT, допускает сотни км)","example":500000,"minimum":1}},"required":["latitude","longitude","radiusMeters"]},"ProfessionSummaryResponseV1":{"type":"object","description":"Краткая информация о профессии пользователя","properties":{"id":{"type":"string","description":"UUID профессии (строка)"},"code":{"type":"string","description":"Код профессии","example":"EXCAVATOR_OPERATOR"},"name":{"type":"string","description":"Название профессии"},"category":{"type":"string","description":"Категория A или B","enum":["A","B"]}}},"UserAddressResponseV1":{"type":"object","description":"Почтовый адрес пользователя","properties":{"id":{"type":"string","format":"uuid","description":"Идентификатор адреса"},"userId":{"type":"string","format":"uuid","description":"RUKKI-ID владельца адреса"},"label":{"type":"string","description":"Метка адреса"},"countryCode":{"type":"string","description":"ISO-код страны"},"city":{"type":"string","description":"Город"},"region":{"type":"string","description":"Регион / район / область"},"street":{"type":"string","description":"Улица"},"house":{"type":"string","description":"Дом / строение"},"apartment":{"type":"string","description":"Квартира / офис"},"postalCode":{"type":"string","description":"Почтовый индекс"},"comment":{"type":"string","description":"Комментарий"},"primary":{"type":"boolean","description":"Основной адрес"},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"UserBitrixLinkResponseV1":{"type":"object","description":"Связь пользователя с Bitrix24; null — не импортирован из B24","properties":{"userId":{"type":"string","format":"uuid","description":"RUKKI-ID пользователя"},"bitrixUserId":{"type":"integer","format":"int64","description":"ID сотрудника Bitrix24"},"bitrixContactId":{"type":"integer","format":"int64","description":"ID контакта Bitrix24"},"bitrixCompanyId":{"type":"integer","format":"int64","description":"ID компании Bitrix24"},"bitrixLeadId":{"type":"integer","format":"int64","description":"ID лида Bitrix24"},"companyName":{"type":"string","description":"Название юрлица из B24"},"companyUserId":{"type":"string","format":"uuid","description":"UUID B2B-компании в identity"},"importedAt":{"type":"string","format":"date-time","description":"Время первого импорта"},"lastSyncedAt":{"type":"string","format":"date-time","description":"Время последней синхронизации"}}},"UserGeoDataResponseV1":{"type":"object","description":"Гео-зона профиля (WGS-84). Круг обслуживания: центр + radiusMeters.\nSpatial search — PostgreSQL earthdistance в identity-service.","properties":{"id":{"type":"string","format":"uuid","description":"Идентификатор гео-точки"},"latitude":{"type":"number","format":"double","description":"Широта (WGS-84)","example":55.7558},"longitude":{"type":"number","format":"double","description":"Долгота (WGS-84)","example":37.6173},"radiusMeters":{"type":"integer","format":"int64","description":"Радиус зоны в метрах","example":500000},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"UserResponseV1":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Уникальный RUKKI-ID пользователя"},"phoneAuth":{"type":"string","description":"Номер телефона пользователя (E.164)"},"firstName":{"type":"string","description":"Имя пользователя"},"lastName":{"type":"string","description":"Фамилия пользователя"},"middleName":{"type":"string","description":"Отчество пользователя"},"birthday":{"type":"string","format":"date","description":"Дата рождения пользователя"},"email":{"type":"string","description":"Электронная почта пользователя"},"inn":{"type":"string","description":"ИНН пользователя"},"sbpPhone":{"type":"string","description":"Телефон для СБП переводов (E.164)"},"maxPhone":{"type":"string","description":"Дополнительный телефон (E.164)"},"ukepId":{"type":"string","description":"Идентификатор УКЭП"},"status":{"type":"string","description":"Текущий статус учетной записи","enum":["LEAD","ACTIVE","BANNED","DELETED"]},"isActive":{"type":"boolean","description":"Признак активности записи (false — деактивирован, напр. уволенный сотрудник Bitrix24)"},"bitrix":{"$ref":"#/components/schemas/UserBitrixLinkResponseV1","description":"Связь с Bitrix24"},"channels":{"type":"array","description":"Каналы уведомлений (порядок может использоваться клиентом)","example":["WHATSAPP","TELEGRAM","EMAIL"],"items":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","MAX","TELEGRAM"]}},"notificationCategories":{"type":"array","description":"Категории уведомлений (порядок может использоваться клиентом)","example":["ORDER_CREATED"],"items":{"type":"string","enum":["ORDER_CREATED","CONTRACTOR_ASSIGNED","CONTRACTOR_ARRIVED_TO_OBJECT","CONTRACTOR_COMPLETED_WORK","CONTRACTOR_REASSIGNED","NEW_RESPONSE_TO_ORDER","PAYMENT_RECEIVED","CONTRACTOR_DEPARTED_TO_ORDER","COUNTER_OFFER"]}},"avatarFileId":{"type":"string","format":"uuid","description":"Идентификатор файла аватара (file-service)"},"geoData":{"type":"array","description":"Гео-данные пользователя (координаты и радиус); пустой список — нет точек","items":{"$ref":"#/components/schemas/UserGeoDataResponseV1"}},"addresses":{"type":"array","description":"Почтовые адреса пользователя (0..N)","items":{"$ref":"#/components/schemas/UserAddressResponseV1"}},"professions":{"type":"array","description":"Профессии пользователя из справочника (0..N)","items":{"$ref":"#/components/schemas/ProfessionSummaryResponseV1"}},"createdAt":{"type":"string","format":"date-time","description":"Дата и время создания пользователя"},"updatedAt":{"type":"string","format":"date-time","description":"Дата и время последнего обновления пользователя"},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"ReplaceUserAddressesRequestV1":{"type":"object","description":"Полная замена списка почтовых адресов пользователя","properties":{"addresses":{"type":"array","description":"Список адресов (пустой — сброс)","items":{"$ref":"#/components/schemas/UserAddressRequestV1"},"maxItems":10,"minItems":0}},"required":["addresses"]},"ReplaceUserProfessionsRequestV1":{"type":"object","description":"Полная замена набора профессий пользователя","properties":{"professionIds":{"type":"array","description":"UUID профессий из справочника (пустой список — сброс)","items":{"type":"string","format":"uuid"},"uniqueItems":true}},"required":["professionIds"]},"UpdateRoleRequestV1":{"type":"object","description":"DTO запроса для полной замены (редактирования) существующей роли","properties":{"name":{"type":"string","description":"Новое название роли","example":"SUPER_USER","maxLength":100,"minLength":2},"description":{"type":"string","description":"Обновленное описание для роли","example":"Пользователь с расширенным доступом","maxLength":255,"minLength":0}},"required":["name"]},"RoleResponseV1":{"type":"object","description":"DTO ответа, содержащее полную информацию о роли в системе","properties":{"id":{"type":"string","description":"Уникальный строковый идентификатор роли","example":"role_user"},"name":{"type":"string","description":"Название роли","example":"USER"},"description":{"type":"string","description":"Подробное описание назначения роли","example":"Обычный пользователь платформы"},"updatable":{"type":"boolean","description":"Разрешено ли изменение данной роли","example":true},"deletable":{"type":"boolean","description":"Разрешено ли удаление данной роли","example":true},"createdAt":{"type":"string","format":"date-time","description":"Дата и время создания роли"},"updatedAt":{"type":"string","format":"date-time","description":"Дата и время последнего изменения роли"},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"UpdateProfessionRequestV1":{"type":"object","description":"DTO запроса для полной замены (редактирования) существующей профессии","properties":{"code":{"type":"string","description":"Новый код профессии","example":"EXCAVATOR_OPERATOR","maxLength":64,"minLength":2},"name":{"type":"string","description":"Новое название профессии","maxLength":150,"minLength":2},"category":{"type":"string","description":"Категория A или B","enum":["A","B"]},"minRank":{"type":"integer","format":"int32","description":"Минимальный разряд","maximum":8,"minimum":1},"maxRank":{"type":"integer","format":"int32","description":"Максимальный разряд","maximum":8,"minimum":1},"equipmentBinding":{"type":"string","description":"Тип привязки к технике","enum":["STRICT","OPTIONAL"]},"equipmentTypes":{"type":"array","description":"Коды типов техники","items":{"type":"string","maxLength":64,"minLength":0},"minItems":1},"regulatoryDocument":{"type":"string","description":"Нормативный документ","maxLength":255,"minLength":0},"description":{"type":"string","description":"Описание","maxLength":500,"minLength":0}},"required":["category","code","equipmentBinding","equipmentTypes","maxRank","minRank","name"]},"ProfessionResponseV1":{"type":"object","description":"Полная информация о профессии из справочника","properties":{"id":{"type":"string","description":"UUID профессии"},"code":{"type":"string","description":"Стабильный код","example":"EXCAVATOR_OPERATOR"},"name":{"type":"string","description":"Название профессии","example":"Машинист экскаватора"},"category":{"type":"string","description":"Категория A или B","enum":["A","B"]},"minRank":{"type":"integer","format":"int32","description":"Минимальный разряд"},"maxRank":{"type":"integer","format":"int32","description":"Максимальный разряд"},"equipmentBinding":{"type":"string","description":"Жёсткая или мягкая привязка к технике","enum":["STRICT","OPTIONAL"]},"equipmentTypes":{"type":"array","description":"Коды типов техники","items":{"type":"string"}},"regulatoryDocument":{"type":"string","description":"Нормативный документ"},"description":{"type":"string","description":"Описание"},"updatable":{"type":"boolean","description":"Разрешено ли изменение данной профессии"},"deletable":{"type":"boolean","description":"Разрешено ли удаление данной профессии"},"createdAt":{"type":"string","format":"date-time","description":"Дата и время создания"},"updatedAt":{"type":"string","format":"date-time","description":"Дата и время последнего изменения"},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"UpdateLeadSourceRequestV1":{"type":"object","description":"DTO запроса на полную замену источника лида","properties":{"code":{"type":"string","description":"Новый код источника","example":"SITE","maxLength":32,"minLength":2},"description":{"type":"string","description":"Новое описание","example":"Сайт","maxLength":255,"minLength":0}},"required":["code","description"]},"LeadSourceResponseV1":{"type":"object","description":"Источник лида в справочнике CRM","properties":{"id":{"type":"string","format":"uuid","description":"UUID записи справочника"},"code":{"type":"string","description":"Стабильный код источника","example":"INCOMING"},"description":{"type":"string","description":"Название для UI CRM","example":"Входящий"},"updatable":{"type":"boolean","description":"Разрешено ли изменение записи","example":false},"deletable":{"type":"boolean","description":"Разрешено ли удаление записи","example":false},"createdAt":{"type":"string","format":"date-time","description":"Дата и время создания"},"updatedAt":{"type":"string","format":"date-time","description":"Дата и время последнего изменения"},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"UpdatePhoneRequestV1":{"type":"object","properties":{"newPhone":{"type":"string","minLength":1,"pattern":"^\\+?\\d{10,15}$"},"reason":{"type":"string","minLength":1},"clientRequestRef":{"type":"string"}},"required":["newPhone","reason"]},"UpdatePhoneAuthResponseV1":{"type":"object","properties":{"rukki_id":{"type":"string"},"new_phone":{"type":"string"},"firebase_synced":{"type":"boolean"}}},"CreateUserRequestV1":{"type":"object","properties":{"countryCode":{"type":"string","minLength":1,"pattern":"^[A-Za-z]{2}$"},"firstName":{"type":"string","maxLength":100,"minLength":0},"lastName":{"type":"string","maxLength":100,"minLength":0},"middleName":{"type":"string","maxLength":100,"minLength":0},"birthday":{"type":"string","format":"date"},"phoneAuth":{"type":"string","minLength":1,"pattern":"^\\+\\d{10,15}$"},"orgId":{"type":"string"},"managerId":{"type":"string","format":"uuid"},"draftId":{"type":"string"}},"required":["countryCode","phoneAuth"]},"RoleAssignmentRequestV1":{"type":"object","description":"Запрос на назначение или отзыв ролей","properties":{"roles":{"type":"array","description":"Список ролей для назначения или отзыва","example":["ADMIN","MANAGER"],"items":{"type":"string"},"minItems":1,"uniqueItems":true}},"required":["roles"]},"CreateUserAddressRequestV1":{"type":"object","description":"Создание почтового адреса пользователя","properties":{"userId":{"type":"string","format":"uuid","description":"RUKKI-ID владельца адреса"},"address":{"$ref":"#/components/schemas/UserAddressRequestV1","description":"Поля адреса"}},"required":["address","userId"]},"CreateRoleRequestV1":{"type":"object","description":"DTO запроса для создания новой роли","properties":{"name":{"type":"string","description":"Название новой роли","example":"USER","maxLength":100,"minLength":2},"description":{"type":"string","description":"Краткое описание прав доступа роли","example":"Гостевой доступ (только чтение)","maxLength":255,"minLength":0}},"required":["name"]},"CreateProfessionRequestV1":{"type":"object","description":"DTO запроса для создания профессии в справочнике","properties":{"code":{"type":"string","description":"Уникальный код профессии","example":"EXCAVATOR_OPERATOR","maxLength":64,"minLength":2},"name":{"type":"string","description":"Название профессии","example":"Машинист экскаватора","maxLength":150,"minLength":2},"category":{"type":"string","description":"Категория: A (оператор техники) или B (сопутствующая)","enum":["A","B"]},"minRank":{"type":"integer","format":"int32","description":"Минимальный разряд","example":4,"maximum":8,"minimum":1},"maxRank":{"type":"integer","format":"int32","description":"Максимальный разряд","example":6,"maximum":8,"minimum":1},"equipmentBinding":{"type":"string","description":"Тип привязки к технике","enum":["STRICT","OPTIONAL"]},"equipmentTypes":{"type":"array","description":"Коды типов техники из каталога equipment-service","items":{"type":"string","maxLength":64,"minLength":0},"minItems":1},"regulatoryDocument":{"type":"string","description":"Нормативный документ","example":"ПБ 10-382-00","maxLength":255,"minLength":0},"description":{"type":"string","description":"Описание или примечание","maxLength":500,"minLength":0}},"required":["category","code","equipmentBinding","equipmentTypes","maxRank","minRank","name"]},"CreateLeadSourceRequestV1":{"type":"object","description":"DTO запроса на создание источника лида","properties":{"code":{"type":"string","description":"Код источника","example":"PARTNER","maxLength":32,"minLength":2},"description":{"type":"string","description":"Описание для UI","example":"Партнёрская программа","maxLength":255,"minLength":0}},"required":["code","description"]},"CreateUserResponseV1":{"type":"object","properties":{"rukki_id":{"type":"string","format":"uuid"},"firebase_status":{"type":"string","enum":["PENDING","CREATED","ACTIVATED"]},"sms_sent":{"type":"boolean"}}},"ProfessionAssignmentRequestV1":{"type":"object","description":"Запрос на назначение или отзыв профессий пользователю","properties":{"professionIds":{"type":"array","description":"UUID профессий из справочника","items":{"type":"string","format":"uuid"},"minItems":1,"uniqueItems":true}},"required":["professionIds"]},"StatusResponseV1":{"type":"object","properties":{"status":{"type":"string"}}},"ConfirmPhoneChangeRequestV1":{"type":"object","properties":{"newIdToken":{"type":"string","minLength":1}},"required":["newIdToken"]},"AddDeviceTokenRequestV1":{"type":"object","properties":{"fcm_token":{"type":"string","minLength":1}},"required":["fcm_token"]},"VerifyAuthRequestV1":{"type":"object","properties":{"idToken":{"type":"string","minLength":1}},"required":["idToken"]},"VerifyAuthResponseV1":{"type":"object","properties":{"rukki_id":{"type":"string","format":"uuid"},"status":{"type":"string"}}},"LogoutRequestV1":{"type":"object","description":"Опциональное тело logout: отзыв refresh JWT вместе с access","properties":{"refreshToken":{"type":"string","description":"Refresh JWT для отзыва при logout (camelCase или OAuth2 snake_case)","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."}}},"RevokeTokenRequestV1":{"type":"object","description":"Запрос на ручной отзыв JWT по jti (ADMIN)","properties":{"jti":{"type":"string","description":"Идентификатор токена (claim jti)","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","minLength":1},"expiresAt":{"type":"string","format":"date-time","description":"Время истечения токена (claim exp)","example":"2030-01-01T00:00:00Z"}},"required":["expiresAt","jti"]},"RevokeTokenResponseV1":{"type":"object","description":"Результат ручного отзыва JWT по jti","properties":{"status":{"type":"string","description":"Статус операции","example":"revoked"},"jti":{"type":"string","description":"Идентификатор отозванного токена (claim jti)","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"},"expires_at":{"type":"string","description":"Время истечения токена (claim exp)","example":"2030-01-01T00:00:00.000Z"}}},"RevokeUserTokensRequestV1":{"type":"object","description":"Запрос на отзыв всех JWT-сессий пользователя (ADMIN)","properties":{"userId":{"type":"string","format":"uuid","description":"RUKKI-ID пользователя","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"}},"required":["userId"]},"RevokeUserTokensResponseV1":{"type":"object","description":"Результат отзыва всех JWT-сессий пользователя","properties":{"status":{"type":"string","description":"Статус операции","example":"revoked"},"user_id":{"type":"string","description":"RUKKI-ID пользователя","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"},"revoked_at":{"type":"string","description":"Момент отзыва сессий","example":"2030-01-01T00:00:00.000Z"}}},"TokenResponseV1":{"type":"object","description":"OAuth2: пара access/refresh JWT после входа или refresh","properties":{"access_token":{"type":"string","description":"JWT access-токен для заголовка Authorization: Bearer","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."},"refresh_token":{"type":"string","description":"JWT refresh-токен для обмена на новую пару (POST /auth/token или /auth/refresh)","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."},"rukki_id":{"type":"string","description":"UUID пользователя в платформе (дубликат claim sub)","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"expires_in":{"type":"integer","format":"int64","description":"TTL access-токена в секундах","example":900},"refresh_expires_in":{"type":"integer","format":"int64","description":"TTL refresh-токена в секундах","example":2592000},"token_type":{"type":"string","description":"Тип токена в заголовке Authorization","example":"Bearer"}}},"OAuth2TokenErrorResponseV1":{"type":"object","description":"OAuth2 ошибка token endpoint (refresh grant)","properties":{"error":{"type":"string","description":"Код ошибки RFC 6749","enum":["invalid_grant","invalid_client","unsupported_grant_type","invalid_request","slow_down"],"example":"invalid_grant"},"error_description":{"type":"string","description":"Описание ошибки для клиента","example":"Invalid refresh token"}}},"TelegramWidgetAuthRequestV1":{"type":"object","description":"Telegram Login Widget: полезная нагрузка с HMAC-SHA256 подписью","properties":{"id":{"type":"integer","format":"int64","description":"Идентификатор пользователя Telegram","example":123456789},"first_name":{"type":"string","description":"Имя пользователя","example":"Иван"},"last_name":{"type":"string","description":"Фамилия пользователя (опционально)","example":"Иванов"},"username":{"type":"string","description":"Username без @ (опционально)","example":"ivan_ivanov"},"photo_url":{"type":"string","description":"URL аватара (опционально)","example":"https://t.me/i/userpic/320/ivan.jpg"},"auth_date":{"type":"integer","format":"int64","description":"Unix timestamp авторизации на сервере Telegram","example":1672531200},"hash":{"type":"string","description":"HMAC-SHA256 подпись данных виджета","example":"e0ac...","minLength":1}},"required":["auth_date","hash","id"]},"CallAuthRequestV1":{"type":"object","description":"Call Flow / Telegram Gateway: номер телефона для инициации входа","properties":{"phone":{"type":"string","description":"Номер телефона: 10–15 цифр, префикс «+» в начале необязателен (например +79991234567 или 79991234567)","example":79991234567,"minLength":1,"pattern":"^\\+?\\d{10,15}$"}},"required":["phone"]},"CallAuthResponseV1":{"type":"object","description":"Call Flow: ответ инициации звонка-сброса (SMS.RU)","properties":{"status":{"type":"string","description":"Статус операции","example":"OK"},"status_code":{"type":"integer","format":"int32","description":"Числовой код статуса","example":100},"check_id":{"type":"string","description":"Идентификатор сессии Call Flow для STOMP и webhook","example":"201737-542"},"call_phone":{"type":"string","description":"Сервисный номер, на который нужно позвонить","example":78005008275},"call_phone_pretty":{"type":"string","description":"Сервисный номер в формате для отображения","example":"+7 (800) 500-8275"}}},"TelegramGatewayCodeSendResponseV1":{"type":"object","description":"Telegram Gateway: OTP отправлен в приложение Telegram","properties":{"request_id":{"type":"string","description":"Идентификатор сессии Telegram Gateway","example":"req-abc123"},"phone_number":{"type":"string","description":"Номер телефона в формате E.164","example":"+79991234567"},"ttl":{"type":"integer","format":"int32","description":"Время жизни OTP-кода в секундах","example":300}}},"TelegramGatewayCodeVerifyRequestV1":{"type":"object","description":"Telegram Gateway: проверка OTP и выдача JWT","properties":{"phone":{"type":"string","description":"Номер телефона (как при POST /api/v1/auth/telegram/code): 10–15 цифр, префикс «+» необязателен","example":79991234567,"minLength":1,"pattern":"^\\+?\\d{10,15}$"},"code":{"type":"string","description":"OTP-код из приложения Telegram","example":123456,"minLength":1,"pattern":"\\d{4,8}"},"request_id":{"type":"string","description":"Идентификатор сессии из ответа POST /api/v1/auth/telegram/code","example":"req-abc123","minLength":1}},"required":["code","phone","request_id"]},"RefreshTokenRequestV1":{"type":"object","description":"JSON-запрос обмена refresh JWT на новую пару access/refresh","properties":{"refreshToken":{"type":"string","description":"Refresh JWT, выданный при логине или предыдущем обмене","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...","minLength":1},"client_id":{"type":"string","description":"OAuth2 client_id (опционально); должен совпадать с claim azp refresh-токена","example":"identity-service"}},"required":["refreshToken"]},"RotateSigningKeyResponseV1":{"type":"object","description":"Результат принудительной ротации JWT signing key","properties":{"old_kid":{"type":"string","description":"Предыдущий kid","example":"ab12cd34ef56ab78"},"new_kid":{"type":"string","description":"Новый активный kid","example":"fe98dc76ba54fe21"}}},"PartialUpdateUserRequestV1":{"type":"object","properties":{"firstName":{"type":"string","description":"Имя пользователя","maxLength":100,"minLength":0,"pattern":"^(?!\\s*$).+"},"lastName":{"type":"string","description":"Фамилия пользователя","maxLength":100,"minLength":0},"middleName":{"type":"string","description":"Отчество пользователя","maxLength":100,"minLength":0},"birthday":{"type":"string","format":"date","description":"Дата рождения пользователя"},"email":{"type":"string","format":"email","maxLength":255,"minLength":0},"inn":{"type":"string","maxLength":12,"minLength":0,"pattern":"^\\d{10}(\\d{2})?$"},"sbpPhone":{"type":"string","pattern":"^\\+?[1-9]\\d{1,14}$"},"maxPhone":{"type":"string","pattern":"^\\+?[1-9]\\d{1,14}$"},"ukepId":{"type":"string","maxLength":1024,"minLength":0},"channels":{"type":"array","description":"Каналы уведомлений; при передаче полностью заменяют текущий список","items":{"type":"string","enum":["EMAIL","SMS","WHATSAPP","MAX","TELEGRAM"]}},"notificationCategories":{"type":"array","description":"Категории уведомлений; при передаче полностью заменяют текущий список","items":{"type":"string","enum":["ORDER_CREATED","CONTRACTOR_ASSIGNED","CONTRACTOR_ARRIVED_TO_OBJECT","CONTRACTOR_COMPLETED_WORK","CONTRACTOR_REASSIGNED","NEW_RESPONSE_TO_ORDER","PAYMENT_RECEIVED","CONTRACTOR_DEPARTED_TO_ORDER","COUNTER_OFFER"]}},"avatarFileId":{"type":"string","format":"uuid","description":"Идентификатор файла аватара (file-service)"},"geoData":{"type":"array","description":"Гео-точки; при передаче полностью заменяют текущий список","items":{"$ref":"#/components/schemas/UserGeoDataRequestV1"}},"addresses":{"type":"array","description":"Адреса; при передаче полностью заменяют текущий список","items":{"$ref":"#/components/schemas/UserAddressRequestV1"},"maxItems":10,"minItems":0}}},"UpdateUserQualificationRequestV1":{"type":"object","description":"DTO запроса на изменение квалификации пользователя в CRM","properties":{"status":{"type":"string","description":"Статус учётной записи (LEAD, ACTIVE, BANNED); null — не менять","enum":["LEAD","ACTIVE","BANNED","DELETED"],"example":"ACTIVE"},"clientType":{"type":"string","description":"Тип клиента (B2C, B2B); null — не менять","enum":["B2C","B2B"]},"leadQualification":{"type":"string","description":"Квалификация лида в CRM (N, A–D, X); null — не менять","enum":["N","A","B","C","D","X"]},"leadSourceId":{"type":"string","format":"uuid","description":"UUID источника лида из справочника; null — не менять"},"clearLeadSource":{"type":"boolean","default":false,"description":"Снять текущий источник лида"}}},"LeadSourceSummaryResponseV1":{"type":"object","description":"Краткая информация об источнике лида","properties":{"id":{"type":"string","format":"uuid","description":"UUID источника лида (строка)"},"code":{"type":"string","description":"Стабильный код источника","example":"INCOMING"},"description":{"type":"string","description":"Название для UI CRM","example":"Входящий"}}},"UserQualificationResponseV1":{"type":"object","description":"Квалификация пользователя в CRM","properties":{"userId":{"type":"string","format":"uuid","description":"RUKKI-ID пользователя"},"status":{"type":"string","description":"Статус учётной записи","enum":["LEAD","ACTIVE","BANNED","DELETED"]},"clientType":{"type":"string","description":"Тип клиента: B2C — физическое лицо, B2B — юридическое лицо","enum":["B2C","B2B"]},"leadQualification":{"type":"string","description":"Квалификация лида в CRM: N, A–D, X","enum":["N","A","B","C","D","X"]},"leadSource":{"$ref":"#/components/schemas/LeadSourceSummaryResponseV1","description":"Источник лида в CRM"}}},"UpdateUserManagerRequestV1":{"type":"object","description":"Назначение или снятие менеджера пользователя","properties":{"managerId":{"type":"string","format":"uuid","description":"UUID менеджера (user с ролью MANAGER)"},"clear":{"type":"boolean","default":false,"description":"Снять текущего менеджера"},"mutuallyExclusive":{"type":"boolean"}}},"PartialUpdateUserAddressRequestV1":{"type":"object","description":"Частичное обновление почтового адреса пользователя","properties":{"label":{"type":"string","description":"Метка адреса","maxLength":50,"minLength":0},"countryCode":{"type":"string","description":"ISO-код страны","maxLength":5,"minLength":0},"city":{"type":"string","description":"Город","maxLength":255,"minLength":0},"region":{"type":"string","description":"Регион / район / область","maxLength":255,"minLength":0},"street":{"type":"string","description":"Улица","maxLength":255,"minLength":0},"house":{"type":"string","description":"Дом / строение","maxLength":50,"minLength":0},"apartment":{"type":"string","description":"Квартира / офис","maxLength":50,"minLength":0},"postalCode":{"type":"string","description":"Почтовый индекс","maxLength":20,"minLength":0},"comment":{"type":"string","description":"Комментарий к адресу"},"primary":{"type":"boolean","description":"Основной адрес"}}},"PartialUpdateRoleRequestV1":{"type":"object","description":"DTO запроса для обновления (редактирования) существующей роли","properties":{"name":{"type":"string","description":"Новое название роли","example":"SUPER_USER","maxLength":100,"minLength":0,"pattern":".*\\S.*"},"description":{"type":"string","description":"Обновленное описание для роли","example":"Пользователь с расширенным доступом","maxLength":255,"minLength":0}}},"PartialUpdateProfessionRequestV1":{"type":"object","description":"DTO запроса для частичного обновления существующей профессии","properties":{"code":{"type":"string","description":"Новый код профессии","maxLength":64,"minLength":2,"pattern":".*\\S.*"},"name":{"type":"string","description":"Новое название профессии","maxLength":150,"minLength":2,"pattern":".*\\S.*"},"category":{"type":"string","description":"Категория A или B","enum":["A","B"]},"minRank":{"type":"integer","format":"int32","description":"Минимальный разряд","maximum":8,"minimum":1},"maxRank":{"type":"integer","format":"int32","description":"Максимальный разряд","maximum":8,"minimum":1},"equipmentBinding":{"type":"string","description":"Тип привязки к технике","enum":["STRICT","OPTIONAL"]},"equipmentTypes":{"type":"array","description":"Коды типов техники","items":{"type":"string","maxLength":64,"minLength":0}},"regulatoryDocument":{"type":"string","description":"Нормативный документ","maxLength":255,"minLength":0},"description":{"type":"string","description":"Описание","maxLength":500,"minLength":0}}},"PartialUpdateLeadSourceRequestV1":{"type":"object","description":"DTO запроса на частичное обновление источника лида","properties":{"code":{"type":"string","description":"Новый код источника","maxLength":32,"minLength":2,"pattern":".*\\S.*"},"description":{"type":"string","description":"Новое описание","maxLength":255,"minLength":0,"pattern":".*\\S.*"}}},"UpdateBitrixScheduledSyncSettingsRequestV1":{"type":"object","description":"Обновление настроек плановой синхронизации Bitrix24","properties":{"enabled":{"type":"boolean","description":"Включить плановую синхронизацию"},"cron":{"type":"string","description":"Cron override (Spring 6-field); пустая строка сбрасывает на defaultCron из конфигурации","maxLength":64,"minLength":0}}},"PagedResponseUserResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/UserResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"PagedResponseUserManagerAssignmentHistoryResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/UserManagerAssignmentHistoryResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"UserManagerAssignmentHistoryResponseV1":{"type":"object","description":"История назначения менеджера","properties":{"id":{"type":"string","format":"uuid","description":"UUID записи"},"userId":{"type":"string","format":"uuid","description":"UUID пользователя"},"previousManagerId":{"type":"string","format":"uuid","description":"Предыдущий менеджер"},"newManagerId":{"type":"string","format":"uuid","description":"Новый менеджер"},"changedBy":{"type":"string","format":"uuid","description":"UUID CRM-оператора, инициировавшего назначение (бизнес-поле, не JPA audit)"},"source":{"type":"string","description":"Источник: CRM | BITRIX_IMPORT","enum":["CRM","BITRIX_IMPORT"]},"bitrixEventId":{"type":"string","description":"Идемпотентный ID события Bitrix"},"changedAt":{"type":"string","format":"date-time","description":"Время изменения"},"createdBy":{"type":"string","description":"Идентификатор создателя записи журнала (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись журнала (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"PagedResponseUserLeadQualificationHistoryResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/UserLeadQualificationHistoryResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"UserLeadQualificationHistoryResponseV1":{"type":"object","description":"Запись истории изменения квалификации лида","properties":{"id":{"type":"string","format":"uuid","description":"UUID записи журнала"},"previousQualification":{"type":"string","description":"Предыдущая квалификация лида","enum":["N","A","B","C","D","X"]},"newQualification":{"type":"string","description":"Новая квалификация лида","enum":["N","A","B","C","D","X"]},"leadSource":{"$ref":"#/components/schemas/LeadSourceSummaryResponseV1","description":"Источник лида на момент изменения"},"changedBy":{"type":"string","format":"uuid","description":"UUID CRM-оператора, инициировавшего смену квалификации (бизнес-поле, не JPA audit)"},"changedAt":{"type":"string","format":"date-time","description":"Дата и время изменения"},"bitrixEntityType":{"type":"string","description":"Тип сущности Bitrix (LEAD / DEAL)"},"bitrixEntityId":{"type":"integer","format":"int64","description":"ID лида/сделки в Bitrix24"},"bitrixStageId":{"type":"string","description":"STAGE_ID Bitrix на момент смены"},"createdBy":{"type":"string","description":"Идентификатор создателя записи журнала (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись журнала (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"PagedResponseUserCrmTimelineResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/UserCrmTimelineResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"UserCrmTimelineResponseV1":{"type":"object","description":"Запись CRM timeline Bitrix24","properties":{"id":{"type":"string","format":"uuid","description":"UUID записи"},"userId":{"type":"string","format":"uuid","description":"UUID пользователя"},"bitrixEntityType":{"type":"string","description":"Тип сущности Bitrix","enum":["CONTACT","COMPANY","LEAD","DEAL","ACTIVITY"]},"bitrixEntityId":{"type":"integer","format":"int64","description":"ID сущности Bitrix"},"entryType":{"type":"string","description":"Тип записи timeline","enum":["COMMENT","CALL","EMAIL","ACTIVITY","STAGE_CHANGE","LOG","OTHER"]},"bitrixEntryId":{"type":"string","description":"Идемпотентный ID записи в Bitrix"},"authorUserId":{"type":"string","format":"uuid","description":"Автор в identity"},"authorBitrixId":{"type":"integer","format":"int64","description":"Автор в Bitrix"},"title":{"type":"string","description":"Заголовок"},"body":{"type":"string","description":"Текст"},"payload":{"type":"object","additionalProperties":{},"description":"Сырой снимок Bitrix"},"occurredAt":{"type":"string","format":"date-time","description":"Время события в CRM"},"createdBy":{"type":"string","description":"Идентификатор создателя записи (JWT sub или ANONYMOUS)","example":"ANONYMOUS"},"updatedBy":{"type":"string","description":"Идентификатор последнего обновившего запись (JWT sub или ANONYMOUS)","example":"ANONYMOUS"}}},"PagedResponseUserBitrixLinkResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/UserBitrixLinkResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"PagedResponseUserAddressResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/UserAddressResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"PagedResponseRoleResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/RoleResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"PagedResponseProfessionResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/ProfessionResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"PagedResponseLeadSourceResponseV1":{"type":"object","description":"Постраничный ответ со списком элементов","properties":{"content":{"type":"array","description":"Элементы текущей страницы","items":{"$ref":"#/components/schemas/LeadSourceResponseV1"}},"currentPage":{"type":"integer","format":"int32","description":"Номер текущей страницы (с 1)","example":1},"pageSize":{"type":"integer","format":"int32","description":"Размер страницы","example":20},"totalElements":{"type":"integer","format":"int64","description":"Общее количество элементов","example":100}}},"SearchUsersResponseV1":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/UserResponseV1"}}}}},"securitySchemes":{"bearerAuth":{"type":"http","description":"JWT access token identity-service.\nВ Swagger UI вставьте только значение токена (префикс Bearer подставляется автоматически).\nРоли: claim realm_access.roles (USER, MANAGER, ADMIN, SUPERADMIN и др.).\n","scheme":"bearer","bearerFormat":"JWT"}}}}