{"openapi":"3.0.0","info":{"title":"1Ci CAT API v1","description":"# Введение\n\n1Ci CAT API - это RESTful API, который позволяет интегрировать процессы локализации\nв ваши бизнес-процессы и разработку. С помощью API можно управлять проектами перевода,\nфайлами, лингвистическими ресурсами (ТМ, глоссарии, плейсхолдеры), пользователями и\nпоставщиками переводческих услуг.\n\n## Авторизация\n\nДля работы с API используйте **Personal Access Token**, который генерируется в настройках\nвашего аккаунта.\n\n> ⚠️ **В разработке.** Генерация токена в интерфейсе системы пока не реализована.\n> Планируется добавить в настройки аккаунта кнопку генерации токена. Токен отображается\n> один раз при создании - его необходимо сохранить. При перегенерации предыдущий токен\n> немедленно перестаёт работать.\n\nПередавайте токен в заголовке каждого запроса:\n\n```\nAuthorization: Bearer <ACCESS_TOKEN>\n```\n\n**401 Unauthorized** - токен отсутствует или недействителен:\n```json\n{\n  \"error\": {\n    \"message\": \"Unauthorized\",\n    \"code\": 401\n  }\n}\n```\n\n**403 Forbidden** - недостаточно прав:\n```json\n{\n  \"error\": {\n    \"message\": \"Access denied\",\n    \"code\": 403\n  }\n}\n```\n\n## Роли и права доступа\n\n| Роль | Описание |\n|------|----------|\n| `tenant_admin` | Администратор тенанта. Управляет пользователями своего тенанта, генерирует приглашения |\n| `manager` | Менеджер проектов. Создаёт и управляет проектами, ТМ, глоссариями, плейсхолдерами |\n| `vendor_manager` | Назначает лингвистов поставщика на файлы проектов, просматривает статистику |\n| `linguist` | Выполняет задачи перевода и редактуры в рамках назначенных проектов |\n\n## Выполнение запросов\n\nВсе запросы выполняются по протоколу HTTPS. API принимает и возвращает данные в формате JSON.\n\n| Метод | Назначение |\n|-------|-----------|\n| `GET` | Получение ресурса или списка ресурсов |\n| `POST` | Создание нового ресурса |\n| `PATCH` | Частичное обновление ресурса |\n| `DELETE` | Удаление ресурса |\n\nЗапросы на запись (`POST`, `PATCH`) должны содержать заголовок:\n```\nContent-Type: application/json\n```\n\nИсключение: запросы на загрузку файлов используют `multipart/form-data`.\n\n## Загрузка файлов\n\nФайлы загружаются напрямую в соответствующий endpoint через `multipart/form-data`.\nМаксимальный размер загружаемого файла - 100 МБ.\n\n**Поддерживаемые форматы исходных файлов:** `.xliff`, `.po`, `.properties`,\n`.json`, `.xml`, `.html`, `.txt`, `.xlsx`, `.csv`, `.docx`\n\n**ТМ** импортируется из файла `.tmx`, упакованного в `.zip`-архив.\n\n**Глоссарий** загружается в формате `.xlsx`.\n\n## Пагинация\n\nСписочные endpoint'ы поддерживают параметры `limit` и `offset`:\n\n| Параметр | Тип | По умолчанию | Описание |\n|----------|-----|-------------|----------|\n| `limit` | integer | 25 | Количество записей на странице (макс. 500) |\n| `offset` | integer | 0 | Количество пропускаемых записей |\n\nСтруктура ответа для списков:\n```json\n{\n  \"data\": [ ... ],\n  \"pagination\": {\n    \"offset\": 0,\n    \"limit\": 25,\n    \"total\": 100\n  }\n}\n```\n\n## Асинхронные операции\n\nРяд операций (запуск претранслейта, экспорт ТМ) выполняется асинхронно:\n\n1. Запускающий запрос возвращает `202 Accepted` с `operationId`\n2. Для проверки статуса - GET-запрос с `operationId`\n3. После завершения - GET-запрос для получения временной ссылки на скачивание\n\n## Ограничения по частоте запросов\n\nДопускается не более **20 одновременных запросов на аккаунт** (суммарно по всем токенам).\nПри превышении возвращается:\n\n**429 Too Many Requests**\n","version":"1.0.0","contact":{"email":"support@1ci.com"}},"servers":[{"url":"https://one-cat.1ci.com/","description":"Production"}],"tags":[{"name":"Projects","description":"Создание проектов, управление файлами, разрешениями и настройка лингвистических ресурсов."},{"name":"Translation Memories","description":"Управление памятями переводов - создание, импорт, экспорт, поиск и редактирование сегментов."},{"name":"Glossaries","description":"Управление глоссариями - загрузка, скачивание, обновление и удаление."},{"name":"Placeholders","description":"Управление пресетами плейсхолдеров (наборы регулярных выражений)."},{"name":"Segments","description":"Чтение и обновление сегментов перевода внутри файла проекта."},{"name":"LLM Translate","description":"Управление промтами для LLM-перевода и запуск перевода/редактуры с помощью LLM.\nПоддерживаемые провайдеры: YandexGPT и Azure (ChatGPT и другие модели).\n"},{"name":"Vendors","description":"Управление поставщиками переводческих услуг и их лингвистами."},{"name":"Users","description":"Приглашение пользователей и управление их ролями."}],"paths":{"/projects":{"get":{"tags":["Projects"],"summary":"Список проектов","description":"Возвращает список проектов, доступных авторизованному пользователю.\n\n- `manager` видит все проекты воркспейса.\n- `vendor_manager` видит только проекты, на которые назначен его поставщик.\n- `linguist` видит только проекты, к которым ему предоставлен доступ.\n","operationId":"api.projects.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"},{"name":"orderBy","in":"query","schema":{"type":"string","example":"name asc"},"description":"Сортировка. Поддерживаемое поле: `name`. Порядок: `asc` или `desc`."}],"responses":{"200":{"description":"Список проектов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Projects"],"summary":"Создать проект","description":"Создаёт новый проект перевода.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreateRequest"},"example":{"name":"Документация Q4 ","sourceLanguageId":"en","targetLanguageIds":["ru","de"],"includeProofreading":true}}}},"responses":{"201":{"description":"Проект создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/projects/{projectId}":{"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"get":{"tags":["Projects"],"summary":"Получить проект","description":"Возвращает параметры конкретного проекта.\n\n**Требуемая роль:** `manager`, `vendor_manager` или `linguist` (с доступом к проекту)\n","operationId":"api.projects.get","responses":{"200":{"description":"Данные проекта","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Projects"],"summary":"Редактировать проект","description":"Обновляет параметры проекта: название, шаги workflow.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.patch","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPatchRequest"}}}},"responses":{"200":{"description":"Проект обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Projects"],"summary":"Удалить проект","description":"Удаляет проект со всеми файлами. Действие необратимо.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.delete","responses":{"204":{"description":"Проект удалён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/files":{"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"get":{"tags":["Projects"],"summary":"Список файлов проекта","description":"Возвращает файлы проекта с прогрессом перевода.\n\n**Требуемая роль:** `manager`, `vendor_manager` или `linguist` (с доступом к проекту)\n","operationId":"api.projects.files.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список файлов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Projects"],"summary":"Загрузить файл в проект","description":"Загружает исходный файл в проект. Если файл с таким именем уже существует,\nон будет обновлён. При обновлении файла сохраняются переводы для совпадающих\nсегментов, новые сегменты добавляются со статусом незавершённых.\n\n**Требуемая роль:** `manager`\n\nПоддерживаемые форматы: `.xliff`, `.po`, `.properties`, `.json`, `.xml`,\n`.html`, `.txt`, `.xlsx`, `.csv`, `.docx`. Максимальный размер - 100 МБ.\n","operationId":"api.projects.files.post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Исходный файл для перевода."}}}}}},"responses":{"201":{"description":"Файл загружен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/files/{fileId}":{"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/FileId"}],"delete":{"tags":["Projects"],"summary":"Удалить файл из проекта","description":"Удаляет файл из проекта. Действие необратимо.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.files.delete","responses":{"204":{"description":"Файл удалён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/files/{fileId}/download":{"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/FileId"}],"get":{"tags":["Projects"],"summary":"Скачать файл","description":"Возвращает временную ссылку для скачивания переведённого файла или\nпромежуточного двуязычного файла в формате `.xliff`.\n\n**Требуемая роль:** `manager`, `vendor_manager` или `linguist` (с доступом к файлу)\n","operationId":"api.projects.files.download.get","parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["translations","xliff"]},"description":"- `translations` - итоговый файл с переводом в исходном формате\n- `xliff` - промежуточный двуязычный файл (`.xliff`)\n"},{"name":"targetLanguageId","in":"query","required":true,"schema":{"type":"string","example":"ru"},"description":"Код целевого языка (например, `ru`, `de`, `fr`)."}],"responses":{"200":{"description":"Ссылка для скачивания","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadLinkResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/pretranslate":{"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"post":{"tags":["Projects"],"summary":"Запустить предварительный перевод","description":"Запускает асинхронную задачу предварительного перевода. Система автоматически\nзаполняет не заполненные сегменты переводами из памяти переводов (ТМ) в соответствии\nс заданными условиями.\n\nПоддерживается несколько последовательных шагов претранслейта с разными\nнастройками (разные ТМ, языковые пары, пороги совпадения, файлы).\n\nВозвращает `202 Accepted` с `operationId`.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.pretranslate.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PretranslateRequest"},"example":{"steps":[{"targetLanguageIds":["ru"],"tmIds":[1,2],"minMatchRate":100,"workflowStep":"Translation","fileIds":[10,11],"minWordsInSegment":3}]}}}},"responses":{"202":{"description":"Задача претранслейта принята","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/permissions":{"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"get":{"tags":["Projects"],"summary":"Список прав доступа к проекту","description":"Возвращает всех пользователей и поставщиков, назначенных на проект,\nс указанием ограничений по файлам, этапам workflow и языковым парам.\n\n**Требуемая роль:** `manager` или `vendor_manager`\n","operationId":"api.projects.permissions.getMany","responses":{"200":{"description":"Список назначений","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Projects"],"summary":"Назначить пользователя или поставщика на проект","description":"Предоставляет пользователю или поставщику доступ к проекту. Можно ограничить\nдоступ по конкретным файлам, шагам workflow и языковым парам.\nЕсли ограничения не указаны, пользователю доступен весь проект.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.permissions.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCreateRequest"},"example":{"userId":15,"workflowSteps":["Translation","Final"],"targetLanguageIds":["ru"],"fileIds":[10,11]}}}},"responses":{"201":{"description":"Доступ предоставлен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/permissions/{permissionId}":{"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"permissionId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор записи о доступе."}],"delete":{"tags":["Projects"],"summary":"Отозвать доступ к проекту","description":"Убирает доступ пользователя или поставщика к проекту.\n\n**Требуемая роль:** `manager`\n","operationId":"api.projects.permissions.delete","responses":{"204":{"description":"Доступ отозван"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/translation-memories":{"get":{"tags":["Translation Memories"],"summary":"Список ТМ","description":"Возвращает все памяти переводов воркспейса.\n\n**Требуемая роль:** `manager`\n","operationId":"api.tms.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список ТМ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TMCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Translation Memories"],"summary":"Создать ТМ","description":"Создаёт пустую память переводов с заданным именем и языковой парой.\nВ дальнейшем ТМ наполняется автоматически при подтверждении сегментов,\nлибо через импорт из `.tmx`-файла.\n\n**Требуемая роль:** `manager`\n","operationId":"api.tms.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TMCreateRequest"},"example":{"name":"Документация продукта EN-RU","sourceLanguageId":"en","targetLanguageIds":["ru"]}}}},"responses":{"201":{"description":"ТМ создана","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TMResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/translation-memories/{tmId}":{"parameters":[{"$ref":"#/components/parameters/TmId"}],"get":{"tags":["Translation Memories"],"summary":"Получить ТМ","description":"Возвращает метаданные конкретной памяти переводов.\n\n**Требуемая роль:** `manager`\n","operationId":"api.tms.get","responses":{"200":{"description":"Данные ТМ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TMResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Translation Memories"],"summary":"Удалить ТМ","description":"Удаляет память переводов и отвязывает её от всех проектов, к которым она\nбыла подключена. Действие необратимо.\n\n**Требуемая роль:** `manager`\n","operationId":"api.tms.delete","responses":{"204":{"description":"ТМ удалена"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/translation-memories/{tmId}/import":{"parameters":[{"$ref":"#/components/parameters/TmId"}],"post":{"tags":["Translation Memories"],"summary":"Импортировать данные в ТМ","description":"Загружает сегменты в существующую ТМ из файла `.tmx`, упакованного\nв `.zip`-архив. Используется при переносе данных из другой системы\nили при обновлении ТМ вручную.\n\nВозвращает `202 Accepted` с `operationId`. Проверить статус:\n`GET /translation-memories/{tmId}/import/{operationId}`.\n\n**Требуемая роль:** `manager`\n","operationId":"api.tms.import.post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Файл `.tmx` в `.zip`-архиве."}}}}}},"responses":{"202":{"description":"Импорт принят","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/translation-memories/{tmId}/import/{operationId}":{"parameters":[{"$ref":"#/components/parameters/TmId"},{"$ref":"#/components/parameters/OperationId"}],"get":{"tags":["Translation Memories"],"summary":"Статус импорта ТМ","operationId":"api.tms.import.status.get","responses":{"200":{"description":"Статус задачи импорта","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationStatusResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/translation-memories/{tmId}/export":{"parameters":[{"$ref":"#/components/parameters/TmId"}],"post":{"tags":["Translation Memories"],"summary":"Экспортировать ТМ","description":"Запускает асинхронную выгрузку ТМ в файл `.tmx` (доставляется в `.zip`-архиве).\n\nПосле получения `operationId` проверяйте статус через\n`GET /translation-memories/{tmId}/export/{operationId}`. Когда статус станет `done`,\nв поле `downloadUrl` ответа будет доступна временная ссылка для скачивания архива.\n\n**Требуемая роль:** `manager`\n","operationId":"api.tms.export.post","responses":{"202":{"description":"Экспорт запущен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/translation-memories/{tmId}/export/{operationId}":{"parameters":[{"$ref":"#/components/parameters/TmId"},{"$ref":"#/components/parameters/OperationId"}],"get":{"tags":["Translation Memories"],"summary":"Статус экспорта ТМ","operationId":"api.tms.export.status.get","responses":{"200":{"description":"Статус задачи экспорта","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationStatusResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/glossaries":{"get":{"tags":["Glossaries"],"summary":"Список глоссариев","description":"Возвращает все глоссарии воркспейса.\n\n**Требуемая роль:** `manager`\n","operationId":"api.glossaries.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список глоссариев","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Glossaries"],"summary":"Загрузить глоссарий","description":"Создаёт новый глоссарий из файла `.xlsx`. Структура файла:\n- Заголовки столбцов - коды языков (например: `en`, `ru`, `ru-RU`). Один столбец - один язык.\n- Каждая строка - термин на языке оригинала и его перевод(ы).\n- Для одного термина допускается несколько строк (разные переводы в зависимости от контекста).\n- Необязательные столбцы: `Comments`, `CreationDate`, `Author`, `LastModifiedDate`, `LastModifiedBy`.\n\n**Требуемая роль:** `manager`\n","operationId":"api.glossaries.post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["name","file"],"properties":{"name":{"type":"string","description":"Имя глоссария."},"file":{"type":"string","format":"binary","description":"Файл глоссария в формате `.xlsx`."}}}}}},"responses":{"201":{"description":"Глоссарий загружен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/glossaries/{glossaryId}":{"parameters":[{"$ref":"#/components/parameters/GlossaryId"}],"get":{"tags":["Glossaries"],"summary":"Получить глоссарий","operationId":"api.glossaries.get","responses":{"200":{"description":"Данные глоссария","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Glossaries"],"summary":"Удалить глоссарий","description":"Удаляет глоссарий и отвязывает его от всех проектов. Действие необратимо.\n\n**Требуемая роль:** `manager`\n","operationId":"api.glossaries.delete","responses":{"204":{"description":"Глоссарий удалён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/glossaries/{glossaryId}/download":{"parameters":[{"$ref":"#/components/parameters/GlossaryId"}],"get":{"tags":["Glossaries"],"summary":"Скачать глоссарий","description":"Возвращает временную ссылку для скачивания глоссария в формате `.xlsx`.\n\n**Требуемая роль:** `manager`\n","operationId":"api.glossaries.download.get","responses":{"200":{"description":"Ссылка для скачивания","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadLinkResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/glossaries/{glossaryId}/update":{"parameters":[{"$ref":"#/components/parameters/GlossaryId"}],"post":{"tags":["Glossaries"],"summary":"Обновить содержимое глоссария","description":"Заменяет содержимое существующего глоссария новым файлом `.xlsx`.\nТребования к структуре файла аналогичны загрузке нового глоссария.\n\n**Требуемая роль:** `manager`\n","operationId":"api.glossaries.update.post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Обновлённый файл глоссария в формате `.xlsx`."}}}}}},"responses":{"200":{"description":"Глоссарий обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/placeholder-presets":{"get":{"tags":["Placeholders"],"summary":"Список пресетов плейсхолдеров","description":"Возвращает все пресеты плейсхолдеров воркспейса.\n\n**Требуемая роль:** `manager`\n","operationId":"api.placeholder-presets.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список пресетов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceholderPresetCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Placeholders"],"summary":"Создать пресет плейсхолдеров","description":"Создаёт пресет плейсхолдеров с именем и набором PCRE-регулярных выражений.\nПресет можно подключить к любому проекту.\n\nРегулярные выражения должны соответствовать стандарту PCRE.\nРекомендуется проверять паттерны на https://regex101.com/.\n\n**Требуемая роль:** `manager`\n","operationId":"api.placeholder-presets.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceholderPresetCreateRequest"},"example":{"name":"UI Variables","patterns":["%[a-zA-Z_]+%","\\{[a-zA-Z_]+\\}","https?:\\/\\/\\S+"]}}}},"responses":{"201":{"description":"Пресет создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceholderPresetResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/placeholder-presets/{presetId}":{"parameters":[{"$ref":"#/components/parameters/PresetId"}],"get":{"tags":["Placeholders"],"summary":"Получить пресет плейсхолдеров","operationId":"api.placeholder-presets.get","responses":{"200":{"description":"Данные пресета","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceholderPresetResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Placeholders"],"summary":"Обновить пресет плейсхолдеров","description":"Полностью заменяет список паттернов в пресете. Изменения немедленно\nприменяются во всех проектах, к которым подключён данный пресет.\n\nДля изменения отдельного паттерна необходимо удалить его и добавить новый -\nредактирование существующего паттерна не поддерживается.\n\n**Требуемая роль:** `manager`\n","operationId":"api.placeholder-presets.put","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceholderPresetCreateRequest"}}}},"responses":{"200":{"description":"Пресет обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceholderPresetResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Placeholders"],"summary":"Удалить пресет плейсхолдеров","description":"Удаляет пресет и отвязывает его от всех проектов. Действие необратимо.\nПосле удаления пресета плейсхолдеры из него перестают применяться в проектах.\n\n**Требуемая роль:** `manager`\n","operationId":"api.placeholder-presets.delete","responses":{"204":{"description":"Пресет удалён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/files/{fileId}/segments":{"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/FileId"}],"get":{"tags":["Segments"],"summary":"Список сегментов файла","description":"Возвращает сегменты файла с возможностью фильтрации по статусу, автору,\nблокировке и тексту. Используется для получения данных редактора.\n\n**Требуемая роль:** `manager`, `vendor_manager` или `linguist` (с доступом к файлу)\n","operationId":"api.segments.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"},{"name":"targetLanguageId","in":"query","required":true,"schema":{"type":"string","example":"ru"},"description":"Код целевого языка."},{"name":"workflowStatus","in":"query","schema":{"type":"string","example":"Translation"},"description":"Фильтр по шагу workflow (например, `Translation`, `Proofreading`, `Final`)."},{"name":"locked","in":"query","schema":{"type":"boolean"},"description":"Фильтр по блокировке сегментов."},{"name":"authorId","in":"query","schema":{"type":"integer"},"description":"Фильтр по ID автора последнего изменения."},{"name":"searchInSource","in":"query","schema":{"type":"string"},"description":"Поиск по тексту исходного сегмента."},{"name":"searchInTarget","in":"query","schema":{"type":"string"},"description":"Поиск по тексту перевода."},{"name":"matchCase","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Список сегментов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/files/{fileId}/segments/{segmentId}":{"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/FileId"},{"name":"segmentId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор сегмента."}],"patch":{"tags":["Segments"],"summary":"Обновить перевод сегмента","description":"Сохраняет перевод сегмента или подтверждает его (`approve`), переводя\nна следующий шаг workflow.\n\n**Требуемая роль:** `linguist`, `vendor_manager` или `manager`\n","operationId":"api.segments.patch","parameters":[{"name":"targetLanguageId","in":"query","required":true,"schema":{"type":"string"},"description":"Код целевого языка."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentUpdateRequest"},"example":{"targetText":"Текст перевода","action":"approve"}}}},"responses":{"200":{"description":"Сегмент обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/llm-prompts":{"get":{"tags":["LLM Translate"],"summary":"Список промтов","description":"Возвращает список всех сохранённых промтов в тенанте.\nПромты не привязаны к конкретному проекту - они доступны для использования\nв любом проекте тенанта.\n\n**Требуемая роль:** `manager` + право доступа `LLM`\n","operationId":"api.llm-prompts.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список промтов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMPromptCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["LLM Translate"],"summary":"Создать промт","description":"Создаёт новый промт. Промт сохраняется на уровне тенанта и доступен\nдля запуска в любом проекте.\n\nВ тексте промта (`promptText`) можно использовать переменные-плейсхолдеры:\n\n| Переменная | Описание |\n|------------|----------|\n| `$$$SourceLanguage$$$` | Исходный язык |\n| `$$$TargetLanguage$$$` | Целевой язык |\n| `$$$Glossary$$$` | Термины из глоссария, подключённого к проекту |\n| `$$$Pretranslate$$$` | Релевантные записи из ТМ |\n| `$$$CurrentSegment$$$` | Текущий сегмент |\n| `$$$PreviousSegment$$$` | Предыдущий сегмент |\n| `$$$NextSegment$$$` | Следующий сегмент |\n\n**Требуемая роль:** `manager` + право доступа `LLM`\n","operationId":"api.llm-prompts.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMPromptCreateRequest"},"example":{"title":"Технический перевод ","provider":"azure","deployment":"gpt-4o","promptText":"Переведи сегменты с $$$SourceLanguage$$$ на $$$TargetLanguage$$$ язык. Используй глоссарий: $$$Glossary$$$. Давай только точный технический перевод без комментариев и дополнительной информации. Сохраняй теги из $$$SourceLanguage$$$. Используй ранее сделанный перевод $$$Pretranslate$$$.","temperature":0.3,"maxTokens":2000,"frequencyPenalty":0.0,"presencePenalty":0.0,"topProbability":1.0}}}},"responses":{"201":{"description":"Промт создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMPromptResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/llm-prompts/{promptId}":{"parameters":[{"$ref":"#/components/parameters/LLMPromptId"}],"patch":{"tags":["LLM Translate"],"summary":"Обновить промт","description":"Обновляет параметры существующего промта.\n\n**Требуемая роль:** `manager` + право доступа `LLM`\n","operationId":"api.llm-prompts.patch","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMPromptCreateRequest"}}}},"responses":{"200":{"description":"Промт обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMPromptResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["LLM Translate"],"summary":"Удалить промт","description":"Удаляет промт. Действие необратимо.\n\n**Требуемая роль:** `manager` + право доступа `LLM`\n","operationId":"api.llm-prompts.delete","responses":{"204":{"description":"Промт удалён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/llm-translate":{"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"post":{"tags":["LLM Translate"],"summary":"Запустить LLM-перевод","description":"Запускает асинхронную задачу перевода или редактуры файлов проекта с помощью LLM.\n\n**Режимы работы:**\n- **Перевод** (`proofreadsTarget: false`) - LLM переводит пустые сегменты.\n  Результат необходимо проверить и подтвердить вручную.\n- **Редактура** (`proofreadsTarget: true`) - LLM обрабатывает только уже\n  переведённые сегменты; пустые сегменты игнорируются.\n\nЕсли `fileIds` не указаны - обрабатываются все файлы проекта.\nЕсли `workflowStep` и `targetLanguageIds` не указаны - применяется ко всем\nэтапам и целевым языкам проекта.\n\nВозвращает `202 Accepted` с `operationId`. Проверить статус:\n`GET /projects/{projectId}/llm-translate/{operationId}`.\n\n**Требуемая роль:** `manager`\n","operationId":"api.llm-translate.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMTranslateRequest"},"example":{"promptId":3,"targetLanguageIds":["ru"],"fileIds":[10,11],"workflowStep":"Translation","proofreadsTarget":false}}}},"responses":{"202":{"description":"Задача LLM-перевода принята","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/projects/{projectId}/llm-translate/{operationId}":{"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/OperationId"}],"get":{"tags":["LLM Translate"],"summary":"Статус LLM-перевода","description":"Возвращает текущий статус и прогресс задачи LLM-перевода.\n\n**Требуемая роль:** `manager`\n","operationId":"api.llm-translate.status.get","responses":{"200":{"description":"Статус задачи","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationStatusResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/vendors":{"get":{"tags":["Vendors"],"summary":"Список поставщиков","description":"Возвращает всех поставщиков переводческих услуг в воркспейсе.\n\n**Требуемая роль:** `manager`\n","operationId":"api.vendors.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список поставщиков","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Vendors"],"summary":"Создать поставщика","description":"Создаёт запись нового поставщика переводческих услуг и назначает\nменеджера поставщика.\n\n**Требуемая роль:** `manager`\n","operationId":"api.vendors.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreateRequest"},"example":{"name":"Бюро переводов АКМЕ","vendorManagerId":7}}}},"responses":{"201":{"description":"Поставщик создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/vendors/{vendorId}":{"parameters":[{"$ref":"#/components/parameters/VendorId"}],"get":{"tags":["Vendors"],"summary":"Получить поставщика","operationId":"api.vendors.get","responses":{"200":{"description":"Данные поставщика","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Vendors"],"summary":"Удалить поставщика","operationId":"api.vendors.delete","responses":{"204":{"description":"Поставщик удалён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/vendors/{vendorId}/linguists":{"parameters":[{"$ref":"#/components/parameters/VendorId"}],"get":{"tags":["Vendors"],"summary":"Список лингвистов поставщика","description":"**Требуемая роль:** `manager` или `vendor_manager`\n","operationId":"api.vendors.linguists.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"Список лингвистов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Vendors"],"summary":"Добавить лингвиста к поставщику","description":"Добавляет существующего пользователя (с ролью `linguist`) в список\nлингвистов поставщика.\n\n**Требуемая роль:** `manager`\n","operationId":"api.vendors.linguists.post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"type":"integer","description":"ID пользователя с ролью `linguist`."}}}}}},"responses":{"201":{"description":"Лингвист добавлен к поставщику"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/users":{"get":{"tags":["Users"],"summary":"Список пользователей","description":"Возвращает всех пользователей воркспейса.\n\n**Требуемая роль:** `tenant_admin`\n","operationId":"api.users.getMany","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"},{"name":"role","in":"query","schema":{"type":"string","enum":["manager","vendor_manager","linguist"]},"description":"Фильтр по роли."},{"name":"status","in":"query","schema":{"type":"string","enum":["active","disabled"]},"description":"Фильтр по статусу аккаунта."}],"responses":{"200":{"description":"Список пользователей","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCollectionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/users/invite-link":{"post":{"tags":["Users"],"summary":"Сгенерировать пригласительную ссылку","description":"Генерирует ссылку для регистрации нового пользователя в воркспейсе.\nПользователь, зарегистрировавшийся по этой ссылке, автоматически получает\nроль `linguist`. При необходимости роль можно изменить через `PATCH /users/{userId}`.\n\n**Требуемая роль:** `tenant_admin`\n","operationId":"api.users.invite-link.post","responses":{"201":{"description":"Пригласительная ссылка создана","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"inviteLink":{"type":"string","format":"uri","example":"https://one-cat.1ci.com/register?invite=abc123"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/users/{userId}":{"parameters":[{"$ref":"#/components/parameters/UserId"}],"get":{"tags":["Users"],"summary":"Получить пользователя","operationId":"api.users.get","responses":{"200":{"description":"Данные пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Users"],"summary":"Обновить пользователя","description":"Изменяет роли или статус пользователя. Пользователь не может быть удалён -\nтолько заблокирован. При блокировке история активности и статистика сохраняются.\n\nОдному пользователю можно назначить несколько ролей одновременно.\n\n**Требуемая роль:** `tenant_admin`\n","operationId":"api.users.patch","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatchRequest"},"example":{"roles":["manager","linguist"],"status":"active"}}}},"responses":{"200":{"description":"Пользователь обновлён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","description":"Personal Access Token. Генерация токена в настройках аккаунта находится в разработке. При перегенерации предыдущий токен становится недействительным."}},"parameters":{"ProjectId":{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор проекта."},"FileId":{"name":"fileId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор файла в проекте."},"TmId":{"name":"tmId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор памяти переводов."},"GlossaryId":{"name":"glossaryId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор глоссария."},"PresetId":{"name":"presetId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор пресета плейсхолдеров."},"LLMPromptId":{"name":"promptId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор промта."},"VendorId":{"name":"vendorId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор поставщика."},"UserId":{"name":"userId","in":"path","required":true,"schema":{"type":"integer"},"description":"Идентификатор пользователя."},"OperationId":{"name":"operationId","in":"path","required":true,"schema":{"type":"string"},"description":"Идентификатор асинхронной операции, полученный при её запуске."},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","default":25,"maximum":500},"description":"Количество записей на странице."},"Offset":{"name":"offset","in":"query","schema":{"type":"integer","default":0},"description":"Количество записей для пропуска."}},"responses":{"BadRequest":{"description":"Некорректные параметры запроса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Токен отсутствует или недействителен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Недостаточно прав для выполнения операции","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Запрошенный ресурс не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","example":"Resource not found"},"code":{"type":"integer","example":404}}}}},"Pagination":{"type":"object","properties":{"offset":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}}},"DownloadLinkResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Временная ссылка для скачивания."},"expiresAt":{"type":"string","format":"date-time"}}}}},"AsyncOperationResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"operationId":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","done","failed"]},"createdAt":{"type":"string","format":"date-time"}}}}},"AsyncOperationStatusResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"operationId":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","done","failed"]},"progress":{"type":"integer","description":"Процент выполнения (0–100)."},"downloadUrl":{"type":"string","format":"uri","nullable":true,"description":"Временная ссылка для скачивания результата (только для операций экспорта).\nЗаполняется, когда `status` равен `done`.\n"},"finishedAt":{"type":"string","format":"date-time","nullable":true}}}}},"ProjectCreateRequest":{"type":"object","required":["name","sourceLanguageId","targetLanguageIds"],"properties":{"name":{"type":"string","description":"Название проекта. Поддерживаются символы латиницы и кириллицы.","example":"Документация Q4"},"sourceLanguageId":{"type":"string","description":"Код исходного языка (BCP-47, например `en`, `ru`).","example":"en"},"targetLanguageIds":{"type":"array","description":"Список кодов целевых языков.","items":{"type":"string"},"example":["ru","de"]},"includeProofreading":{"type":"boolean","default":false,"description":"Добавить этап `Proofreading` в рабочий процесс проекта.\nЭтапы `Translation` и `Final` включаются автоматически для каждого\nпроекта и не могут быть изменены.\n"}}},"ProjectPatchRequest":{"type":"object","properties":{"name":{"type":"string","description":"Новое название проекта."},"includeProofreading":{"type":"boolean","description":"Добавить этап `Proofreading` в рабочий процесс проекта.\nПередайте `true`, чтобы добавить этап. Удаление этапа не поддерживается.\nЕсли этап уже добавлен, поле игнорируется.\n"}}},"ProjectObject":{"type":"object","properties":{"id":{"type":"integer","example":42},"name":{"type":"string","example":"Документация Q4 "},"sourceLanguageId":{"type":"string","example":"en"},"targetLanguageIds":{"type":"array","items":{"type":"string"},"example":["ru","de"]},"workflowSteps":{"type":"array","description":"Этапы рабочего процесса в порядке выполнения.","items":{"type":"string","enum":["Translation","Proofreading","Final"]},"example":["Translation","Proofreading","Final"]},"createdAt":{"type":"string","format":"date-time"}}},"ProjectResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectObject"}}},"ProjectCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"FileObject":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","example":"user-manual.xliff"},"wordCount":{"type":"integer","description":"Общее количество слов в файле.","example":500},"wordsPerStep":{"type":"array","description":"Прогресс перевода по этапам workflow и целевым языкам.\nПоказывает, сколько слов переведено на каждом этапе для каждого языка.\n","items":{"type":"object","properties":{"targetLanguageId":{"type":"string","example":"ru"},"workflowStep":{"type":"string","enum":["Translation","Proofreading","Final"],"example":"Translation"},"translatedWords":{"type":"integer","description":"Количество переведённых слов на данном этапе.","example":100}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"FileResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FileObject"}}},"FileCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FileObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"PretranslateRequest":{"type":"object","required":["steps"],"properties":{"steps":{"type":"array","description":"Список шагов предварительного перевода, выполняемых последовательно.\nКаждый шаг задаёт независимые настройки: ТМ, языки, порог совпадения,\nэтап workflow, файлы.\n","items":{"type":"object","required":["tmIds","minMatchRate"],"properties":{"tmIds":{"type":"array","items":{"type":"integer"},"description":"Идентификаторы ТМ для данного шага. Обязательный параметр."},"minMatchRate":{"type":"integer","minimum":70,"maximum":103,"default":100,"description":"Минимальный процент совпадения с ТМ. Допустимые значения:\n`103` (совпадение источника и ID строки), `102` (с контекстом), `101`,\n`100`, `99`–`96`, `95`–`81`, `80`–`70`.\nСистема подставляет вариант с наибольшим совпадением, даже если задан\nболее низкий порог.\n"},"targetLanguageIds":{"type":"array","items":{"type":"string"},"description":"Целевые языки проекта. Если не указаны - претранслейт выполняется по всем языкам проекта."},"workflowStep":{"type":"string","enum":["Translation","Proofreading","Final"],"description":"Этап, на который подставляются переводы. Если не указан - применяется\nко всем этапам проекта.\n"},"fileIds":{"type":"array","items":{"type":"integer"},"description":"Список ID файлов. Если не указаны - обрабатываются все файлы проекта."},"minWordsInSegment":{"type":"integer","description":"Минимальное количество слов в сегменте для применения претранслейта."}}}}}},"PermissionObject":{"type":"object","properties":{"id":{"type":"integer","description":"Идентификатор записи о доступе, генерируется системой автоматически."},"userId":{"type":"integer","nullable":true,"description":"ID пользователя. Заполнено, если доступ выдан пользователю."},"vendorId":{"type":"integer","nullable":true,"description":"ID поставщика. Заполнено, если доступ выдан поставщику."},"workflowSteps":{"type":"array","items":{"type":"string","enum":["Translation","Proofreading","Final"]},"description":"Ограничение по этапам workflow. Пустой массив - доступны все этапы."},"targetLanguageIds":{"type":"array","items":{"type":"string"},"description":"Ограничение по языкам. Пустой массив - доступны все языки."},"fileIds":{"type":"array","items":{"type":"integer"},"description":"Ограничение по файлам. Пустой массив - доступны все файлы."},"createdAt":{"type":"string","format":"date-time"}}},"PermissionCreateRequest":{"type":"object","properties":{"userId":{"type":"integer","description":"Указывается при назначении пользователя."},"vendorId":{"type":"integer","description":"Указывается при назначении поставщика."},"workflowSteps":{"type":"array","items":{"type":"string","enum":["Translation","Proofreading","Final"]},"description":"Ограничение по этапам. Не указывать - для доступа ко всем этапам."},"targetLanguageIds":{"type":"array","items":{"type":"string"},"description":"Ограничение по языкам. Не указывать - для доступа ко всем языкам."},"fileIds":{"type":"array","items":{"type":"integer"},"description":"Ограничение по файлам. Не указывать - для доступа ко всем файлам."}}},"PermissionResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PermissionObject"}}},"PermissionCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PermissionObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"TMCreateRequest":{"type":"object","required":["name","sourceLanguageId","targetLanguageIds"],"properties":{"name":{"type":"string","description":"Название ТМ. Поддерживаются латиница и кириллица.","example":"Документация продукта EN-RU"},"sourceLanguageId":{"type":"string","description":"Код исходного языка.","example":"en"},"targetLanguageIds":{"type":"array","description":"Один или несколько кодов целевых языков.","items":{"type":"string"},"example":["ru"]}}},"TMObject":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"sourceLanguageId":{"type":"string"},"targetLanguageIds":{"type":"array","items":{"type":"string"}},"segmentsCount":{"type":"integer","description":"Общее количество сегментов в ТМ."},"createdAt":{"type":"string","format":"date-time"}}},"TMResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TMObject"}}},"TMCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TMObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"GlossaryObject":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"languageCodes":{"type":"array","items":{"type":"string"},"description":"Языки, представленные в глоссарии.","example":["en","ru"]},"createdAt":{"type":"string","format":"date-time"}}},"GlossaryResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GlossaryObject"}}},"GlossaryCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GlossaryObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"PlaceholderPresetCreateRequest":{"type":"object","required":["name","patterns"],"properties":{"name":{"type":"string","description":"Название пресета. Должно отражать назначение (например, «User manuals» или «Marketing»).","example":"UI Variables"},"patterns":{"type":"array","description":"Список PCRE-регулярных выражений. Каждый паттерн - отдельная строка.","items":{"type":"string"},"example":["%[a-zA-Z_]+%","\\{[a-zA-Z_]+\\}","https?:\\/\\/\\S+"]}}},"PlaceholderPresetObject":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"patterns":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}}},"PlaceholderPresetResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlaceholderPresetObject"}}},"PlaceholderPresetCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlaceholderPresetObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"SegmentObject":{"type":"object","properties":{"id":{"type":"integer"},"sourceText":{"type":"string"},"targetText":{"type":"string","nullable":true},"workflowStatus":{"type":"string","description":"Текущий шаг workflow (например, `Translation`, `Proofreading`, `Final`).","example":"Translation"},"locked":{"type":"boolean","description":"Заблокированные сегменты недоступны для редактирования и не учитываются\nв статистике проекта.\n"},"authorName":{"type":"string","nullable":true,"description":"Имя автора последнего изменения перевода."},"updatedAt":{"type":"string","format":"date-time","nullable":true}}},"SegmentResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SegmentObject"}}},"SegmentCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SegmentObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"SegmentUpdateRequest":{"type":"object","required":["targetText","action"],"properties":{"targetText":{"type":"string","description":"Текст перевода."},"action":{"type":"string","enum":["save_draft","approve"],"description":"- `save_draft` - сохраняет перевод без изменения шага workflow\n- `approve` - подтверждает перевод, переводит сегмент на следующий шаг\n  workflow.\n"}}},"LLMPromptCreateRequest":{"type":"object","required":["title","provider","promptText"],"properties":{"title":{"type":"string","description":"Название промта. По умолчанию отражает название модели.","example":"Технический перевод "},"provider":{"type":"string","enum":["yandex_gpt","azure"],"description":"Провайдер LLM."},"promptText":{"type":"string","description":"Текст промта. Поддерживает переменные-плейсхолдеры:\n`$$$SourceLanguage$$$`, `$$$TargetLanguage$$$`, `$$$Glossary$$$`,\n`$$$Pretranslate$$$`, `$$$CurrentSegment$$$`, `$$$PreviousSegment$$$`,\n`$$$NextSegment$$$`.\n"},"deployment":{"type":"string","description":"Имя развёртывания модели в Azure.","example":"gpt-4o"},"temperature":{"type":"number","format":"float","minimum":0,"maximum":2},"maxTokens":{"type":"integer","minimum":1},"frequencyPenalty":{"type":"number","format":"float","minimum":0,"maximum":2},"presencePenalty":{"type":"number","format":"float","minimum":0,"maximum":2},"topProbability":{"type":"number","format":"float","minimum":0,"maximum":1}}},"LLMPromptObject":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"provider":{"type":"string","enum":["yandex_gpt","azure"],"example":"azure"},"promptText":{"type":"string"},"deployment":{"type":"string","nullable":true},"temperature":{"type":"number","format":"float","nullable":true},"maxTokens":{"type":"integer","nullable":true},"frequencyPenalty":{"type":"number","format":"float","nullable":true},"presencePenalty":{"type":"number","format":"float","nullable":true},"topProbability":{"type":"number","format":"float","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"LLMPromptResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LLMPromptObject"}}},"LLMPromptCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LLMPromptObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"LLMTranslateRequest":{"type":"object","required":["promptId"],"properties":{"promptId":{"type":"integer","description":"ID сохранённого промта, который будет использован для перевода."},"targetLanguageIds":{"type":"array","items":{"type":"string"},"description":"Целевые языки для обработки. Если не указаны - применяется ко всем языкам проекта.","example":["ru"]},"fileIds":{"type":"array","items":{"type":"integer"},"description":"Файлы для обработки. Если не указаны - обрабатываются все файлы проекта."},"workflowStep":{"type":"string","enum":["Translation","Proofreading"],"description":"Этап workflow, на который подставляются переводы.\nЕсли не указан - применяется ко всем этапам проекта.\n"},"proofreadsTarget":{"type":"boolean","default":false,"description":"- `false` - режим перевода: LLM переводит пустые сегменты.\n- `true` - режим редактуры: LLM обрабатывает только уже переведённые\n  сегменты, пустые игнорируются.\n"}}},"VendorCreateRequest":{"type":"object","required":["name","vendorManagerId"],"properties":{"name":{"type":"string","description":"Название поставщика (бюро переводов).","example":"Бюро переводов АКМЕ"},"vendorManagerId":{"type":"integer","description":"ID пользователя, который будет назначен менеджером поставщика."}}},"VendorObject":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"vendorManagerId":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}},"VendorResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VendorObject"}}},"VendorCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VendorObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"UserObject":{"type":"object","properties":{"id":{"type":"integer"},"email":{"type":"string","format":"email"},"roles":{"type":"array","items":{"type":"string","enum":["manager","vendor_manager","linguist"]},"description":"Пользователю может быть назначено несколько ролей одновременно."},"status":{"type":"string","enum":["active","disabled"],"description":"Заблокированный пользователь не может войти в систему."},"createdAt":{"type":"string","format":"date-time"}}},"UserPatchRequest":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","enum":["manager","vendor_manager","linguist"]}},"status":{"type":"string","enum":["active","disabled"]}}},"UserResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserObject"}}},"UserCollectionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserObject"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}},"security":[{"BearerToken":[]}]}