{"openapi":"3.0.0","info":{"title":"Forma API","description":"Forma API","version":"1.0.59"},"servers":[{"url":"/api/v1","description":"API server"}],"paths":{"/yclientspublic/activate":{"post":{"tags":["YCLIENTS (публичные методы)"],"summary":"Активировать интеграцию в филиале","requestBody":{"description":"Данные аккаунта","required":true,"content":{"application/json":{"schema":{"allOf":[{"oneOf":[{"type":"object","properties":{"salon_id":{"type":"integer","description":"id филиала","example":1312083}}},{"type":"object","properties":{"salon_ids":{"type":"array","description":"id филиалов (непустой список)","items":{"type":"integer","description":"id филиала","example":1312083}}}}]},{"type":"object","properties":{"user_data":{"type":"string","description":"Захешированные данные пользователя","example":"ITo6LE...tYzkrPCy="},"user_data_sign":{"type":"string","description":"Хеш для валидации данных пользователя","example":"81fe0a...761711"}}}]},"examples":{"Один филиал":{"value":{"salon_id":1312083,"user_data":"ITo6LE...tYzkrPCy=","user_data_sign":"ITo6LE...tYzkrPCy="}},"Один филиал или более":{"value":{"salon_ids":[1312083,1326200],"user_data":"ITo6LE...tYzkrPCy=","user_data_sign":"ITo6LE...tYzkrPCy="}}}}}},"responses":{"201":{"description":"Возвращается URL-токен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlToken"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/yclientspublic/deactivate":{"post":{"tags":["YCLIENTS (публичные методы)"],"summary":"Отключение интеграции в филиале (вебхук YCLIENTS)","description":"Вызывает YCLIENTS при удалении или заморозке приложения в филиале. Подлинность проверяется по application_id и partner_token (должны совпадать с настройками интеграции сервера), иначе 403. При event = uninstall номер филиала убирается из рабочего пространства (запись в журнал филиалов); при freeze ничего не меняется. Ответ всегда success: true.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["salon_id","application_id","event","partner_token"],"properties":{"salon_id":{"type":"integer","description":"id филиала в YCLIENTS","example":1312083},"application_id":{"type":"integer","description":"id приложения DataDoc в маркетплейсе YCLIENTS","example":1234},"event":{"type":"string","enum":["uninstall","freeze"],"description":"Событие: uninstall — приложение удалено из филиала, freeze — приложение заморожено"},"partner_token":{"type":"string","description":"Партнёрский токен приложения в YCLIENTS","example":"abcd1234efgh5678"}}}}}},"responses":{"201":{"description":"Событие принято","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Всегда true"}}},"example":{"success":true}}}},"403":{"description":"application_id или partner_token не совпадают с настройками интеграции"}}}},"/yclients/record/{salonid}/{entityid}":{"get":{"tags":["YCLIENTS"],"summary":"Получить данные записи","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"salonid","description":"id филиала","required":true,"schema":{"type":"integer"}},{"in":"path","name":"entityid","description":"id записи","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Возвращаются данные записи","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"array","description":"Поля самой записи (дата, комментарий, дополнительные поля записи и т.п.)","items":{"$ref":"#/components/schemas/YClientsRecordElement"}},"client":{"type":"array","description":"Поля клиента (client.*), в т.ч. дополнительные поля клиента","items":{"$ref":"#/components/schemas/YClientsRecordElement"}},"comer":{"type":"array","description":"Поля посетителя записи (comer.*)","items":{"$ref":"#/components/schemas/YClientsRecordElement"}},"staff":{"type":"array","description":"Поля сотрудника, к которому запись (staff.*)","items":{"$ref":"#/components/schemas/YClientsRecordElement"}},"company":{"type":"array","description":"Поля филиала (company.*)","items":{"$ref":"#/components/schemas/YClientsRecordElement"}},"goods":{"description":"Товары записи","allOf":[{"$ref":"#/components/schemas/YClientsProduct"}]},"services":{"description":"Услуги записи","allOf":[{"$ref":"#/components/schemas/YClientsProduct"}]}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"description":"Филиал не подключён к рабочему пространству пользователя"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/yclients/products/sync":{"post":{"tags":["YCLIENTS"],"summary":"Синхронизировать товары и услуги с YCLIENTS","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"Возвращается отчет о результатах синхронизации","content":{"application/json":{"schema":{"type":"object","properties":{"goods":{"description":"Итог синхронизации товаров","allOf":[{"$ref":"#/components/schemas/ProductSyncCounts"}]},"services":{"description":"Итог синхронизации услуг","allOf":[{"$ref":"#/components/schemas/ProductSyncCounts"}]}}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/yclients/salons":{"get":{"tags":["YCLIENTS"],"summary":"FOR-2739: филиалы YClients рабочего пространства (владелец пространства или вход администратора «как пользователь»)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Список филиалов и лимит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsSalons"}}}},"403":{"description":"permission.onlyadmin — не владелец пространства"}}},"post":{"tags":["YCLIENTS"],"summary":"FOR-2739: добавить номер филиала YClients (подключение этого филиала из YClients попадёт в это пространство)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["salonId"],"properties":{"salonId":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Номер филиала YClients (строка из цифр тоже принимается)","example":1312090}}}}}},"responses":{"200":{"description":"Список после добавления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsSalons"}}}},"400":{"description":"yclients.salons.salonid.invalid — не целое число больше нуля; yclients.salons.alreadyexists — номер уже в этом или другом пространстве (другое не называется); yclients.salon.limit — лимит"},"403":{"description":"permission.onlyadmin — не владелец пространства"},"404":{"description":"yclients.salon.notfound — YClients не знает такой филиал"}}}},"/yclients/salons/{salonid}":{"delete":{"tags":["YCLIENTS"],"summary":"FOR-2739: убрать номер филиала из списка (интеграция в YClients не удаляется)","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"salonid","description":"Номер филиала YClients — целое число от 1","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Список после удаления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsSalons"}}}},"403":{"description":"permission.onlyadmin"},"404":{"description":"yclients.salon.notinworkspace — номера нет в списке"}}}},"/yclients/sync/{leadid}":{"get":{"tags":["YCLIENTS"],"summary":"Результат фоновой записи значений документа в карточку записи YClients","description":"После создания документа из виджета значения сопоставленных строгих переменных пишутся в запись YClients в фоне; результат хранится 10 минут. Нет сохранённого результата — status ok, written 0.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"leadid","required":true,"description":"id записи YClients, из которой создан документ","schema":{"type":"integer"},"example":518273645}],"responses":{"200":{"description":"Результат записи","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsSyncResult"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/yclients/mapping":{"get":{"tags":["YCLIENTS"],"summary":"Сопоставление строгих переменных полям YClients","description":"Только для рабочего пространства с подключёнными филиалами YClients, иначе 403.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Текущее сопоставление","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsMapping"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"К рабочему пространству не подключён ни один филиал YClients"}}},"put":{"tags":["YCLIENTS"],"summary":"Сохранить сопоставление строгих переменных полям YClients","description":"Заменяет сопоставление целиком (пустой fields — очистить). Переменная и поле не повторяются (yclients.mapping.strictattr.duplicate, yclients.mapping.field.duplicate), строгая переменная должна существовать (yclients.mapping.strictattr.notfound).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsMapping"},"example":{"fields":[{"strictattrId":"1024","fieldId":"client.phone"},{"strictattrId":"1031","fieldId":"custom_fields.passport"}]}}}},"responses":{"200":{"description":"Сохранённое сопоставление","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsMapping"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"К рабочему пространству не подключён ни один филиал YClients"}}}},"/yclients/writedocument":{"post":{"tags":["YCLIENTS"],"summary":"Записать значения сохранённого документа в карточку записи YClients (кнопка виджета)","description":"Пишет значения сопоставленных строгих переменных документа в запись и ждёт результата; по каждой переменной документа сообщает, записана она или почему нет. Сопоставление пустое — configured false, ничего не пишется. Филиал не передан — берётся единственный филиал пространства (несколько — yclients.salonid.empty).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["renderId","yclientsLeadId"],"properties":{"renderId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"id сохранённого документа (рендера)","example":"62bb25949213f16bcd934422"},"yclientsLeadId":{"type":"integer","minimum":1,"description":"id записи YClients, в которую пишутся значения","example":518273645},"yclientsSalonId":{"type":"integer","minimum":1,"description":"Номер филиала YClients записи; не передан — единственный филиал пространства","example":1312083}}}}}},"responses":{"200":{"description":"Что записано и что нет","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean","description":"false — сопоставление полей не настроено, ничего не записано","example":true},"written":{"type":"array","description":"Записанные переменные","items":{"$ref":"#/components/schemas/YClientsWrittenVariable"}},"notWritten":{"type":"array","description":"Незаписанные переменные с причиной","items":{"$ref":"#/components/schemas/YClientsNotWrittenVariable"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Филиал не подключён к рабочему пространству, или документ скрыт от пользователя"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/yclients/fields":{"get":{"tags":["YCLIENTS"],"summary":"Поля карточки записи YClients, доступные для сопоставления","description":"Комментарий записи, стандартные поля клиента и видимые дополнительные поля записи и клиента всех филиалов пространства. С salonId и leadId к полям добавляются текущие значения этой записи (YClients не ответил — поля без значений).","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"salonId","description":"Номер филиала YClients записи виджета (вместе с leadId)","schema":{"type":"integer","minimum":1},"example":1312083},{"in":"query","name":"leadId","description":"id записи YClients виджета (вместе с salonId) — для текущих значений полей","schema":{"type":"integer","minimum":1},"example":518273645}],"responses":{"200":{"description":"Список полей","content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","description":"Поля, доступные для записи","items":{"$ref":"#/components/schemas/YClientsField"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет подключённых филиалов YClients или филиал salonId не из этого пространства"}}}},"/yadisk":{"get":{"tags":["Настройки воркспейса"],"summary":"Настройки копий ПЭП на Яндекс Диске","description":"После подписания ПЭП (СМС, MAX, «Сигнатура») подписанный PDF в фоне выгружается в папку воркспейса на Яндекс Диске. Читают все пользователи воркспейса; секреты (Client secret, токены) не возвращаются.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YaDiskSettings"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Настройки воркспейса"],"summary":"Сохранить настройки Яндекс Диска","description":"Только администраторы воркспейса (иначе 403) и только когда функция доступна (иначе 400). Для каждого поля: строка — задать значение, null — удалить, не передано — не менять. Смена ClientID сбрасывает подключение (токены другого приложения недействительны). Лишние поля не принимаются.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"clientId":{"type":"string","nullable":true,"maxLength":100,"description":"ClientID приложения Яндекс OAuth; null или пустая строка — удалить","example":"0a1b2c3d4e5f60718293a4b5c6d7e8f9"},"clientSecret":{"type":"string","nullable":true,"maxLength":200,"description":"Client secret приложения (хранится зашифрованным); null или пустая строка — удалить","example":"f9e8d7c6b5a4938271605f4e3d2c1b0a"},"folder":{"type":"string","nullable":true,"maxLength":500,"description":"Путь папки на диске, например /DataDoc/ПЭП; запрещены символы \\ : * ? \" < > |; null или пустая строка — удалить","example":"/DataDoc/ПЭП"},"enabled":{"type":"boolean","description":"Включить или выключить выгрузку копий","example":true}}}}}},"responses":{"200":{"description":"Настройки после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YaDiskSettings"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Пользователь не администратор воркспейса"}}}},"/yadisk/connect":{"post":{"tags":["Настройки воркспейса"],"summary":"Подключить Яндекс Диск по коду подтверждения","description":"Код подтверждения, который Яндекс показал после входа по authorizeUrl, обменивается на токены доступа (хранятся зашифрованными), запоминается логин аккаунта. Нужны сохранённые ClientID и Client secret (иначе 400). Ошибка Яндекса возвращается текстом в 400. Только администраторы воркспейса.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code"],"properties":{"code":{"type":"string","minLength":1,"maxLength":100,"description":"Код подтверждения от Яндекса (пробелы по краям убираются)","example":"1234567"}}}}}},"responses":{"200":{"description":"Настройки после подключения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YaDiskSettings"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Пользователь не администратор воркспейса"}}},"delete":{"tags":["Настройки воркспейса"],"summary":"Отключить Яндекс Диск","description":"Удаляются токены, логин и дата подключения; ClientID, Client secret и папка остаются. Только администраторы воркспейса.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки после отключения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YaDiskSettings"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Пользователь не администратор воркспейса"}}}},"/xlsximporter/counteragents":{"post":{"tags":["Массовые операции из файла Excel"],"summary":"Импорт контргентов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для импорта","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"counteragentsType":{"$ref":"#/components/schemas/CounteragentType"},"attrColumns":{"type":"array","description":"Соответствие колонок и атрибутов контрагента","items":{"type":"integer"},"example":[304,301,306]},"data":{"type":"string","description":"Файл в формате Excel в кодировке base64","example":"UEsDBBQABgAIAAAAIQB..."}}}}}},"responses":{"200":{"description":"Возвращается результат импорта","content":{"application/json":{"schema":{"type":"object","properties":{"successCount":{"type":"integer","description":"Число успешно загруженных записей","example":1},"rejectCount":{"type":"integer","description":"Число незагруженных записей","example":1},"messages":{"type":"array","description":"Сообщения о результатах загрузки","items":{"type":"string"},"example":["Контрагент c id 62dd09d1574b07892e14bc92 добавлен","Ошибка в строке 1: Переменная с кодом 3011 не найдена"]}}}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces":{"get":{"tags":["Рабочие пространства"],"summary":"Получить данные рабочих пространств","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"key","description":"Ключ query-запроса при регистрации (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"value","description":"Значение query-запроса при регистрации (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"login","description":"Логин владельца воркспейса (поиск по регулярному выражению)","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращаются данные рабочих пространств","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"owner":{"type":"object","description":"Владелец воркспейса (основной пользователь)","properties":{"id":{"type":"string","description":"id пользователя-владельца","example":"62bb25949213f16bcd934422"},"login":{"type":"string","description":"Логин владельца","example":"vm@datadoc.ru"},"phone":{"type":"string","description":"Телефон владельца","example":"+79991050107"},"name":{"type":"string","description":"Имя владельца","example":"Иванов Иван"}}},"createdAt":{"type":"string","description":"Дата создания рабочего пространства","example":"2022-07-24T09:35:53.057+00:00"},"usersCount":{"type":"integer","description":"Количество пользователей","example":1},"templatesCount":{"type":"integer","description":"Количество шаблонов","example":1},"packsCount":{"type":"integer","description":"Количество пакетов шаблонов","example":1},"registerQuery":{"$ref":"#/components/schemas/RegisterQuery"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/token":{"post":{"tags":["Рабочие пространства"],"summary":"Создать токен для доступа к рабочему пространству","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные рабочего пространства","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"wid":{"type":"string","description":"id воркспейса","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}":{"delete":{"tags":["Рабочие пространства"],"summary":"Удалить все данные рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id воркспейса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/amocrmid":{"put":{"tags":["Рабочие пространства"],"summary":"Обновить id лида amoCRM для рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Новый id лида amoCRM","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amocrmId":{"type":"integer","description":"Новый id лида amoCRM","example":25933577}}}}}},"responses":{"200":{"description":"Возвращается id воркспейса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/login":{"put":{"tags":["Рабочие пространства"],"summary":"Обновить логин владельца рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Новый логин","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Новый логин","example":"user@example.ru"}}}}}},"responses":{"200":{"description":"Возвращается id воркспейса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/signaturelimit/increase":{"put":{"tags":["Рабочие пространства"],"summary":"Увеличить лимит документов с ПЭП и УКЭП","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"На сколько увеличить лимит документов с ПЭП и УКЭП","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"increase":{"type":"integer","description":"На сколько увеличить лимит документов с ПЭП и УКЭП","example":20}}}}}},"responses":{"200":{"description":"Возвращается новый лимит документов с ПЭП и УКЭП","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/SignatureLimits"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/signaturerequests":{"get":{"tags":["Рабочие пространства"],"summary":"Получить список запросов на покупку ПЭП и УКЭП рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются запросы на покупку ПЭП и УКЭП","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SignatureRequest"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/signaturerequests/{requestid}/pay":{"put":{"tags":["Рабочие пространства"],"summary":"Оплатить ПЭП и УКЭП по id запроса на покупку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"requestid","required":true,"description":"id запроса","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается новый лимит документов с ПЭП и УКЭП","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/SignatureLimits"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/signpacks/{kind}/requests":{"get":{"tags":["Рабочие пространства"],"summary":"Получить заявки воркспейса на пакеты подписей канала","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"kind","required":true,"description":"Вид пакета — draw (Сигнатура, в том числе планшет DataDoc SIGN) или max (мессенджер MAX)","schema":{"type":"string","enum":["draw","max"]}}],"responses":{"200":{"description":"Заявки на пакеты","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"6731a6c2e1f0b2a4c8d9e011"},"kind":{"type":"string","enum":["draw","max"]},"limit":{"type":"integer","example":200},"price":{"type":"number","example":1900},"paidAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/signpacks/{kind}/requests/{requestid}/pay":{"put":{"tags":["Рабочие пространства"],"summary":"Отметить заявку на пакет подписей оплаченной (пакет пополняется)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"kind","required":true,"description":"Вид пакета — draw (Сигнатура, в том числе планшет DataDoc SIGN) или max (мессенджер MAX)","schema":{"type":"string","enum":["draw","max"]}},{"in":"path","name":"requestid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Новый остаток пакета","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["draw","max"]},"used":{"type":"integer"},"available":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/signpacks/{kind}/limit/increase":{"put":{"tags":["Рабочие пространства"],"summary":"Начислить подписи в пакет канала","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"kind","required":true,"description":"Вид пакета — draw (Сигнатура, в том числе планшет DataDoc SIGN) или max (мессенджер MAX)","schema":{"type":"string","enum":["draw","max"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"increase":{"type":"integer","example":100}}}}}},"responses":{"200":{"description":"Новый остаток пакета"},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/ocrlimit/increase":{"put":{"tags":["Рабочие пространства"],"summary":"Увеличить лимит распознаваний документов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"На сколько увеличить лимит распознаваний документов","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"increase":{"type":"integer","description":"На сколько увеличить лимит распознаваний документов","example":20}}}}}},"responses":{"200":{"description":"Возвращается новый лимит распознаваний документов","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/OcrLimits"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/ocrrequests":{"get":{"tags":["Рабочие пространства"],"summary":"Получить список запросов на покупку распознаваний документов рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются запросы на покупку распознаваний документов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OcrRequest"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/ocrrequests/{requestid}/pay":{"put":{"tags":["Рабочие пространства"],"summary":"Оплатить распознавания документов по id запроса на покупку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"requestid","required":true,"description":"id запроса","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается новый лимит распознаваний документов","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/OcrLimits"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/docslimit/increase":{"put":{"tags":["Рабочие пространства"],"summary":"Увеличить лимит доксов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"На сколько увеличить лимит доксов","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"increase":{"type":"integer","description":"На сколько увеличить лимит доксов","example":20}}}}}},"responses":{"200":{"description":"Возвращается новый лимит доксов","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/DocsLimits"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/docsrequests":{"get":{"tags":["Рабочие пространства"],"summary":"Получить список запросов на покупку доксов рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются запросы на покупку доксов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocsRequest"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/docsrequests/{requestid}/pay":{"put":{"tags":["Рабочие пространства"],"summary":"Оплатить доксы по id запроса на покупку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"requestid","required":true,"description":"id запроса","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается новый лимит доксов","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/DocsLimits"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/yclientssalons":{"get":{"tags":["Workspaces"],"summary":"FOR-2739 (администратор сервиса): филиалы YClients пространства и журнал изменений (последние 200)","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id рабочего пространства","schema":{"type":"string"}}],"responses":{"200":{"description":"{ salons, limit, log: [{ wid, salonId, action: add|remove, source: lk|admin|activate|uninstall, uid, byAdminAccess, createdAt }] }"}}},"post":{"tags":["Workspaces"],"summary":"FOR-2739 (администратор сервиса): добавить номер филиала YClients в пространство","description":"Номер не должен быть уже в этом или другом пространстве; количество ограничено настройкой сервиса yclients.maxSalonsPerWorkspace. Изменение пишется в журнал с источником admin.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id рабочего пространства","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["salonId"],"properties":{"salonId":{"type":"integer","minimum":1,"description":"Номер (id) филиала YClients — целое число больше нуля","example":1312090}}}}}},"responses":{"200":{"description":"Список после добавления (ошибки — как у POST /yclients/salons)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsSalons"}}}}}}},"/workspaces/{id}/yclientssalons/{salonid}":{"delete":{"tags":["Workspaces"],"summary":"FOR-2739 (администратор сервиса): убрать номер филиала из пространства","description":"Убирается только из списка пространства, интеграция в самом YClients не отключается. Изменение пишется в журнал с источником admin.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id рабочего пространства","schema":{"type":"string"}},{"in":"path","name":"salonid","required":true,"description":"Номер (id) филиала YClients","schema":{"type":"integer"}}],"responses":{"200":{"description":"Список после удаления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YClientsSalons"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/accounttype":{"put":{"tags":["Рабочие пространства"],"summary":"Сменить тип аккаунта владельца рабочего пространства (обычный клиент или роль админки)","description":"Только администратор сервиса с ролью COMMON_ADMIN (иначе 403). USER — обычный клиент (запись администратора по логину владельца удаляется), TEMPLATE_OPERATOR, SALES_MANAGER, COMMON_ADMIN — владелец получает эту роль в админке. Последнего COMMON_ADMIN понизить нельзя (400).\n","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accountType"],"properties":{"accountType":{"type":"string","enum":["USER","TEMPLATE_OPERATOR","SALES_MANAGER","COMMON_ADMIN"],"description":"Новый тип — USER (обычный клиент), TEMPLATE_OPERATOR (оператор шаблонов), SALES_MANAGER (менеджер продаж), COMMON_ADMIN (администратор сервиса)","example":"SALES_MANAGER"}}}}}},"responses":{"200":{"description":"Сохранённый тип","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"accountType":{"type":"string","description":"Установленный тип аккаунта","example":"SALES_MANAGER"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/recruiter":{"put":{"tags":["Рабочие пространства"],"summary":"Включить или выключить свойство «Рекрутер» (партнёрская программа)","description":"При включении рабочему пространству выдаётся партнёрский промокод (если его ещё нет). Выключение промокод не удаляет.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["isRecruiter"],"properties":{"isRecruiter":{"type":"boolean","description":"true — рабочее пространство участвует в партнёрской программе как рекрутер","example":true}}}}}},"responses":{"200":{"description":"Новое значение свойства","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"isRecruiter":{"type":"boolean","description":"Новое значение свойства","example":true},"recruiterPromocode":{"type":"string","description":"Код партнёрского промокода (только при включении)","example":"PRT934422"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/recruiterpromocode":{"post":{"tags":["Рабочие пространства"],"summary":"Выдать партнёрский промокод рекрутеру","description":"Идемпотентно: 201 — промокод создан, 200 — у рекрутера промокод уже был (тело запроса тогда не учитывается). Код вида PRT + последние 6 символов id рабочего пространства. Нужно включённое свойство «Рекрутер» (иначе 400).\n","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"discountPercent":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Скидка по промокоду, %","example":10}}}}}},"responses":{"200":{"description":"Промокод уже был","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecruiterPromocode"}}}},"201":{"description":"Промокод создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecruiterPromocode"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"get":{"tags":["Рабочие пространства"],"summary":"Получить партнёрский промокод рекрутера","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Партнёрский промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecruiterPromocode"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Нет рабочего пространства или промокод ещё не выдан"}}}},"/workspaces/{id}/recruiter-promocode":{"post":{"tags":["Рабочие пространства"],"summary":"Выдать партнёрский промокод рекрутеру (устаревший путь, используйте POST /workspaces/{id}/recruiterpromocode)","description":"То же, что POST /workspaces/{id}/recruiterpromocode. Путь оставлен до перехода клиентов на новый и будет удалён.","deprecated":true,"security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"discountPercent":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Скидка по промокоду, %","example":10}}}}}},"responses":{"200":{"description":"Промокод уже был","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecruiterPromocode"}}}},"201":{"description":"Промокод создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecruiterPromocode"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"get":{"tags":["Рабочие пространства"],"summary":"Получить партнёрский промокод рекрутера (устаревший путь, используйте GET /workspaces/{id}/recruiterpromocode)","description":"То же, что GET /workspaces/{id}/recruiterpromocode. Путь оставлен до перехода клиентов на новый и будет удалён.","deprecated":true,"security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Партнёрский промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecruiterPromocode"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Нет рабочего пространства или промокод ещё не выдан"}}}},"/workspaces/{id}/approvals":{"put":{"tags":["Рабочие пространства"],"summary":"Включить или выключить сервис «Согласования» для рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["approvalsEnabled"],"properties":{"approvalsEnabled":{"type":"boolean","description":"true — сервис «Согласования» доступен рабочему пространству","example":true}}}}}},"responses":{"200":{"description":"Новое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"approvalsEnabled":{"type":"boolean","description":"Новое значение","example":true}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/crmservice":{"put":{"tags":["Рабочие пространства"],"summary":"Включить или выключить сервис «Таск-менеджер» (пункт меню ЛК) для рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["crmServiceEnabled"],"properties":{"crmServiceEnabled":{"type":"boolean","description":"true — сервис доступен рабочему пространству","example":true}}}}}},"responses":{"200":{"description":"Новое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"crmServiceEnabled":{"type":"boolean","description":"Новое значение","example":true}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/apikey":{"get":{"tags":["Рабочие пространства"],"summary":"Счётчики и лимит запросов клиента по API-ключу","description":"Сутки считаются по московскому времени, счётчик дня сбрасывается в 00:00 МСК.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Счётчики и настройки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyUsage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Рабочие пространства"],"summary":"Включить или выключить доступ по API-ключу и задать суточный лимит запросов","description":"Поля необязательны, непереданное не меняется. По умолчанию доступ включён, лимит — из настройки сервиса apikey.dailyLimit (10000). Запросы сверх лимита получают 429, при выключенном доступе — 403.\n","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true — доступ по API-ключу разрешён, false — запрещён","example":true},"dailyLimit":{"type":"integer","minimum":0,"maximum":100000000,"description":"Запросов в сутки для этого рабочего пространства (0 — все запросы отклоняются)","example":10000}}}}}},"responses":{"200":{"description":"Счётчики и настройки после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyUsage"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/apikey/log":{"get":{"tags":["Рабочие пространства"],"summary":"Журнал запросов клиента по API-ключу","description":"Последние записи, новые первыми (не больше 1000; у каждого пользователя хранятся последние 1000). Секретные параметры адреса (key, token, secret, pass и т.п.) замаскированы ***.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"query","name":"uid","description":"id пользователя — только его запросы; не передан — запросы всего рабочего пространства","schema":{"type":"string","example":"62bb25949213f16bcd934423"}}],"responses":{"200":{"description":"Записи журнала","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyLogRecord"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/workspaces/{id}/signmax":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство рабочего пространства «Подписание через MAX»","description":"default — как в общей настройке сервиса messengers.max.signEnabled (по умолчанию выключена), enabled / disabled — явно для рабочего пространства.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signMaxAccess"],"properties":{"signMaxAccess":{"type":"string","enum":["default","enabled","disabled"],"description":"default — по общей настройке, enabled — включено, disabled — выключено","example":"enabled"}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"signMaxAccess":{"type":"string","description":"Сохранённое значение","example":"enabled"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/signdraw":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство рабочего пространства «Подписание сигнатурой (рисунком)»","description":"default — как в общей настройке сервиса signature.draw.enabled (по умолчанию выключена), enabled / disabled — явно для рабочего пространства.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signDrawAccess"],"properties":{"signDrawAccess":{"type":"string","enum":["default","enabled","disabled"],"description":"default — по общей настройке, enabled — включено, disabled — выключено","example":"enabled"}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"signDrawAccess":{"type":"string","description":"Сохранённое значение","example":"enabled"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/signcabinetfree":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство рабочего пространства «Не списывать подписи лёгкого аккаунта»","description":"Подписи в кабинете подписанта (лёгкий аккаунт) не списываются с пакета рабочего пространства. false снимает свойство.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signCabinetFree"],"properties":{"signCabinetFree":{"type":"boolean","description":"true — подписи кабинета подписанта бесплатны для рабочего пространства","example":true}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"signCabinetFree":{"type":"boolean","description":"Сохранённое значение","example":true}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/signcabinet":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство рабочего пространства «Подписание в кабинете подписанта»","description":"default — как в общей настройке сервиса signature.cabinet.enabled (по умолчанию выключена), enabled / disabled — явно для рабочего пространства.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signCabinetAccess"],"properties":{"signCabinetAccess":{"type":"string","enum":["default","enabled","disabled"],"description":"default — по общей настройке, enabled — включено, disabled — выключено","example":"enabled"}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"signCabinetAccess":{"type":"string","description":"Сохранённое значение","example":"enabled"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/signtablet":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство рабочего пространства «DataDoc SIGN» (подписание на планшете)","description":"default — как в общей настройке сервиса signature.tablet.enabled (по умолчанию выключена), enabled / disabled — явно для рабочего пространства.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signTabletAccess"],"properties":{"signTabletAccess":{"type":"string","enum":["default","enabled","disabled"],"description":"default — по общей настройке, enabled — включено, disabled — выключено","example":"enabled"}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"signTabletAccess":{"type":"string","description":"Сохранённое значение","example":"enabled"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/yadisk":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство рабочего пространства «Копии подписанных ПЭП на Яндекс Диске»","description":"default — как в общей настройке сервиса signature.yadisk.enabled (по умолчанию выключена), enabled / disabled — явно для рабочего пространства.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["yaDiskAccess"],"properties":{"yaDiskAccess":{"type":"string","enum":["default","enabled","disabled"],"description":"default — по общей настройке, enabled — включено, disabled — выключено","example":"enabled"}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"yaDiskAccess":{"type":"string","description":"Сохранённое значение","example":"enabled"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/workspaces/{id}/storagepacks":{"get":{"tags":["Рабочие пространства"],"summary":"Получить пакеты Хранилища рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Пакеты, новые сверху","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StoragePack"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Только администратор сервиса"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/storagepacks/{packid}/pay":{"put":{"tags":["Рабочие пространства"],"summary":"Отметить пакет Хранилища оплаченным","description":"Как у пакетов ПЭП — ручная отметка оплаты; счёт 1С пакета получает отметку «активировано». Оплата включает раздел «Хранилище».","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"packid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Оплаченный пакет","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePack"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Только администратор сервиса"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace":{"get":{"tags":["Рабочее пространство"],"summary":"Получить данные своего рабочего пространства","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются данные рабочего пространства","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Рабочее пространство"],"summary":"Обновить данные своего рабочего пространства","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные пространства","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"createCounteragentsAtRender":{"type":"boolean","description":"Создавать контрагентов при рендере","example":true},"goals":{"type":"string","description":"Цели","example":"У самурая нет цели"},"areasOfActivityId":{"type":"string","description":"id сферы деятельности","example":"667179d87bc1c9e1a836574e"},"partnershipModalShownAt":{"type":"array","description":"Даты показа модального окна партнёрской программы","example":["2023-11-22T10:17:33.622Z"],"items":{"type":"string","description":"Дата показа модального окна партнерской программы","example":"2023-11-22T10:17:33.622Z"}},"licenseAcceptedAt":{"type":"string","description":"Дата принятия лицензионного соглашения","example":"2023-11-22T10:17:33.622Z"},"isBlocked":{"type":"boolean","description":"Флаг блокировки воркспейса","example":true},"timeslotSkipped":{"type":"boolean","description":"Флаг пропуска записи на демо","example":true}}}}}},"responses":{"200":{"description":"Возвращаются данные рабочего пространства","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/register":{"put":{"tags":["Рабочее пространство"],"summary":"Записать данные регистрации рабочего пространства","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные регистрации","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"ФИО пользователя","example":"Иванов Петр Михайлович"},"phone":{"type":"string","description":"Телефон","example":79101234567},"companyname":{"type":"string","description":"Название компании","example":"ООО Петямба"},"inn":{"type":"string","description":"ИНН","example":1234567890},"goals":{"type":"string","description":"Цели","example":"У самурая нет цели"},"okved":{"type":"string","description":"ОКВЭД","example":68.31},"kpp":{"type":"string","description":"КПП","example":123456789},"ogrn":{"type":"string","description":"ОГРН","example":1234567890123},"address":{"type":"string","description":"Юридический адрес","example":"101001, г. Москва, ул. Рябиновая, д. 1"},"crm":{"$ref":"#/components/schemas/CrmTypeWithYClients"},"crmUsersCount":{"type":"integer","description":"Количество пользователей CRM","example":5},"note":{"type":"string","description":"Примечание","example":"Примечание"},"leadSource":{"type":"string","description":"Источник лида","example":"Рекомендация"},"registerQuery":{"$ref":"#/components/schemas/RegisterQuery"}}}}}},"responses":{"200":{"description":"Возвращаются данные регистрации рабочего пространства","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/phone":{"put":{"tags":["Рабочее пространство"],"summary":"Сменить номер телефона владельца рабочего пространства","security":[{"BearerAuth":[]}],"requestBody":{"description":"Новый номер телефона","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","description":"Новый номер телефона","example":79121324567}}}}}},"responses":{"200":{"description":"Статус подтверждения номера телефона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneConfirmation"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/phone/verify":{"put":{"tags":["Рабочее пространство"],"summary":"Подтвердить номер телефона владельца рабочего пространства","security":[{"BearerAuth":[]}],"requestBody":{"description":"Код подтвердения из СМС","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"Код подтверждения","example":12345}}}}}},"responses":{"200":{"description":"Статус подтверждения номера телефона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneConfirmation"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/edousers":{"post":{"tags":["Рабочее пространство"],"summary":"Зарегистрировать пользователя системы ЭДО","security":[{"BearerAuth":[]}],"requestBody":{"description":"Информация о пользователе системы ЭДО","required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["entity"],"description":"Тип контрагента","example":"entity"},"name":{"type":"string","description":"Название","example":"ООО Умные документы"},"inn":{"type":"string","description":"ИНН","example":123456789012},"kpp":{"type":"string","description":"КПП","example":123456789}}},{"type":"object","properties":{"type":{"type":"string","enum":["person","individual"],"description":"Тип контрагента","example":"individual"},"name":{"type":"string","description":"Название","example":"ИП Иванов Иван Иванович"},"inn":{"type":"string","description":"ИНН","example":1234567890}}}]},"examples":{"Юрлицо":{"value":{"type":"entity","name":"ООО Умные документы","inn":"1234567890","kpp":"123456789"}},"Физлицо или ИП":{"value":{"type":"individual","name":"ИП Иванов Иван Иванович","inn":"123456789012"}}}}}},"responses":{"201":{"description":"Возвращается ИНН","content":{"application/json":{"schema":{"type":"object","properties":{"inn":{"type":"string","description":"ИНН","example":1234567890}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/signaturerequests":{"post":{"tags":["Рабочее пространство"],"summary":"Создать запрос на покупку документов с ПЭП и УКЭП","security":[{"BearerAuth":[]}],"requestBody":{"description":"Желаемое количество документов с ПЭП и УКЭП","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","description":"Желаемое количество документов с ПЭП и УКЭП","example":30},"price":{"type":"number","description":"Цена пакета ПЭП и УКЭП (только для администраторов)","example":1000}}}}}},"responses":{"201":{"description":"Возвращается запрос на покупку документов с ПЭП и УКЭП","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/signaturetariffs":{"get":{"tags":["Рабочее пространство"],"summary":"Получить список тарифов для покупки документов с ПЭП и УКЭП","responses":{"200":{"description":"Возвращается список тарифов для покупки документов с ПЭП и УКЭП","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"lowerBoundary":{"type":"integer","description":"Нижняя граница лимита","example":5000},"discount":{"type":"integer","description":"Скидка","example":10},"priceForOne":{"type":"number","description":"Цена одного документа с ПЭП или УКЭП с учетом скидки","example":28.5}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/signaturetariffs/price":{"get":{"tags":["Рабочее пространство"],"summary":"Получить цену лимита документов с ПЭП и УКЭП","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"limit","required":true,"description":"Количество документов с ПЭП и УКЭП","example":100,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Возвращается цена документов с ПЭП и УКЭП","content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"number","description":"Цена лимита","example":300}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/signpacks/{kind}/tariffs":{"get":{"tags":["Рабочее пространство"],"summary":"Получить ступени скидок пакета подписей канала (Сигнатура или MAX)","description":"Пакет доступен, только если канал включён воркспейсу (свойство воркспейса в админке или общая настройка сервиса), иначе 400.\nЦена одной подписи — настройка сервиса «Стоимость услуг» (по умолчанию 10 руб.), скидки за объём — как у обычных ПЭП.\n","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"kind","required":true,"description":"Вид пакета — draw (Сигнатура, в том числе планшет DataDoc SIGN) или max (мессенджер MAX)","schema":{"type":"string","enum":["draw","max"]}}],"responses":{"200":{"description":"Ступени от меньшей к большей","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"lowerBoundary":{"type":"integer","example":100},"discount":{"type":"number","description":"Скидка, %","example":5},"priceForOne":{"type":"number","description":"Цена одной подписи со скидкой, руб.","example":9.5}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/signpacks/{kind}/price":{"get":{"tags":["Рабочее пространство"],"summary":"Получить цену пакета подписей канала","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"kind","required":true,"description":"Вид пакета — draw (Сигнатура, в том числе планшет DataDoc SIGN) или max (мессенджер MAX)","schema":{"type":"string","enum":["draw","max"]}},{"in":"query","name":"limit","required":true,"description":"Количество подписей","example":200,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Цена пакета со скидкой за объём","content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"number","example":1900}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/signpacks/{kind}/requests":{"post":{"tags":["Рабочее пространство"],"summary":"Создать заявку на пакет подписей канала","description":"Счёт выставляется методом POST /accounting/documents/invoice (source signDrawRequest или signMaxRequest); оплата из 1С пополняет пакет автоматически.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"kind","required":true,"description":"Вид пакета — draw (Сигнатура, в том числе планшет DataDoc SIGN) или max (мессенджер MAX)","schema":{"type":"string","enum":["draw","max"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["limit"],"properties":{"limit":{"type":"integer","example":200},"price":{"type":"number","description":"Своя цена — только администратор сервиса"}}}}}},"responses":{"201":{"description":"Заявка создана","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"6731a6c2e1f0b2a4c8d9e011"},"kind":{"type":"string","enum":["draw","max"]},"limit":{"type":"integer","example":200},"price":{"type":"number","example":1900},"paidAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/ocrrequests":{"post":{"tags":["Рабочее пространство"],"summary":"Создать запрос на покупку распознаваний документов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Желаемое количество распознаваний документов","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","description":"Желаемое количество распознаваний документов","example":30},"price":{"type":"number","description":"Цена пакета распознаваний документов (только для администраторов)","example":1000}}}}}},"responses":{"201":{"description":"Возвращается запрос на покупку распознаваний документов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/ocrtariffs":{"get":{"tags":["Рабочее пространство"],"summary":"Получить список тарифов распознаваний документов","responses":{"200":{"description":"Возвращается список тарифов распознаваний документов","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"lowerBoundary":{"type":"integer","description":"Нижняя граница лимита","example":5000},"discount":{"type":"integer","description":"Скидка","example":10},"priceForOne":{"type":"number","description":"Цена одного распознавания документа с учетом скидки","example":28.5}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/ocrtariffs/price":{"get":{"tags":["Рабочее пространство"],"summary":"Получить цену лимита распознаваний документов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"limit","required":true,"description":"Количество распознаваний документов","example":100,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Возвращается цена распознаваний документов","content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"number","description":"Цена лимита","example":300}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/docsrequests":{"post":{"tags":["Рабочее пространство"],"summary":"Создать запрос на покупку доксов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Желаемое количество доксов","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","description":"Желаемое количество доксов","example":30},"price":{"type":"number","description":"Цена пакета доксов (только для администраторов)","example":1000}}}}}},"responses":{"201":{"description":"Возвращается запрос на покупку доксов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocsRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/docstariffs":{"get":{"tags":["Рабочее пространство"],"summary":"Получить список тарифов на покупку доксов","responses":{"200":{"description":"Возвращается список тарифов на покупку доксов","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"lowerBoundary":{"type":"integer","description":"Нижняя граница лимита","example":5000},"discount":{"type":"integer","description":"Скидка","example":10},"priceForOne":{"type":"number","description":"Цена одного докса с учетом скидки","example":28.5}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/docstariffs/price":{"get":{"tags":["Рабочее пространство"],"summary":"Получить цену лимита доксов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"limit","required":true,"description":"Количество доксов; не меньше нижней границы первого тарифа из GET /workspace/docstariffs (lowerBoundary), иначе 404","example":1000,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Возвращается цена доксов","content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"number","description":"Цена лимита","example":300}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/recruiter/referrals":{"get":{"tags":["Рабочее пространство"],"summary":"Рефералы рекрутера (партнёрская программа)","description":"Клиенты, применившие партнёрский промокод рабочего пространства из токена; чужих рефералов получить нельзя. Если у рабочего пространства не включено свойство «Рекрутер» — 403. Новые первыми (по дате первого применения промокода).\n","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"limit","description":"Сколько записей вернуть (по умолчанию 50, больше 200 не отдаётся)","schema":{"type":"integer","minimum":1,"default":50,"example":50}},{"in":"query","name":"offset","description":"Сколько записей пропустить","schema":{"type":"integer","minimum":0,"default":0,"example":0}},{"in":"query","name":"registeredFrom","description":"Регистрация рабочего пространства не раньше этой даты (ISO-дата или дата-время)","schema":{"type":"string","example":"2026-10-01"}},{"in":"query","name":"registeredTo","description":"Регистрация рабочего пространства не позже этой даты (ISO-дата или дата-время)","schema":{"type":"string","example":"2026-10-31T23:59:59Z"}}],"responses":{"200":{"description":"Страница рефералов","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","description":"Всего рефералов под фильтр","example":12},"limit":{"type":"integer","description":"Применённый размер страницы","example":50},"offset":{"type":"integer","description":"Применённое смещение","example":0},"items":{"type":"array","description":"Рефералы страницы","items":{"$ref":"#/components/schemas/RecruiterReferral"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"У рабочего пространства не включено свойство «Рекрутер»"}}}},"/workspace/recruiter/referrals/{wid}":{"get":{"tags":["Рабочее пространство"],"summary":"Карточка реферала рекрутера","description":"Данные реферала из списка плюс счета, попытки оплаты картой, платежи и счётчики использования. Только реферал своего партнёрского промокода.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"wid","required":true,"description":"id рабочего пространства реферала (24 шестнадцатеричных символа)","schema":{"type":"string","example":"62bb25949213f16bcd934424"}}],"responses":{"200":{"description":"Карточка реферала","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RecruiterReferral"},{"$ref":"#/components/schemas/RecruiterReferralDetails"}]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"У рабочего пространства не включено свойство «Рекрутер»"},"404":{"description":"Рабочее пространство не применяло промокод этого рекрутера"}}}},"/workspace/storagepacks/prices":{"get":{"tags":["Рабочее пространство"],"summary":"Получить сроки и цены пакета Хранилища на объём","description":"Цена — настройка «Стоимость услуг» «Цена за 1 ГБ Хранилища» (руб. за 1 ГБ на 30 дней).\nСроки по месяцам и скидки — варианты текущего тарифа рабочего пространства (сроки кратны 30 дням), если их нет — варианты всех тарифов.\n«До конца тарифа» (period tariffend) — только при оплаченном действующем тарифе (не пробном): оставшиеся дни × цена / 30 со скидкой текущего периода тарифа (как у докупки пользователей).\nЦена округляется вверх до рубля.\n","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"gb","required":true,"description":"Объём, целое число ГБ от 1 до 99","example":2,"schema":{"type":"integer","minimum":1,"maximum":99}}],"responses":{"200":{"description":"Цена за 1 ГБ и варианты сроков с ценой","content":{"application/json":{"schema":{"type":"object","properties":{"priceForGb":{"type":"number","example":100},"options":{"type":"array","items":{"$ref":"#/components/schemas/StoragePackOption"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspace/storagepacks":{"get":{"tags":["Рабочее пространство"],"summary":"Получить пакеты Хранилища рабочего пространства","description":"Новые сверху; active — пакет оплачен и действует сейчас (его объём входит в лимит).","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Пакеты","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StoragePack"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Рабочее пространство"],"summary":"Создать заявку на пакет Хранилища","description":"Счёт — POST /accounting/documents/invoice (source storagePack), оплата картой — POST /acquiring (source storagePack).\nОплаченный пакет добавляет объём к лимиту с даты начала по дату окончания; лимит, заданный администратором, не меняется.\nПакет по месяцам, оплаченный позже дня заявки, начинается в день оплаты (срок сохраняется).\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["gb","period"],"properties":{"gb":{"type":"integer","minimum":1,"maximum":99,"example":2},"period":{"type":"string","enum":["months","tariffend"],"description":"months — срок из вариантов тарифа (duration), tariffend — до конца текущего оплаченного периода тарифа"},"duration":{"type":"integer","description":"Срок в днях для months (30, 90, 360 …)","example":90}}}}}},"responses":{"201":{"description":"Заявка создана","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePack"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/whitelabel":{"get":{"tags":["White Label"],"summary":"Настройки внешнего вида рабочего пространства","description":"enabled - режим включён администратором сервиса, editable - пользователь может менять (группа администраторов рабочего пространства), spec - допустимые цвета и размеры логотипов (ширина и высота, до которых обрезается картинка).","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Сохранённое оформление и описание","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Режим White Label включён администратором сервиса","example":true},"editable":{"type":"boolean","description":"Текущий пользователь может менять оформление (режим включён и пользователь в группе администраторов рабочего пространства)","example":true},"colors":{"type":"object","description":"Сохранённые основные цвета (hex) по ключам primary, accent, background, text, success, attention, warning, error; незаданных ключей нет","example":{"primary":"#aa3300"}},"logos":{"type":"object","description":"Адреса загруженных логотипов по ключам logo, logoSmall, logoWhite, favicon","example":{"logo":"https://static.forma.today/whitelabel/65031e7477123beeda27f1e8/logo-1761230000000.png"}},"productName":{"type":"string","description":"Название продукта вместо DataDoc; нет поля — используется DataDoc","example":"Моя Платформа"},"contacts":{"type":"object","description":"Контакты и юрлицо для подвала писем (как в PUT /whitelabel/contacts); нет поля — контакты DataDoc","example":{"email":"help@platform.example","legalName":"ООО «Платформа»"}},"mail":{"type":"object","description":"Почта организации (SMTP) без секретов; нет поля — почта не настроена","properties":{"provider":{"type":"string","enum":["yandex","gmail","mailru","outlook","other"],"description":"Почтовый сервис (other — свой SMTP-сервер)","example":"yandex"},"from":{"type":"string","description":"Адрес отправителя","example":"vm@datadoc.ru"},"replyTo":{"type":"string","description":"Адрес для ответов (Reply-To), если задан","example":"vm@datadoc.ru"},"host":{"type":"string","description":"SMTP-сервер","example":"smtp.yandex.ru"},"port":{"type":"integer","description":"Порт SMTP-сервера","example":465},"secure":{"type":"boolean","description":"true — SSL/TLS с начала соединения (порт 465), false — STARTTLS","example":true},"login":{"type":"string","description":"Логин SMTP","example":"vm@datadoc.ru"},"hasPassword":{"type":"boolean","description":"Пароль сохранён (сам пароль не возвращается)","example":true},"hasYandexKey":{"type":"boolean","description":"Ключ приложения Яндекс сохранён (сам ключ не возвращается)","example":false}}},"spec":{"type":"object","description":"Справочник для экрана настроек","properties":{"colors":{"type":"array","description":"Допустимые названия цветов","items":{"type":"string","description":"Название цвета"},"example":["primary","accent","background","text","success","attention","warning","error"]},"logos":{"type":"object","description":"Виды логотипов и размеры (ширина и высота в пикселях), до которых экран обрезает картинку","example":{"logo":{"width":100,"height":28},"logoSmall":{"width":75,"height":54},"logoWhite":{"width":87,"height":21},"favicon":{"width":96,"height":96}}},"mailProviders":{"type":"object","description":"Пресеты почтовых сервисов (host, port, secure) для yandex, gmail, mailru, outlook","example":{"yandex":{"host":"smtp.yandex.ru","port":465,"secure":true},"outlook":{"host":"smtp-mail.outlook.com","port":587,"secure":false}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["White Label"],"summary":"Сбросить оформление к стандартному (цвета и логотипы)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки после сброса"},"400":{"description":"Режим White Label не включён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabel/colors":{"put":{"tags":["White Label"],"summary":"Сохранить цвета","description":"Цвет - hex вида","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"colors":{"type":"object","description":"Цвета для изменения — ключ (primary, accent, background, text, success, attention, warning, error) и значение hex","example":{"primary":"#aa3300","background":null}}}}}}},"responses":{"200":{"description":"Настройки после сохранения"},"400":{"description":"Неверный цвет или название цвета, режим не включён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabel/contacts":{"put":{"tags":["White Label"],"summary":"Контакты и юрлицо рабочего пространства для подвала писем","description":"Заменяют контакты DataDoc (buh@datadoc.ru, «Написать в Telegram», «Запросить демо», ООО «Умные Документы») в письмах. Набор заменяется целиком, пустой объект возвращает контакты DataDoc. Названия без < > & и кавычек, ссылки http(s).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"object","description":"Полный набор контактов (другие ключи не допускаются); пустой объект возвращает контакты DataDoc","properties":{"email":{"type":"string","format":"email","maxLength":100,"description":"Почта для связи вместо buh@datadoc.ru","example":"help@platform.example"},"messenger":{"type":"object","description":"Кнопка мессенджера вместо «Написать в Telegram»","required":["name","url"],"properties":{"name":{"type":"string","maxLength":40,"description":"Текст кнопки (без < > & и кавычек)","example":"Написать в WhatsApp"},"url":{"type":"string","maxLength":300,"description":"Ссылка http(s)","example":"https://wa.me/79990000000"}}},"link":{"type":"object","description":"Дополнительная ссылка вместо «Запросить демо»","required":["name","url"],"properties":{"name":{"type":"string","maxLength":40,"description":"Текст ссылки (без < > & и кавычек)","example":"Наш сайт"},"url":{"type":"string","maxLength":300,"description":"Ссылка http(s)","example":"https://platform.example/"}}},"legalName":{"type":"string","maxLength":120,"description":"Название юрлица вместо ООО «Умные Документы» (без < > & и кавычек)","example":"ООО «Платформа»"}}}}}}}},"responses":{"200":{"description":"Настройки после сохранения"},"400":{"description":"Неверная почта, название или ссылка; режим не включён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabel/mail":{"put":{"tags":["White Label"],"summary":"Почта организации для отправки писем (SMTP)","description":"С этого ящика уходят письма, привязанные к организации (документы, заполнение, подпись, приглашения); системные письма регистрации и восстановления пароля остаются с адреса сервиса. provider - yandex, gmail, mailru, outlook или other. Для первых четырёх сервер, порт и шифрование задаёт пресет (поля host, port, secure игнорируются), адрес отправителя должен совпадать с логином. Для other нужны host и port. Пароль и ключ приложения Яндекс: строка - задать новый, null - удалить, не передавать - оставить прежний; хранятся зашифрованными и наружу не возвращаются (в ответе hasPassword и hasYandexKey). Если задан ключ приложения Яндекс, используется он, а не пароль. Ящик используется, пока режим White Label включён.\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider","from"],"properties":{"provider":{"type":"string","enum":["yandex","gmail","mailru","outlook","other"],"description":"Почтовый сервис — yandex, gmail, mailru, outlook (сервер, порт и шифрование из пресета) или other (свой SMTP-сервер, нужны host и port)","example":"yandex"},"from":{"type":"string","format":"email","maxLength":100,"description":"Адрес отправителя; для пресетов должен совпадать с логином","example":"vm@datadoc.ru"},"replyTo":{"type":"string","format":"email","maxLength":100,"nullable":true,"description":"Адрес для ответов (Reply-To); null или не передан — не задаётся","example":"vm@datadoc.ru"},"host":{"type":"string","maxLength":100,"description":"SMTP-сервер (латиница, цифры, точка, дефис); только для provider = other","example":"smtp.example.ru"},"port":{"type":"integer","minimum":1,"maximum":65535,"description":"Порт SMTP-сервера; только для provider = other","example":465},"secure":{"type":"boolean","description":"true — SSL/TLS с начала соединения (обычно порт 465), false — STARTTLS (587); только для provider = other","example":true},"login":{"type":"string","maxLength":100,"description":"Логин SMTP. По умолчанию совпадает с from","example":"vm@datadoc.ru"},"password":{"type":"string","maxLength":200,"nullable":true,"description":"Пароль SMTP — строка задаёт новый, null удаляет, не передан — остаётся прежний","example":"app-password"},"yandexKey":{"type":"string","maxLength":200,"nullable":true,"description":"Ключ приложения Яндекс Почты (используется вместо пароля) — строка задаёт новый, null удаляет, не передан — остаётся прежний","example":"abcdefghijklmnop"}}}}}},"responses":{"200":{"description":"Настройки (в mail - без секретов)"},"400":{"description":"Неверные данные, режим не включён, нет пароля или ключа"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}},"delete":{"tags":["White Label"],"summary":"Удалить настройки почты организации (письма снова идут с адреса сервиса)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки после удаления"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabel/mail/test":{"post":{"tags":["White Label"],"summary":"Отправить тестовое письмо с ящика организации на адрес пользователя","description":"Ошибка SMTP возвращается как 400 с ответом почтового сервера (пароль в нём не показывается).","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Письмо отправлено","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean","description":"Письмо принято SMTP-сервером (всегда true при ответе 200)","example":true},"to":{"type":"string","description":"Адрес, на который ушло письмо (логин текущего пользователя)","example":"vm@datadoc.ru"}}}}}},"400":{"description":"Почта не настроена или сервер отклонил отправку"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabeladmin/smtpcheck":{"get":{"tags":["White Label (админка)"],"summary":"Проверка исходящих SMTP-портов сервера (админ сервиса)","description":"TCP-подключение с сервера к smtp.yandex.ru, smtp.gmail.com, smtp.mail.ru, smtp-mail.outlook.com на портах 465 и 587.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Результат по каждому серверу и порту","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SmtpPortCheckResult"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/whitelabeladmin/smtp-check":{"get":{"tags":["White Label (админка)"],"summary":"Проверка исходящих SMTP-портов сервера (устаревший путь, используйте GET /whitelabeladmin/smtpcheck)","description":"То же, что GET /whitelabeladmin/smtpcheck. Путь оставлен до перехода клиентов на новый и будет удалён.","deprecated":true,"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Результат по каждому серверу и порту","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SmtpPortCheckResult"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/whitelabel/name":{"put":{"tags":["White Label"],"summary":"Задать название продукта вместо DataDoc","description":"1-40 символов без < > & и кавычек; null возвращает DataDoc. Название подставляется в тексты ЛК, заголовки страниц, письма и имя отправителя письма.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productName":{"type":"string","nullable":true,"minLength":1,"maxLength":40,"description":"Название продукта (1-40 символов без < > & и кавычек); null возвращает DataDoc","example":"Моя Платформа"}}}}}},"responses":{"200":{"description":"Настройки после сохранения"},"400":{"description":"Неверное название или режим не включён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabel/logos/{kind}":{"post":{"tags":["White Label"],"summary":"Загрузить логотип","description":"kind - logo, logoSmall, logoWhite или favicon. Файл (поле file) PNG, JPEG или WebP, уже обрезанный до пропорций из spec, размером до значения настройки сервиса whitelabel.logoMaxSizeKb (по умолчанию 1024 КБ). SVG не принимается. Новый файл заменяет прежний.","security":[{"BearerAuth":[]}],"parameters":[{"name":"kind","in":"path","required":true,"description":"Вид логотипа — logo (основной), logoSmall (малый), logoWhite (белый, для тёмного фона), favicon (значок вкладки)","schema":{"type":"string","enum":["logo","logoSmall","logoWhite","favicon"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Картинка PNG, JPEG или WebP"}}}}}},"responses":{"201":{"description":"Настройки после загрузки"},"400":{"description":"Неверный вид или тип файла, файл больше допустимого размера, режим не включён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}},"delete":{"tags":["White Label"],"summary":"Удалить логотип (действует стандартный)","security":[{"BearerAuth":[]}],"parameters":[{"name":"kind","in":"path","required":true,"description":"Вид логотипа — logo, logoSmall, logoWhite или favicon","schema":{"type":"string","enum":["logo","logoSmall","logoWhite","favicon"]}}],"responses":{"200":{"description":"Настройки после удаления"},"400":{"description":"Неверный вид, режим не включён"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/whitelabelpublic/externalinfills/{key}":{"get":{"tags":["White Label (публичные методы)"],"summary":"Оформление отправителя для публичной страницы заполнения и подписания","description":"Без авторизации. Рабочее пространство определяется по ключу ссылки. При выключенном режиме приходит {enabled: false}.","parameters":[{"name":"key","in":"path","required":true,"description":"Ключ публичной ссылки внешнего заполнения","schema":{"type":"string"}}],"responses":{"200":{"description":"Оформление","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhiteLabelTheme"}}}},"404":{"description":"Ссылка не найдена"}}}},"/whitelabelpublic/renders/{key}":{"get":{"tags":["White Label (публичные методы)"],"summary":"Оформление отправителя для публичной страницы подписания документа","description":"Без авторизации. Рабочее пространство определяется по ключу ссылки подписания. При выключенном режиме приходит {enabled: false}.","parameters":[{"name":"key","in":"path","required":true,"description":"Ключ публичной ссылки подписания документа","schema":{"type":"string"}}],"responses":{"200":{"description":"Оформление","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhiteLabelTheme"}}}},"404":{"description":"Ссылка не найдена"}}}},"/workspaces/{id}/whitelabel":{"put":{"tags":["Рабочие пространства"],"summary":"Включить или выключить режим White Label для рабочего пространства (админка)","description":"Настройки при выключении сохраняются и снова применяются при включении.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["whiteLabelEnabled"],"properties":{"whiteLabelEnabled":{"type":"boolean","description":"true — включить режим White Label, false — выключить","example":true}}}}}},"responses":{"200":{"description":"Состояние режима","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"whiteLabelEnabled":{"type":"boolean","description":"Новое состояние режима","example":true}}}}}},"400":{"description":"Неверное значение"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/users":{"get":{"tags":["Пользователи"],"summary":"Получить список пользователей","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"filter","description":"Фильтр по ФИО или логину (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"usergroups","description":"Фильтр по id групп","schema":{"type":"array","items":{"type":"string","example":"63d162a87f71f0d6914f3a6e"}}},{"in":"query","name":"from","description":"Номер записи, с которой осуществлять выборку (0-based)","schema":{"type":"number"}},{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"number"}}],"responses":{"200":{"description":"Возвращается список пользователей","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Пользователи рабочего пространства в выбранном диапазоне from-to","items":{"$ref":"#/components/schemas/User"}},"count":{"type":"integer","description":"Общее количество пользователей, подходящих под фильтр","example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Пользователи"],"summary":"Создать нового пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Атрибут","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginPasswordUser"}}}},"responses":{"201":{"description":"Возвращается id пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/users/{id}":{"get":{"tags":["Пользователи"],"summary":"Получить пользователя по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается пользователь","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"advertisementId":{"type":"integer","description":"Целочисленный id","example":65341},"emailConfirmed":{"type":"boolean","description":"Флаг подтверждения email","example":true},"easyRegister":{"type":"boolean","description":"Флаг простой регистрации","example":true},"easyRegisterAuthAt":{"type":"string","description":"Дата авторизации при простой регистрации","example":"2023-06-17T00:01:01.530Z"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Пользователи"],"summary":"Обновить пользователя","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Пользователь","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewUser"},{"type":"object","properties":{"password":{"type":"string","description":"Пароль","example":"Passw0rD"}}}]}}}},"responses":{"200":{"description":"Возвращается id пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Пользователи"],"summary":"Удалить пользователя по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/users/{id}/groups":{"get":{"tags":["Пользователи"],"summary":"Получить группы пользователя по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются группы по id","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Usergroup"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Пользователи"],"summary":"Установить группы пользователя по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Группы","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupids":{"type":"array","description":"Список id групп","items":{"type":"string","example":"62bb25949213f16bcd934422"}}}}}}},"responses":{"200":{"description":"Возвращается id пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/users/invites":{"get":{"tags":["Пользователи"],"summary":"Получить список приглашенных пользователей","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список пользователей","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"Логин","example":"user@mail.ru"},"name":{"type":"string","description":"ФИО","example":"Иванов Иван Иванович"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Пользователи"],"summary":"Пригласить нового пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Атрибут","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","description":"Метод","enum":["mail","json"],"example":"mail"},"login":{"type":"string","description":"Логин","example":"user@mail.ru"},"name":{"type":"string","description":"ФИО","example":"Иванов Иван Иванович"},"groupids":{"type":"array","description":"Список id групп","items":{"type":"string","example":"62bb25949213f16bcd934422"}}}}}}},"responses":{"201":{"description":"Возвращаются данные приглашения","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"key":{"type":"string","description":"Ключ","example":"ac963ddcdce2f4b5488cd1b9566b6ffc"},"link":{"type":"string","description":"Ссылка","example":"https://lk.forma.today/invite/63d95410d94cbdcadb9c1a95?key=ac963ddcdce2f4b5488cd1b9566b6ffc"}}}]}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/users/invites/{id}":{"delete":{"tags":["Пользователи"],"summary":"Удалить приглашенного пользователя по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/userpoints/resources":{"get":{"tags":["Пользовательские баллы"],"summary":"Получить список ресурсов пользовательских баллов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются ресурсы","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserPointsResource"}}}}},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Пользовательские баллы"],"summary":"Создать ресурс пользовательских баллов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Свойства ресурса","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPointsResource"}}}},"responses":{"201":{"description":"Возвращается созданный ресурс","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPointsResource"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/userpoints/resources/batch":{"put":{"tags":["Пользовательские баллы"],"summary":"Изменить ресурсы пользовательских баллов пакетом","security":[{"BearerAuth":[]}],"requestBody":{"description":"Свойства ресурса","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserPointsResource"}}}}},"responses":{"200":{"description":"Возвращаются изменённые ресурсы","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserPointsResource"}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/userpoints/resources/{id}":{"put":{"tags":["Пользовательские баллы"],"summary":"Изменить ресурс пользовательских баллов по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Свойства ресурса","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPointsResource"}}}},"responses":{"200":{"description":"Возвращается изменённый ресурс","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPointsResource"}}}},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Пользовательские баллы"],"summary":"Удалить ресурс пользовательских баллов по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается ID удалённого ресурса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPointsResourceId"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/usergroups/":{"get":{"tags":["Группы пользователей"],"summary":"Получить список групп пользователей","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список групп пользователей","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Usergroup"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Группы пользователей"],"summary":"Создать новую группу пользователей","security":[{"BearerAuth":[]}],"requestBody":{"description":"Группа","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewUsergroup"}}}},"responses":{"201":{"description":"Возвращается группа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usergroup"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/usergroups/{id}":{"get":{"tags":["Группы пользователей"],"summary":"Получить группу пользователей по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается группа пользователей","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usergroup"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Группы пользователей"],"summary":"Обновить группу пользователей","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Атрибут","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewUsergroup"}}}},"responses":{"200":{"description":"Возвращается группа пользователей","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usergroup"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Группы пользователей"],"summary":"Удалить группу пользователей по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной группы","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/usergroups/{id}/users":{"get":{"tags":["Группы пользователей"],"summary":"Получить пользователей по id группы","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются пользователи по id группы","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Группы пользователей"],"summary":"Установить пользователей по id группы","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Пользователи","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userids":{"type":"array","description":"Список id пользователей","items":{"type":"string","example":"62bb25949213f16bcd934422"}}}}}}},"responses":{"200":{"description":"Возвращается id группы","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/firebase":{"get":{"tags":["Токен Firebase"],"summary":"Получить токены своего пользователя","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются токены пользователя","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Firebase"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Токен Firebase"],"summary":"Записать токен своего пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Токен Firebase","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFirebase"}}}},"responses":{"200":{"description":"Возвращается токен пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewFirebase"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user":{"get":{"tags":["Пользователь"],"summary":"Получить данные своего пользователя","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются данные пользователя","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","properties":{"advertisementId":{"type":"integer","description":"Целочисленный id","example":65341},"emailConfirmed":{"type":"boolean","description":"Флаг подтверждения email","example":true},"easyRegister":{"type":"boolean","description":"Флаг простой регистрации","example":true},"easyRegisterAuthAt":{"type":"string","description":"Дата авторизации при простой регистрации","example":"2023-06-17T00:01:01.530Z"},"apiKey":{"type":"string","description":"Ключ для интеграции API","example":"kl7ENZHAsKxMwRtoRBVK0XMEDODZyl8bHht3eh8jIch4Xr9Cvab3iCg1uGSkrXGbL9ulfshGRduZR2362Y6aXD5DCfteQuvJCGPqcwRpZ3quD7W9977ZHwqZZg6NADVj"},"createdAt":{"type":"string","description":"Дата регистрации","example":"2022-07-24T09:35:53.057+00:00"},"usergroups":{"type":"array","description":"Группы пользователей, в которые входит пользователь","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Бухгалтерия"}}}]}},"workspace":{"description":"Рабочее пространство пользователя (лимиты и признаки)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/SignatureLimits"},{"$ref":"#/components/schemas/AttachmentLimits"},{"$ref":"#/components/schemas/OcrLimits"},{"$ref":"#/components/schemas/DocsLimits"},{"type":"object","properties":{"login":{"type":"string","description":"Логин владельца воркспейса","example":"user@mail.ru"},"createdAt":{"type":"string","description":"Дата создания рабочего пространства","example":"2022-07-24T09:35:53.057+00:00"},"isYClients":{"type":"boolean","description":"Создано ли рабочее пространство клиентом YCLIENTS","example":true},"isRecruiter":{"type":"boolean","description":"Признак «Рекрутер» (партнёрская программа); только с ним в ЛК показывается «ЛК партнёра»","example":false},"partnershipModalShownAt":{"type":"array","description":"Даты показов модального окна партнёрской программы","items":{"type":"string","description":"Дата показа модального окна партнерской программы","example":"2023-11-22T10:17:33.622Z"}},"licenseAcceptedAt":{"type":"string","description":"Дата принятия лицензионного соглашения","example":"2023-11-22T10:17:33.622Z"},"isBlocked":{"type":"boolean","description":"Флаг блокировки воркспейса","example":true},"timeslotSkipped":{"type":"boolean","description":"Флаг пропуска записи на демо","example":true},"externalRegisterSource":{"$ref":"#/components/schemas/CrmTypeWithYClients"},"crm":{"$ref":"#/components/schemas/CrmTypeWithYClients"},"edoUserInns":{"type":"array","description":"ИНН организаций воркспейса, подключённых к ЭДО (отправитель и получатель документа по ЭДО должны быть в этом списке)","items":{"type":"string","description":"ИНН пользователя системы ЭДО","example":1234567890}}}}]},"onboardingStatus":{"description":"Флаги онбординга пользователя","allOf":[{"$ref":"#/components/schemas/UserOnboardingStatus"}]}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Пользователь"],"summary":"Обновить данные своего пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Пользователь","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewUser"}}}},"responses":{"200":{"description":"Возвращается пользователь","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/permissions":{"get":{"tags":["Пользователь"],"summary":"Получить разрешения своего пользователя","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются разрешения пользователя","content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"array","description":"Список разрешений","example":["templatesFolders:view","counteragents:view"],"items":{"type":"string"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/login":{"put":{"tags":["Пользователь"],"summary":"Сменить адрес электронной почты","security":[{"BearerAuth":[]}],"requestBody":{"description":"Новый адрес электронной почты","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Новый адрес электронной почты","example":"newlogin@login.ru"}}}}}},"responses":{"200":{"description":"Возвращается id пользователя и ключ подтверждения пароля","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID пользователя","example":"62bb25949213f16bcd934422"},"emailConfirmation":{"type":"string","description":"Ключ подтверждения почты пользователя","example":"4adae7119b53955e9ed7600921dfe145"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/easylogin":{"put":{"tags":["Пользователь"],"summary":"Сменить адрес электронной почты аккаунта быстрой регистрации","security":[{"BearerAuth":[]}],"requestBody":{"description":"Новый адрес электронной почты","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Новый адрес электронной почты","example":"newlogin@login.ru"}}}}}},"responses":{"200":{"description":"Возвращается новый токен для обновления авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/changelogin":{"get":{"tags":["Пользователь"],"summary":"Подтверждение смены адреса электронной почты","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"key","schema":{"type":"string"},"description":"В запросе принимает ключ key, который мы присылали на почту"}],"responses":{"200":{"description":"Возвращается пользователь","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/password":{"put":{"tags":["Пользователь"],"summary":"Сменить пароль своего пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Старый и новый пароль","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"oldPassword":{"type":"string","description":"Старый пароль","example":"OldPassw0rD"},"newPassword":{"type":"string","description":"Новый пароль","example":"newPassw0rD"}}}}}},"responses":{"200":{"description":"Возвращается новый токен для обновления авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/phone":{"put":{"tags":["Пользователь"],"summary":"Сменить номер телефона своего пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Новый номер телефона","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","description":"Новый номер телефона","example":79121324567}}}}}},"responses":{"200":{"description":"Статус подтверждения номера телефона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneConfirmation"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/phone/sms":{"put":{"tags":["Пользователь"],"summary":"Отправить SMS для подтверждения номера телефона","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Статус подтверждения номера телефона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneConfirmation"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/phone/verify":{"put":{"tags":["Пользователь"],"summary":"Подтвердить номер телефона своего пользователя","security":[{"BearerAuth":[]}],"requestBody":{"description":"Код подтвердения из СМС","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"Код подтверждения","example":12345}}}}}},"responses":{"200":{"description":"Статус подтверждения номера телефона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneConfirmation"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/phone/verify/messenger":{"put":{"tags":["Пользователь"],"summary":"Подтвердить номер телефона своего пользователя через мессенджер","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Статус подтверждения номера телефона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneConfirmation"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/user/onboardingstatus":{"get":{"tags":["Пользователь"],"summary":"Получить статус онбординга","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается статус онбординга","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOnboardingStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Пользователь"],"summary":"Изменить статус онбординга","security":[{"BearerAuth":[]}],"requestBody":{"description":"Статус онбординга","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOnboardingStatus"}}}},"responses":{"200":{"description":"Возвращается статус онбординга","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOnboardingStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/urltokens":{"post":{"tags":["URL-токен"],"summary":"Создать и получить URL-токен для авторизации на сервисе","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается URL-токен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlToken"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/uploadspublic":{"get":{"tags":["Загрузка файлов (публичные методы)"],"summary":"Получить реестр допустимых форматов загрузки","description":"Публичный метод без авторизации: личный кабинет и виджеты берут из него форматы и лимиты для мест загрузки файлов. Ключи объекта — места загрузки: facsimile (факсимиле), aiTemplate (файл для разметки шаблона ИИ), appendix (приложение документа), whiteLabelLogo (логотип White Label), colontitleImage (изображение колонтитула), editorImage (изображение в редакторе), mchd (МЧД), wordImport (импорт Word), htmlImport (импорт HTML), tableImport (таблицы товаров и контрагентов), massCreate (массовое создание документов), storage (хранилище файлов).","responses":{"200":{"description":"Возвращаются места загрузки и их форматы","content":{"application/json":{"schema":{"type":"object","description":"Объект «место загрузки → его форматы»","additionalProperties":{"$ref":"#/components/schemas/UploadPlace"}},"example":{"facsimile":{"extensions":[".bmp",".png",".gif",".jpg",".jpeg",".webp",".tif",".tiff"],"connected":true,"maxSizeSetting":"facsimile.maxSizeMb"},"storage":{"extensions":[],"connected":false}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/updater/run":{"post":{"tags":["Планировщик задач (публичные методы)"],"summary":"Запустить задачи планировщика, время которых наступило","description":"Вызывается внешним cron. Метод публичный, авторизация в коде не проверяется. Запускаются все задачи, у которых наступило время следующего запуска и которые сейчас не выполняются; затем для каждой рассчитывается следующее время. Ошибки задач только логируются.","responses":{"200":{"description":"Возвращается число запущенных задач","content":{"application/json":{"schema":{"type":"object","properties":{"tasksRun":{"type":"integer","description":"Сколько задач было запущено","example":2}}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/updater/run/{id}":{"post":{"tags":["Планировщик задач (публичные методы)"],"summary":"Принудительно запустить одну задачу планировщика","description":"Метод публичный, авторизация в коде не проверяется. Задача запускается сразу, независимо от расписания (если она уже не выполняется), ответ приходит после её завершения. Ошибка задачи только логируется. Неизвестное имя — 404.","parameters":[{"in":"path","name":"id","required":true,"description":"Имя задачи планировщика (см. схему UpdaterTaskId)","schema":{"type":"string","example":"executeScheduledJobs"}}],"responses":{"200":{"description":"Возвращается имя запущенной задачи","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/UpdaterTaskId"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/timeslotspublic":{"get":{"tags":["Таймслоты (публичные методы)"],"summary":"Получить список таймслотов","parameters":[{"in":"query","name":"managerId","description":"id менеджера","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список таймслотов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Timeslot"}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/timeslotspublic/elements":{"post":{"tags":["Таймслоты (публичные методы)"],"summary":"Забронировать таймслот","requestBody":{"description":"Элемент брони таймслота","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewTimeslotElement"},{"type":"object","properties":{"leadSource":{"type":"string","description":"Источник лида","example":"Рекомендация"},"registerQuery":{"$ref":"#/components/schemas/RegisterQuery"}}}]}}}},"responses":{"200":{"description":"Возвращается элемент брони таймслота","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeslotElement"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/timeslotsadmin/elements":{"get":{"tags":["Таймслоты (админка)"],"summary":"Получить список элементов брони таймслотов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"managerId","description":"id менеджера","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список элементов брони таймслотов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimeslotElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Таймслоты (админка)"],"summary":"Забронировать таймслот","security":[{"BearerAuth":[]}],"requestBody":{"description":"Элемент брони таймслота","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewTimeslotElement"},{"type":"object","properties":{"leadUrl":{"type":"string","description":"URL лида","example":"https://formasales.amocrm.ru/leads/detail/27255161"}}}]}}}},"responses":{"201":{"description":"Возвращается элемент брони таймслота","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeslotElement"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/timeslotsadmin/elements/{id}":{"get":{"tags":["Таймслоты (админка)"],"summary":"Получить элемент брони таймслота","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается элемент брони таймслота","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeslotElement"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/timeslots/elements":{"post":{"tags":["Таймслоты"],"summary":"Забронировать таймслот","security":[{"BearerAuth":[]}],"requestBody":{"description":"Элемент брони таймслота","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"timeslotId":{"type":"string","description":"id таймслота","example":"651282618f15d0e55cdb9198"},"managerId":{"type":"string","description":"id менеджера","example":"64d0e03512ddeea1afc0147b"},"gmt":{"type":"string","description":"Часовой пояс клиента","example":"+12:00"},"channel":{"type":"string","description":"Канал связи клиента","example":"Телефон"}}}}}},"responses":{"200":{"description":"Возвращается элемент брони таймслота","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeslotElement"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/timeslots/elements/current":{"get":{"tags":["Таймслоты"],"summary":"Получить текущий элемент брони таймслота","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается элемент брони таймслота","content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","description":"Время таймслота","example":"2023-08-21T10:30:00.000Z"},"gmt":{"type":"string","description":"Часовой пояс клиента","example":"+12:00"},"channel":{"type":"string","description":"Канал связи клиента","example":"Телефон"},"manager":{"description":"Менеджер, назначенный на таймслот","allOf":[{"$ref":"#/components/schemas/Manager"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/testaccounts":{"post":{"tags":["Тестовые аккаунты (админка)"],"summary":"Создать готовый к тестам аккаунт (рабочее пространство и основной пользователь)","description":"Только администратор сервиса с ролью COMMON_ADMIN (иначе 403). Почта и телефон подтверждены (тестовый номер 70000000000, СМС не отправляются), обучение пройдено, лицензионное соглашение принято, тариф Enterprise на год оплачен, лимиты подписей и распознаваний подняты, включены «Согласования», «Таск-менеджер», «Рекрутер», хранилище без ограничений. Логин должен подходить под шаблон окружения TEST_ACCOUNT_LOGIN_PATTERN (по умолчанию домены example.com, ya.ru, datadoc.ru, forma.today, traektoria.pro); число вызовов в час ограничено (TEST_ACCOUNT_LIMIT_PER_HOUR, по умолчанию 20), сверх — 429.\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["login","password"],"properties":{"login":{"type":"string","format":"email","description":"Логин (e-mail) пользователя; домен — из разрешённых для тестовых аккаунтов","example":"autotest_1@datadoc.ru"},"password":{"type":"string","minLength":6,"description":"Пароль пользователя (не короче 6 символов)","example":"Test123456"},"name":{"type":"string","maxLength":200,"description":"Имя пользователя; не передано — имя по умолчанию (ресурс testaccount.defaultname)","example":"Тестовый пользователь"}}}}}},"responses":{"201":{"description":"Аккаунт создан","content":{"application/json":{"schema":{"type":"object","properties":{"wid":{"type":"string","description":"id созданного рабочего пространства","example":"62bb25949213f16bcd934422"},"uid":{"type":"string","description":"id основного пользователя","example":"62bb25949213f16bcd934423"},"login":{"type":"string","description":"Логин пользователя","example":"autotest_1@datadoc.ru"},"phone":{"type":"string","description":"Подтверждённый тестовый телефон","example":"70000000000"},"tariff":{"type":"string","description":"Шаблон подключённого тарифа","example":"tariff_enterprise_360"}}}}}},"400":{"description":"Неверные данные, логин не подходит под шаблон тестовых аккаунтов или пользователь с таким логином уже есть (user.alreadyexists)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"429":{"description":"Превышено число созданий тестовых аккаунтов в час"}}}},"/templates":{"get":{"tags":["Шаблоны"],"summary":"Получить список шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Имя шаблона (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"folderid","description":"id папки (поиск по точному совпадению)","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список шаблонов по заданным условиям","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Шаблоны"],"summary":"Создать новый шаблон","security":[{"BearerAuth":[]}],"requestBody":{"description":"Шаблон","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTemplate"}}}},"responses":{"201":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}":{"get":{"tags":["Шаблоны"],"summary":"Получить шаблон по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TemplateWithPath"},{"type":"object","properties":{"docIndexNumber":{"type":"integer","description":"Номер документа по порядку","example":1}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Шаблоны"],"summary":"Обновить шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Шаблон","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewTemplate"},{"type":"object","properties":{"docIndexNumber":{"type":"integer","description":"Номер документа по порядку","example":1}}}]}}}},"responses":{"200":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Шаблоны"],"summary":"Удалить шаблон по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/byName/{name}":{"get":{"tags":["Шаблоны"],"summary":"Получить шаблон по translatedName","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"name","description":"translatedName объекта","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateWithPath"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/content":{"get":{"tags":["Шаблоны"],"summary":"Получить контент шаблона (для последующего редактирования)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается контент шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateContent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Шаблоны"],"summary":"Создать контент шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Контент шаблона","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTemplateContent"}}}},"responses":{"201":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/sides":{"get":{"tags":["Шаблоны"],"summary":"Получить стороны шаблона (для последующего создания документа)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются стороны шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"sides":{"description":"Стороны шаблона с переменными и комбо-полями","type":"array","items":{"$ref":"#/components/schemas/TemplateSideWithComboattrs"}},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/render":{"post":{"tags":["Шаблоны"],"summary":"Создание документа по шаблону","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderRequest"}}}},"responses":{"201":{"description":"Возвращается информация о рендере","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/signedrender":{"post":{"tags":["Шаблоны"],"summary":"Загрузить документ и УКЭП (pdf и sig)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для загрузки","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SignedRenderRequest"}}}},"responses":{"201":{"description":"Возвращается информация о рендере","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/signedrender/{renderid}":{"post":{"tags":["Шаблоны"],"summary":"Загрузить документ, созданный на основе другого документа по renderid, и УКЭП","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"renderid","schema":{"type":"string"}}],"requestBody":{"description":"Данные для создания","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SignedRenderRequest"}}}},"responses":{"201":{"description":"Возвращается информация о рендере","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/edosignedrender":{"post":{"tags":["Шаблоны"],"summary":"Загрузить документ и УКЭП (pdf и sig) в систему ЭДО","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для загрузки","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/EdoSignedRenderRequest"}}}},"responses":{"201":{"description":"Возвращается информация о рендере","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/edosignedrender/{renderid}":{"post":{"tags":["Шаблоны"],"summary":"Загрузить документ, созданный на основе другого документа по renderid, и УКЭП в систему ЭДО","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"renderid","schema":{"type":"string"}}],"requestBody":{"description":"Данные для создания","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/EdoSignedRenderRequest"}}}},"responses":{"201":{"description":"Возвращается информация о рендере","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/html":{"post":{"tags":["Шаблоны"],"summary":"Получение HTML кода документа по шаблону","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 154"},"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"}}}}}},"responses":{"200":{"description":"Возвращается html строка","content":{"application/pdf":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/renders":{"get":{"tags":["Шаблоны"],"summary":"Получить документы по шаблону","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается список документов по шаблону","content":{"application/json":{"schema":{"type":"object","properties":{"renders":{"description":"Документы, созданные по шаблону","type":"array","items":{"$ref":"#/components/schemas/TemplateRender"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/render/{renderid}":{"get":{"tags":["Шаблоны"],"summary":"Скачать созданный документ по renderid","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","description":"renderid","required":true,"schema":{"type":"string"}},{"in":"query","name":"format","description":"Формат","schema":{"type":"string","enum":["pdf","docx","doc"]}},{"in":"query","name":"scale","description":"Масштаб","schema":{"type":"number"}}],"responses":{"200":{"description":"Возвращается pdf файл","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Шаблоны"],"summary":"Создать документ по renderid с другими значениями переменных","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","description":"renderid","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderRequest"}}}},"responses":{"201":{"description":"Возвращается информация о рендере","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/search":{"get":{"tags":["Шаблоны"],"summary":"Поиск шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Имя шаблона (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"folderid","description":"id папки (поиск по точному совпадению)","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список шаблонов в папке и ее подпапках по заданным условиям","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/favorites/{id}":{"put":{"tags":["Шаблоны"],"summary":"Добавить шаблон в избранное","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Шаблоны"],"summary":"Удалить шаблон из избранного","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/copy":{"post":{"tags":["Шаблоны"],"summary":"Скопировать шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Папка назначения","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/copytoworkspace":{"post":{"tags":["Шаблоны"],"summary":"Скопировать шаблон в другой воркспейс","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Email любого пользователя другого воркспейса","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email пользователя","example":"example@example.com"}}}}}},"responses":{"201":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/sides":{"get":{"tags":["Шаблоны"],"summary":"Получить стороны шаблонов по списку","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"ids","description":"Список id шаблонов","schema":{"type":"array","items":{"type":"string","example":"63d162a87f71f0d6914f3a6e"}}}],"responses":{"200":{"description":"Возвращаются стороны шаблонов","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор подряда"},"sides":{"description":"Стороны шаблона с полными данными переменных","type":"array","items":{"$ref":"#/components/schemas/TemplateSideWithFilledTattrs"}},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{templateid}/statics":{"get":{"tags":["Шаблоны"],"summary":"Получить список статических файлов","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"templateid","description":"templateid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список статических файлов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateStatic"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Шаблоны"],"summary":"Загрузить новый статический файл","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"templateid","description":"templateid","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Файл","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается объект статического файла","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateStatic"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{templateid}/statics/{id}":{"get":{"tags":["Шаблоны"],"summary":"Получить статический файл","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"templateid","description":"templateid","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается статический файл","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateStatic"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Шаблоны"],"summary":"Удалить статический файл","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"templateid","description":"templateid","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается статический файл","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateStatic"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/doc":{"post":{"tags":["Шаблоны"],"summary":"Создать новый шаблон из doc-файла","security":[{"BearerAuth":[]}],"requestBody":{"description":"Шаблон","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"},"name":{"type":"string","description":"Наименование","example":"Договор подряда"},"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/deleted":{"get":{"tags":["Шаблоны"],"summary":"Получить список всех шаблонов, помеченных как удаленные","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список всех шаблонов, помеченных как удаленные","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор на разработку сайта"},"translatedName":{"type":"string","description":"Название транслитерацией для ЧПУ","example":"Schyot_na_oplatu"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/restore":{"put":{"tags":["Шаблоны"],"summary":"Восстановить шаблон, помеченный как удаленный","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/crm":{"put":{"tags":["Шаблоны"],"summary":"Добавить или обновить поля для интеграции с CRM","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные сопоставления","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tattrs":{"description":"Сопоставление переменных шаблона с полями CRM, по сторонам","type":"array","items":{"type":"object","properties":{"sideId":{"type":"string","description":"id стороны","example":"V8ls0GGnvvdt7d8nMqHx6"},"fields":{"description":"Переменные стороны и соответствующие им поля CRM","type":"array","items":{"allOf":[{"type":"object","properties":{"formaId":{"type":"string","description":"id переменной Формы","example":101}}},{"$ref":"#/components/schemas/CrmFields"}]}}}}},"tables":{"description":"Сопоставление колонок таблиц шаблона с полями CRM","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"id таблицы","example":"V8ls0GGnvvdt7d8nMqHx6"},"fields":{"description":"Колонки таблицы и соответствующие им поля CRM","type":"array","items":{"allOf":[{"type":"object","properties":{"formaId":{"type":"string","description":"id колонки Формы","example":"name"}}},{"$ref":"#/components/schemas/CrmTableFields"}]}}}}}}}}}},"responses":{"200":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/ocr":{"put":{"tags":["Шаблоны"],"summary":"Добавить или обновить поля для OCR","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные сопоставления","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"sideId":{"type":"string","description":"id стороны","example":"V8ls0GGnvvdt7d8nMqHx6"},"fields":{"description":"Переменные стороны и соответствующие им поля сервиса OCR","type":"array","items":{"allOf":[{"type":"object","properties":{"formaId":{"type":"string","description":"id переменной Формы","example":101}}},{"$ref":"#/components/schemas/OcrFields"}]}}}}}}}},"responses":{"200":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/ai/{id}/error":{"post":{"tags":["Шаблоны"],"summary":"Сообщить об ошибке при создании шаблона с помощью ИИ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/appendixdates":{"get":{"tags":["Шаблоны"],"summary":"Переменные-даты шаблона для даты страниц приложений","description":"Переменные шаблона, из которых можно выбрать дату на страницах приложений к документу (УКЭП, параметр appendixDate). Пустой список — строки с датой в приложениях не будет; одна переменная — берётся её значение; несколько — по выбору пользователя (по умолчанию текущая дата документа).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Подходящие переменные по сторонам шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppendixVariableOption"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/templates/{id}/appendixnumbers":{"get":{"tags":["Шаблоны"],"summary":"Переменные-номера шаблона для строки «к документу №» в приложениях","description":"Переменные шаблона с номером документа, из которых можно выбрать номер на страницах приложений (параметр appendixDate.number). Пустой список — «к документу №» не выводится; по умолчанию берётся первая подходящая переменная.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Подходящие переменные по сторонам шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppendixVariableOption"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/templates/{id}/sendrender":{"post":{"tags":["Шаблоны"],"summary":"Создать документ по шаблону и отправить его PDF на e-mail","description":"Создаёт документ так же, как POST /templates/{id}/render, и отправляет его PDF письмом на указанный адрес (контрагенту). Отправитель в письме — sender, по умолчанию имя и логин текущего пользователя.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRenderRequest"}}}},"responses":{"200":{"description":"Созданный документ и признак отправки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRenderResponse"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/sendrender/{renderid}":{"post":{"tags":["Шаблоны"],"summary":"Создать документ на основе другого документа и отправить его PDF на e-mail","description":"Как POST /templates/{id}/render/{renderid} (новый документ по версии шаблона документа renderid) с отправкой PDF письмом на указанный адрес.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"id документа, на основе которого создаётся новый (берётся его версия шаблона)","schema":{"type":"string"},"example":"62bb25949213f16bcd934440"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRenderRequest"}}}},"responses":{"200":{"description":"Созданный документ и признак отправки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRenderResponse"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/{id}/massrender":{"post":{"tags":["Шаблоны"],"summary":"Массовое создание документов по шаблону (из Excel, несколько контрагентов)","description":"Для каждой строки rows: если заполнены все обязательные переменные — создаётся документ; если данных не хватает и указан получатель (entityId строки или общий) и у пользователя есть право на внешнее заполнение — создаётся внешнее заполнение; иначе строка возвращается со списком недостающих полей. Ошибка одной строки не прерывает остальные. Число строк в одном запросе ограничено настройкой masscreate.maxRows (по умолчанию 1000), больше — 400.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rows"],"properties":{"name":{"type":"string","description":"Общее название документов (по умолчанию — название шаблона)","example":"Договор оказания услуг"},"entityId":{"type":"string","description":"id получателя внешнего заполнения для строк, где данных не хватает (необязательно)","example":"62bb25949213f16bcd934460"},"rows":{"type":"array","minItems":1,"description":"Строки данных — по одному документу на строку","items":{"type":"object","required":["sideValues"],"properties":{"name":{"type":"string","description":"Название документа строки (по умолчанию — общее название или название шаблона)","example":"Договор Иванов"},"entityId":{"type":"string","description":"Получатель внешнего заполнения именно для этой строки","example":"62bb25949213f16bcd934461"},"sideValues":{"description":"Значения сторон строки (не меньше одной стороны; число сторон — как в шаблоне)","allOf":[{"$ref":"#/components/schemas/TemplateSideValues"}]}}}}}},"example":{"name":"Договор оказания услуг","rows":[{"name":"Договор Иванов","sideValues":[{"tattrValues":{"101":"Иванов Иван Иванович"}}]}]}}}},"responses":{"200":{"description":"Результат по каждой строке и итоговые счётчики","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","description":"Результаты по строкам, в порядке rows","items":{"type":"object","properties":{"index":{"type":"integer","description":"Номер строки в rows (с 0)","example":0},"status":{"type":"string","enum":["rendered","external","incomplete","error"],"description":"Итог строки: rendered — документ создан; external — создано внешнее заполнение; incomplete — не хватает данных; error — ошибка","example":"rendered"},"renderId":{"type":"string","description":"id созданного документа (status = rendered)","example":"62bb25949213f16bcd934440"},"renderName":{"type":"string","description":"Название созданного документа (status = rendered)","example":"Договор Иванов"},"renderNumber":{"type":"integer","description":"Номер документа по порядку (status = rendered)","example":15},"externalInfillId":{"type":"string","description":"id созданного внешнего заполнения (status = external)","example":"62bb25949213f16bcd934470"},"urlKey":{"type":"string","description":"Ключ ссылки внешнего заполнения (status = external)","example":"a1b2c3d4e5"},"missing":{"type":"array","description":"Незаполненные обязательные переменные (status = external или incomplete)","items":{"type":"object","properties":{"sideId":{"type":"string","description":"id стороны шаблона","example":"zakazchik"},"sideIndex":{"type":"integer","description":"Номер стороны (с 0)","example":0},"tattrId":{"type":"string","description":"id переменной","example":"101"},"name":{"type":"string","description":"Название переменной","example":"ФИО"}}}},"error":{"type":"string","description":"Текст ошибки (status = error)","example":"render.side.notfound"}}}},"counts":{"type":"object","description":"Сколько строк с каждым итогом","properties":{"total":{"type":"integer","description":"Всего строк","example":3},"rendered":{"type":"integer","description":"Создано документов","example":1},"external":{"type":"integer","description":"Создано внешних заполнений","example":1},"incomplete":{"type":"integer","description":"Строк с недостающими данными","example":1},"error":{"type":"integer","description":"Строк с ошибкой","example":0}}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/templates/{id}/renderpdf/{renderid}":{"post":{"tags":["Шаблоны"],"summary":"PDF документа с приложениями (для подписания УКЭП)","description":"Строит PDF документа renderid с приложениями — картинками и PDF из полей appendix. Этот PDF подписывается УКЭП; методы signedrender получают те же приложения. Число, размер и типы приложений ограничены; при превышении лимита вложений воркспейса — 400.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"id документа","schema":{"type":"string"},"example":"62bb25949213f16bcd934440"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"appendix":{"type":"array","description":"Файлы приложений — картинки или PDF (поля appendix или appendix[0], appendix[1]…)","items":{"type":"string","format":"binary","description":"Файл приложения"}},"appendixCaptions":{"type":"array","description":"Подписи приложений по порядку файлов (обрезаются до лимита длины названия вложения)","items":{"type":"string","description":"Подпись приложения","example":"Приложение 1. Спецификация"}},"appendixDate":{"type":"object","description":"Выбор даты и номера документа на страницах приложений; не передано — по умолчанию","properties":{"mode":{"type":"string","enum":["variable","current","none"],"description":"Дата: variable — из переменной (sideIndex, tattrId); current — текущая дата документа; none — без даты","example":"variable"},"sideIndex":{"type":"integer","description":"Номер стороны переменной-даты (с 0), при mode = variable","example":0},"tattrId":{"type":"string","description":"id переменной-даты (см. GET /templates/{id}/appendixdates), при mode = variable","example":"2007"},"number":{"type":"object","description":"Номер документа для «к документу №»; не передан — первая подходящая переменная","properties":{"mode":{"type":"string","enum":["variable","none"],"description":"variable — из переменной (sideIndex, tattrId); none — без номера","example":"variable"},"sideIndex":{"type":"integer","description":"Номер стороны переменной-номера (с 0)","example":0},"tattrId":{"type":"string","description":"id переменной-номера (см. GET /templates/{id}/appendixnumbers)","example":"2010"}}}}}}}}}},"responses":{"200":{"description":"PDF документа с приложениями","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/ai":{"post":{"tags":["Шаблоны"],"summary":"Создать шаблон из готового контента (ИИ)","description":"Создаёт шаблон с признаком ai и контентом без сторон (поля страницы по умолчанию). Название обрезается до лимита limits.templateNameLength (по умолчанию 100 символов). Начисляются пользовательские баллы за создание шаблона.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","content"],"properties":{"name":{"type":"string","description":"Название шаблона (не пустое)","example":"Договор аренды"},"content":{"type":"string","description":"HTML-контент шаблона (не пустой)","example":"<p>Договор аренды</p>"}}}}}},"responses":{"201":{"description":"Созданный шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templates/blanksign":{"post":{"tags":["Шаблоны"],"summary":"Системный пустой шаблон для «Отправить на подпись»","description":"Пустой шаблон для отправки на подпись только вложений, без выбора шаблона. Создаётся при первом обращении, в списках шаблонов не показывается; дальше работает как обычный пустой шаблон.","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"id системного шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/templatemappings/check":{"get":{"tags":["Сопоставление шаблонов (создать другой документ)"],"summary":"Проверить сопоставление сторон и переменных между шаблоном созданного документа и выбранным шаблоном","description":"Права - создание документов. Шаблон должен быть виден пользователю, документ - доступен пользователю.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"renderId","required":true,"description":"Созданный документ (источник данных)","schema":{"type":"string"}},{"in":"query","name":"templateId","required":true,"description":"Выбранный шаблон","schema":{"type":"string"}}],"responses":{"200":{"description":"Состояние сопоставления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMappingState"}}}},"400":{"description":"У документа нет шаблона или сторон, у выбранного шаблона нет сторон"},"404":{"description":"Документ или шаблон не найден, не виден пользователю или удалён"}}}},"/templatemappings":{"put":{"tags":["Сопоставление шаблонов (создать другой документ)"],"summary":"Сохранить сопоставление сторон и переменных для пары шаблонов","description":"Хранится одно сопоставление на пару (шаблон документа, выбранный шаблон) в рабочем пространстве. Ссылки проверяются по структуре документа и текущей версии шаблона; полнота сопоставления отражается в status ответа.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["renderId","templateId","sides"],"properties":{"renderId":{"type":"string","description":"id созданного документа (источник данных)","example":"62bb25949213f16bcd934440"},"templateId":{"type":"string","description":"id выбранного шаблона","example":"62bb25949213f16bcd934422"},"sides":{"type":"array","description":"Сопоставление по сторонам выбранного шаблона","items":{"$ref":"#/components/schemas/TemplateMappingSide"}}}}}}},"responses":{"200":{"description":"Состояние сопоставления после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMappingState"}}}},"400":{"description":"Ссылка на несуществующую сторону или переменную"},"404":{"description":"Документ или шаблон не найден или не виден пользователю"}}}},"/tcrequestsadmin":{"get":{"tags":["Заявки на создание шаблона (админка)"],"summary":"Получить список заявок на создание шаблона","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"wid","description":"Фильтр по id рабочего пространства","schema":{"type":"string"}},{"in":"query","name":"notProcessed","description":"Фильтр по необработанным заявкам","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Возвращается список заявок на создание шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TcRequestAdmin"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequestsadmin/downloadArchive":{"get":{"tags":["Заявки на создание шаблона (админка)"],"summary":"Скачать заявки на создание шаблона в виде архива","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"wid","description":"Фильтр по id рабочего пространства","schema":{"type":"string"}},{"in":"query","name":"notProcessed","description":"Фильтр по необработанным заявкам","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Возвращаются заявки на создание шаблона в виде архива","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequestsadmin/{id}":{"get":{"tags":["Заявки на создание шаблона (админка)"],"summary":"Получить заявку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются реквизиты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TcRequestAdmin"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequestsadmin/{id}/download":{"get":{"tags":["Заявки на создание шаблона (админка)"],"summary":"Скачать файл заявки по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается файл","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequestsadmin/{id}/process":{"put":{"tags":["Заявки на создание шаблона (админка)"],"summary":"Пометить заявку как обработанную","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id обработанной заявки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequests":{"get":{"tags":["Заявки на создание шаблона"],"summary":"Получить список заявок на создание шаблона","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список заявок на создание шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TcRequest"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Заявки на создание шаблона"],"summary":"Создать новую заявку","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для загрузки","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/NewTcRequest"}}}},"responses":{"201":{"description":"Возвращается заявка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TcRequest"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequests/{id}":{"get":{"tags":["Заявки на создание шаблона"],"summary":"Получить заявку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается заявка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TcRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Заявки на создание шаблона"],"summary":"Удалить заявку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной заявки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequests/{id}/download":{"get":{"tags":["Заявки на создание шаблона"],"summary":"Скачать файл заявки по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается файл","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequests/ai":{"post":{"tags":["Заявки на создание шаблона"],"summary":"Создать новую заявку для ИИ (docx, doc, odt, pages, dotx, ott, pdf)","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для загрузки","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/NewTcRequest"}}}},"responses":{"201":{"description":"Возвращается заявка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TcRequest"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tcrequests/ai/processed":{"post":{"tags":["Заявки на создание шаблона"],"summary":"Принять результат разметки файла ИИ (вызывает ИИ-сервис)","description":"Вебхук ИИ-сервиса без авторизации пользователя: подлинность проверяется по полю token тела, которое должно совпадать с секретом интеграции ИИ сервиса (иначе 403). По заявке для ИИ создаётся шаблон из присланного HTML (имя — имя файла заявки без расширения), в заявке сохраняются id шаблона и дата, воркспейс разблокируется, задача ИИ по заявке закрывается.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","wsId","tcRequestId","html"],"properties":{"token":{"type":"string","description":"Секретный токен интеграции ИИ (непустая строка)","example":"ai_secret_token"},"wsId":{"type":"string","description":"id воркспейса заявки (ObjectId)","example":"62bb25949213f16bcd934422"},"tcRequestId":{"type":"string","description":"id заявки для ИИ (ObjectId, заявка с флагом ai)","example":"62bb25949213f16bcd934423"},"html":{"type":"string","description":"HTML размеченного шаблона (должен содержать хотя бы один тег)","example":"<p>Договор № 1 от 01.11.2026</p>"}}}}}},"responses":{"201":{"description":"Возвращаются id заявки и id созданного шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id заявки","example":"62bb25949213f16bcd934423"},"templateId":{"type":"string","description":"id созданного шаблона","example":"62bb25949213f16bcd934424"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"403":{"description":"Неверный токен интеграции ИИ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tasks":{"get":{"tags":["Задачи"],"summary":"Получить список задач","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список задач","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Задачи"],"summary":"Создать новую задачу","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для загрузки","content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/NewTask"}}}},"responses":{"200":{"description":"Возвращается задача","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskWithLogs"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/tasks/positions":{"get":{"tags":["Задачи"],"summary":"Получить список задач по столбцам канбан-доски","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"impossible","description":"Показывать ли колонку impossible","schema":{"type":"string","enum":[true,false]}},{"in":"query","name":"managerid","description":"id ответственного","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список задач по столбцам канбан-доски","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"position":{"$ref":"#/components/schemas/TaskPosition"},"tasks":{"type":"array","description":"Задачи этого столбца","items":{"$ref":"#/components/schemas/Task"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tasks/{id}":{"get":{"tags":["Задачи"],"summary":"Получить задачу по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются реквизиты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskWithLogs"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Задачи"],"summary":"Обновить задачу","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Задача","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTask"}}}},"responses":{"200":{"description":"Возвращается задача","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Задачи"],"summary":"Удалить задачу по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной задачи","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/tasks/{id}/download":{"get":{"tags":["Задачи"],"summary":"Скачать файл задачи по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается файл","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/tasks/{id}/comment":{"post":{"tags":["Задачи"],"summary":"Создать новый комментарий к задаче","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Комментарий","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Сообщение","example":"Комментарий"}}}}}},"responses":{"200":{"description":"Возвращается запись лога задачи","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskLogBase"},{"type":"object","properties":{"taskid":{"type":"string","description":"id задачи","example":"62bb25949213f16bcd934422"},"userid":{"type":"string","description":"id пользователя","example":"62bb25949213f16bcd934422"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/tariffspublic":{"get":{"tags":["Тарифы (публичные методы)"],"summary":"Получить список тарифов","responses":{"200":{"description":"Возвращается список тарифов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tariff"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить список тарифов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список тарифов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tariff"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Тарифы (админка)"],"summary":"Создать тариф","security":[{"BearerAuth":[]}],"requestBody":{"description":"Тариф","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tariff"}}}},"responses":{"201":{"description":"Возвращается тариф","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tariff"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/{id}":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить тариф","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id тарифа","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается тариф","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tariff"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Тарифы (админка)"],"summary":"Обновить тариф","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id тарифа","schema":{"type":"string"}}],"requestBody":{"description":"Тариф","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tariff"}}}},"responses":{"200":{"description":"Возвращается тариф","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tariff"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Тарифы (админка)"],"summary":"Удалить тариф","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id тарифа","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается id удаленного тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/choose":{"put":{"tags":["Тарифы (админка)"],"summary":"Выбрать тариф","security":[{"BearerAuth":[]}],"requestBody":{"description":"Тариф","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"wid":{"type":"string","description":"id воркспейса","example":"62bb25949213f16bcd934422"},"tariffId":{"type":"string","description":"Идентификатор тарифа","example":"tariff_team"},"patternId":{"type":"string","description":"Идентификатор шаблона тарифа","example":"tariff_team_30"},"addUsersCount":{"type":"integer","description":"Количество дополнительных пользователей","example":5},"addAttachmentsSize":{"type":"integer","description":"Количество дополнительных ГБ Хранилища","example":1}}}}}},"responses":{"200":{"description":"Возвращаются данные о выбранном тарифе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstance"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/choose/trial":{"put":{"tags":["Тарифы (админка)"],"summary":"Принудительно установить триал","security":[{"BearerAuth":[]}],"requestBody":{"description":"Тариф","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"wid":{"type":"string","description":"id воркспейса","example":"62bb25949213f16bcd934422"},"patternId":{"type":"string","description":"Идентификатор шаблона тарифа","example":"tariff_trial_7"}}}}}},"responses":{"200":{"description":"Возвращаются данные о тарифе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstance"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить список экземпляров тарифов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список экземпляров тарифов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TariffInstanceAdmin"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/{id}":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить экземпляр тарифа","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается экземпляр тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstanceAdmin"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Тарифы (админка)"],"summary":"Изменить экземпляр тарифа (даты, тип тарифа, промокод)","description":"Любые из полей. Смена `patternId` (и `tariffId` вместе с ним) пересчитывает цену, скидку, лимиты и название; применение или отмена промокода пересчитывает цену по текущему шаблону. Оплаченная сумма не меняется (признак оплаты считается как оплачено >= цена). Промокод применяется только скидочных типов; отмена - `promocodeId: null`. Даты не могут пересекаться с другими тарифами рабочего пространства (граница в границу допустима), окончание должно быть позже начала. Заранее посмотреть результат и соседей можно через `POST /tariffsadmin/instances/{id}/preview`.\n","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dtFrom":{"type":"string","description":"Дата и время начала","example":"2023-08-01T00:00:00.000Z"},"dtTo":{"type":"string","description":"Дата, по которую действует экземпляр тарифа","example":"2023-08-21T20:59:59.999Z"},"tariffId":{"type":"string","description":"Новый тариф (нужен `patternId`)","example":"tariff_enterprise"},"patternId":{"type":"string","description":"Новый шаблон тарифа","example":"tariff_enterprise_30"},"promocodeId":{"type":"string","nullable":true,"description":"Промокод со скидкой, который нужно применить; null - отменить применённый","example":"SPRING10"}}}}}},"responses":{"200":{"description":"Возвращается экземпляр тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstanceAdmin"}}}},"400":{"description":"Даты пересекаются с соседним тарифом, окончание не позже начала, промокод не на скидку, тариф отменён"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Не найден экземпляр, тариф, шаблон или промокод"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Тарифы (админка)"],"summary":"Отменить экземпляр тарифа","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id отмененного экземпляра тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/current":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить список текущих экземпляров тарифов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/isActive"},{"$ref":"#/components/parameters/currentUsersCountFrom"},{"$ref":"#/components/parameters/currentUsersCountTo"},{"$ref":"#/components/parameters/tariff"},{"$ref":"#/components/parameters/duration"},{"$ref":"#/components/parameters/daysLeftFrom"},{"$ref":"#/components/parameters/daysLeftTo"},{"$ref":"#/components/parameters/loginOrInn"},{"$ref":"#/components/parameters/featured"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/registeredAtFrom"},{"$ref":"#/components/parameters/registeredAtTo"},{"$ref":"#/components/parameters/paidAtFrom"},{"$ref":"#/components/parameters/paidAtTo"},{"$ref":"#/components/parameters/storageUsedFromMb"},{"$ref":"#/components/parameters/appendicesUsedFromMb"}],"responses":{"200":{"description":"Возвращается список экземпляров тарифов","content":{"application/json":{"schema":{"type":"object","properties":{"tariffInstances":{"type":"array","description":"Текущие экземпляры тарифов (по одному на рабочее пространство) на странице выборки","items":{"$ref":"#/components/schemas/TariffCurrentInstanceAdmin"}},"count":{"type":"integer","description":"Количество записей","example":1},"usersCount":{"type":"integer","description":"Количество пользователей сервиса","example":12},"workspacesCount":{"type":"integer","description":"Количество воркспейсов сервиса","example":13}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/current/excel":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить файл Excel с информацией о текущих экземплярах тарифов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/isActive"},{"$ref":"#/components/parameters/currentUsersCountFrom"},{"$ref":"#/components/parameters/currentUsersCountTo"},{"$ref":"#/components/parameters/tariff"},{"$ref":"#/components/parameters/duration"},{"$ref":"#/components/parameters/daysLeftFrom"},{"$ref":"#/components/parameters/daysLeftTo"},{"$ref":"#/components/parameters/loginOrInn"},{"$ref":"#/components/parameters/featured"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/registeredAtFrom"},{"$ref":"#/components/parameters/registeredAtTo"},{"$ref":"#/components/parameters/paidAtFrom"},{"$ref":"#/components/parameters/paidAtTo"},{"$ref":"#/components/parameters/storageUsedFromMb"},{"$ref":"#/components/parameters/appendicesUsedFromMb"}],"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/current/crm":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить список текущих экземпляров тарифов с информацией о CRM","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/tariff"},{"$ref":"#/components/parameters/crm"},{"$ref":"#/components/parameters/registerSource"},{"$ref":"#/components/parameters/registeredAtFrom"},{"$ref":"#/components/parameters/registeredAtTo"},{"$ref":"#/components/parameters/paidAtFrom"},{"$ref":"#/components/parameters/paidAtTo"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Возвращается список экземпляров тарифов с информацией о CRM","content":{"application/json":{"schema":{"type":"object","properties":{"tariffInstances":{"type":"array","description":"Текущие экземпляры тарифов с данными CRM на странице выборки","items":{"type":"object","description":"Текущий экземпляр тарифа рабочего пространства","properties":{"dtFrom":{"type":"string","description":"Начало действия","example":"2023-07-23T10:08:55.254Z"},"dtTo":{"type":"string","description":"Окончание действия","example":"2023-08-21T20:59:59.999Z"},"dtReadonly":{"type":"string","nullable":true,"description":"Окончание действия пробного периода тарифа","example":"2023-08-21T20:59:59.999Z"},"isPaid":{"type":"boolean","description":"Оплачен","example":true},"tariff":{"type":"object","description":"Тариф экземпляра","properties":{"id":{"type":"string","description":"Идентификатор","example":"tariff_team"},"name":{"type":"string","description":"Название","example":"Команда"}}},"workspace":{"description":"Рабочее пространство с данными CRM и регистрации","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"crm":{"$ref":"#/components/schemas/CrmTypeWithYClients"},"createdAt":{"type":"string","description":"Дата создания воркспейса","example":"2023-08-21T20:59:59.999Z"},"registerSource":{"$ref":"#/components/schemas/RegisterSource"},"paymentSummary":{"type":"object","description":"Сводка последней оплаты рабочего пространства","properties":{"amount":{"type":"integer","description":"Сумма","example":10000},"lastPeriodStart":{"type":"string","description":"Дата начала оплаченного периода","example":"2023-08-21T20:59:59.999Z"},"lastPeriodEnd":{"type":"string","description":"Дата окончания оплаченного периода","example":"2023-08-21T20:59:59.999Z"}}}}}]},"user":{"type":"object","description":"Владелец рабочего пространства","properties":{"login":{"type":"string","description":"Логин","example":"user@mail.ru"}}},"accountingdetails":{"type":"object","description":"Реквизиты организации рабочего пространства","properties":{"name":{"type":"string","description":"Название компании","example":"ООО Умные документы"},"phone":{"type":"string","description":"Телефон","example":"+7-999-123-45-67"}}},"payment":{"description":"Последняя оплата экземпляра тарифа","allOf":[{"$ref":"#/components/schemas/TariffInstanceLastTransaction"}]}}}},"count":{"type":"integer","description":"Количество записей","example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/current/crm/excel":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить файл Excel с информацией о текущих экземплярах тарифов и CRM","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/tariff"},{"$ref":"#/components/parameters/crm"},{"$ref":"#/components/parameters/registerSource"},{"$ref":"#/components/parameters/registeredAtFrom"},{"$ref":"#/components/parameters/registeredAtTo"},{"$ref":"#/components/parameters/paidAtFrom"},{"$ref":"#/components/parameters/paidAtTo"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/{id}/preview":{"post":{"tags":["Тарифы (админка)"],"summary":"Предпросмотр изменения экземпляра тарифа (ничего не сохраняется)","description":"Тело как у `PUT /tariffsadmin/instances/{id}`. Возвращает значения экземпляра после изменения (цена, лимиты, признак оплаты) и соседние тарифы по датам.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dtFrom":{"type":"string","format":"date-time","description":"Новое начало действия (не передано — без изменений)","example":"2026-11-01T00:00:00.000Z"},"dtTo":{"type":"string","format":"date-time","description":"Новое окончание действия (не передано — без изменений)","example":"2026-11-30T20:59:59.999Z"},"tariffId":{"type":"string","description":"Новый тариф; при смене тарифа обязателен patternId","example":"tariff_team"},"patternId":{"type":"string","description":"Новый вариант оплаты (паттерн) тарифа — пересчитываются цена и лимиты","example":"tariff_team_30"},"promocodeId":{"type":"string","nullable":true,"description":"Промокод экземпляра; null или пустая строка — снять промокод, не передано — без изменений","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Значения после изменения и соседи по датам","content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"object","description":"Экземпляр тарифа с применёнными изменениями (поля как в базе, плюс isPaid и amountToPay)"},"dates":{"type":"object","description":"Соседние экземпляры тарифов рабочего пространства относительно новых дат","properties":{"conflicts":{"type":"array","description":"Тарифы рабочего пространства, пересекающиеся с новыми датами (сохранение запрещено)","items":{"$ref":"#/components/schemas/TariffInstanceNeighbour"}},"previous":{"description":"Ближайший предыдущий экземпляр (заканчивается не позже нового начала); нет поля — такого нет","allOf":[{"$ref":"#/components/schemas/TariffInstanceNeighbour"}]},"next":{"description":"Ближайший следующий экземпляр (начинается не раньше нового окончания); нет поля — такого нет","allOf":[{"$ref":"#/components/schemas/TariffInstanceNeighbour"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/{id}/paid":{"put":{"tags":["Тарифы (админка)"],"summary":"Отметить экземпляр тарифа оплаченным или неоплаченным","description":"paid=true доплачивает недостающую сумму (как `/pay`), paid=false обнуляет оплату и дату оплаты.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paid"],"properties":{"paid":{"type":"boolean","description":"true — отметить оплаченным (доплатить недостающую сумму), false — обнулить оплату и дату оплаты","example":true}}}}}},"responses":{"200":{"description":"Возвращается экземпляр тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstanceAdmin"}}}},"400":{"description":"Тариф отменён или нет признака paid"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/instances/{id}/pay":{"put":{"tags":["Тарифы (админка)"],"summary":"Оплатить экземпляр тарифа","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Оплата","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Сумма","example":123.56}}}}}},"responses":{"200":{"description":"Возвращается экземпляр тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstanceAdmin"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/{wid}/instances":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить все экземпляры тарифов рабочего пространства (в том числе прошедшие и отменённые)","security":[{"BearerAuth":[]}],"parameters":[{"name":"wid","in":"path","required":true,"description":"id рабочего пространства","schema":{"type":"string"}}],"responses":{"200":{"description":"Список экземпляров тарифов по возрастанию","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TariffInstanceAdmin"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffsadmin/{wid}/instances/relevant":{"get":{"tags":["Тарифы (админка)"],"summary":"Получить список актуальных экземпляров тарифов рабочего пространства","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"wid","required":true,"description":"id воркспейса","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список экземпляров тарифов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TariffInstance"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs":{"get":{"tags":["Тарифы"],"summary":"Получить список тарифов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список тарифов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tariff"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/instances":{"get":{"tags":["Тарифы"],"summary":"Получить список экземпляров тарифов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список экземпляров тарифов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TariffInstance"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/instances/{id}":{"delete":{"tags":["Тарифы"],"summary":"Отменить экземпляр тарифа","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id отмененного экземпляра тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/instances/current":{"get":{"tags":["Тарифы"],"summary":"Получить текущий экземпляр тарифа","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается текущий экземпляр тарифа","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TariffInstance"},{"type":"object","properties":{"renewPrice":{"type":"number","description":"Цена продления","example":1000}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/instances/relevant":{"get":{"tags":["Тарифы"],"summary":"Получить список актуальных экземпляров тарифов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список экземпляров тарифов","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/TariffInstance"},{"type":"object","properties":{"payment":{"type":"object","description":"Способ оплаты экземпляра тарифа (нет поля — оплата не начата)","properties":{"type":{"$ref":"#/components/schemas/TariffPaymentType"},"filename":{"type":"string","description":"Имя файла","example":"https://safe.forma.today/invoices/64d11d92ec1cdcdb22ec2fa4/64d11ded43a7f1cf81a2c8b0.pdf"}}}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/instances/current/addusers":{"get":{"tags":["Тарифы"],"summary":"Получить данные о добавлении пользователей в текущий экземпляр тарифа","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"count","required":true,"description":"Количество дополнительных пользователей","schema":{"type":"integer"}}],"responses":{"200":{"description":"Возвращаются данные о выборе тарифа","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TariffPriceResponse"},{"type":"object","properties":{"userPrice":{"type":"number","description":"Цена добавления одного пользователя","example":500},"daysLeft":{"type":"integer","description":"Остаток дней по тарифу","example":5}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Тарифы"],"summary":"Добавить пользователей в текущий экземпляр тарифа","security":[{"BearerAuth":[]}],"requestBody":{"description":"Тариф","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","description":"Количество дополнительных пользователей","example":3}}}}}},"responses":{"200":{"description":"Возвращаются данные о тарифе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstance"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/choose/{tariffId}/{patternId}":{"get":{"tags":["Тарифы"],"summary":"Получить данные о выборе тарифа","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"tariffId","required":true,"description":"id тарифа","schema":{"type":"string"}},{"in":"path","name":"patternId","required":true,"description":"id шаблона","schema":{"type":"string"}},{"in":"query","name":"addUsersCount","description":"Количество дополнительных пользователей","schema":{"type":"integer"}},{"in":"query","name":"addAttachmentsSize","description":"Количество дополнительных ГБ Хранилища","schema":{"type":"integer"}},{"in":"query","name":"shouldCreateCurrentInstance","description":"Станет ли тариф текущим при выборе","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Возвращаются данные о выборе тарифа","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TariffPriceResponse"},{"type":"object","properties":{"dtFrom":{"type":"string","description":"Начало действия","example":"2023-07-23T10:08:55.254Z"},"dtTo":{"type":"string","description":"Окончание действия","example":"2023-08-21T20:59:59.999Z"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/choose":{"put":{"tags":["Тарифы"],"summary":"Выбрать тариф","security":[{"BearerAuth":[]}],"requestBody":{"description":"Тариф","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tariffId":{"type":"string","description":"Идентификатор тарифа","example":"tariff_team"},"patternId":{"type":"string","description":"Идентификатор шаблона","example":"tariff_team_30"},"addUsersCount":{"type":"integer","description":"Количество дополнительных пользователей","example":5},"addAttachmentsSize":{"type":"integer","description":"Количество дополнительных ГБ Хранилища","example":1},"shouldCreateCurrentInstance":{"type":"boolean","description":"Станет ли тариф текущим при выборе","example":false}}}}}},"responses":{"200":{"description":"Возвращаются данные о выбранном тарифе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstance"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tariffs/renew":{"put":{"tags":["Тарифы"],"summary":"Продлить текущий тариф","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются данные о новом экземпляре тарифа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffInstance"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/systemmessagesadmin":{"get":{"tags":["Системные сообщения (админка)"],"summary":"Получить список системных сообщений","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список системных сообщений","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SystemMessage"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Системные сообщения (админка)"],"summary":"Создать новое системное сообщение","security":[{"BearerAuth":[]}],"requestBody":{"description":"Системное сообщение","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSystemMessage"}}}},"responses":{"201":{"description":"Возвращается системное сообщение","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemMessage"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/systemmessagesadmin/{id}":{"put":{"tags":["Системные сообщения (админка)"],"summary":"Обновить системное сообщение","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Системное сообщение","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSystemMessage"}}}},"responses":{"200":{"description":"Возвращается системное сообщение","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemMessage"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Системные сообщения (админка)"],"summary":"Удалить системное сообщение","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного системного сообщения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/systemmessages/active":{"get":{"tags":["Системные сообщения"],"summary":"Получить активное системное сообщение","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается активное системное сообщение","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemMessage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/support/error":{"post":{"tags":["Поддержка"],"summary":"Отправить отчет об ошибке","requestBody":{"description":"Отчет об ошибке","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"errorId":{"type":"string","description":"id ошибки","example":"XdsaW0f"},"url":{"type":"string","description":"URL ошибки","example":"/templates"},"message":{"type":"string","description":"Сообщение об ошибке","example":"Сообщение"},"attachment":{"type":"string","description":"Приложение к отчету","example":"Тело запроса"},"wid":{"type":"string","description":"id воркспейса","example":"62bb25949213f16bcd934422"},"uid":{"type":"string","description":"id пользователя","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"200":{"description":"Возвращается флаг успеха","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Флаг успеха","example":true}}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrs":{"get":{"tags":["Строгие переменные"],"summary":"Получить список строгих переменных","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список строгих переменных","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Strictattr"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Строгие переменные"],"summary":"Создать новую переменную","security":[{"BearerAuth":[]}],"requestBody":{"description":"Переменная","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Strictattr"}}}},"responses":{"201":{"description":"Возвращается переменная","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Strictattr"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrs/{id}":{"get":{"tags":["Строгие переменные"],"summary":"Получить переменную по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrId"}],"responses":{"200":{"description":"Возвращается переменная","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Strictattr"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Строгие переменные"],"summary":"Обновить переменную","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrId"}],"requestBody":{"description":"Переменная","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewStrictattr"}}}},"responses":{"200":{"description":"Возвращается переменная","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Strictattr"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Строгие переменные"],"summary":"Удалить переменную по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrId"}],"responses":{"200":{"description":"Возвращается id переменной","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrs/usedtemplates":{"get":{"tags":["Строгие переменные"],"summary":"Получить список строгих переменных с используемыми общими шаблонами","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список строгих переменных","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"id строгой переменной (номер в виде строки)","example":"101"},"name":{"type":"string","description":"Наименование","example":"Имя кота"},"templates":{"type":"array","description":"Общие шаблоны, в которых используется переменная","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Договор подряда"}}}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrsections":{"get":{"tags":["Разделы строгих переменных"],"summary":"Получить список разделов строгих переменных","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список разделов строгих переменных","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StrictattrSection"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Разделы строгих переменных"],"summary":"Создать новый раздел","security":[{"BearerAuth":[]}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrSection"}}}},"responses":{"201":{"description":"Возвращается раздел переменной","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrSection"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrsections/{id}":{"get":{"tags":["Разделы строгих переменных"],"summary":"Получить раздел по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrSectionId"}],"responses":{"200":{"description":"Возвращается раздел","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrSection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Разделы строгих переменных"],"summary":"Обновить раздел","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrSectionId"}],"requestBody":{"description":"Раздел","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewStrictattrSection"}}}},"responses":{"200":{"description":"Возвращается раздел","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrSection"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Разделы строгих переменных"],"summary":"Удалить раздел по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrSectionId"}],"responses":{"200":{"description":"Возвращается id раздела","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrfolders":{"get":{"tags":["Папки строгих переменных"],"summary":"Получить список папок строгих переменных","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список папок строгих переменных","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StrictattrFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Папки строгих переменных"],"summary":"Создать новую папку","security":[{"BearerAuth":[]}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrFolder"}}}},"responses":{"201":{"description":"Возвращается папка переменной","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictattrfolders/{id}":{"get":{"tags":["Папки строгих переменных"],"summary":"Получить папку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrFolderId"}],"responses":{"200":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrFolder"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Папки строгих переменных"],"summary":"Обновить папку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrFolderId"}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewStrictattrFolder"}}}},"responses":{"200":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictattrFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Папки строгих переменных"],"summary":"Удалить папку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/StrictattrFolderId"}],"responses":{"200":{"description":"Возвращается id папки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplatesadmin":{"get":{"tags":["Строгие шаблоны (админка)"],"summary":"Получить список строгих шаблонов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список строгих шаблонов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StrictTemplateWithUploadFlag"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Строгие шаблоны (админка)"],"summary":"Создать новый строгий шаблон","security":[{"BearerAuth":[]}],"requestBody":{"description":"Структура строгого шаблона","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictTemplateContent"}}}},"responses":{"201":{"description":"Возвращается id строгого шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplatesadmin/{id}/upload":{"post":{"tags":["Строгие шаблоны (админка)"],"summary":"Загрузить файл строгого шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Файл строгого шаблона (только xlsx)","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается id строгого шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplatesadmin/{id}":{"get":{"tags":["Строгие шаблоны (админка)"],"summary":"Получить строгий шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается строгий шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictTemplateWithUploadFlag"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Строгие шаблоны (админка)"],"summary":"Обновить строгий шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Структура строгого шаблона","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictTemplateContent"}}}},"responses":{"200":{"description":"Возвращается id строгого шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Строгие шаблоны (админка)"],"summary":"Удалить строгий шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного строгого шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplates":{"get":{"tags":["Строгие шаблоны"],"summary":"Получить список строгих шаблонов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список строгих шаблонов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StrictTemplate"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplates/{id}":{"get":{"tags":["Строгие шаблоны"],"summary":"Получить строгий шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается строгий шаблон","content":{"application/json":{"schema":{"type":"object","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"КС-3"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplates/{id}/sides":{"get":{"tags":["Строгие шаблоны"],"summary":"Получить стороны строгого шаблона (для последующего создания документа)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются стороны строгого шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictTemplateSidesWithCombo"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplates/{id}/render":{"post":{"tags":["Строгие шаблоны"],"summary":"Создание документа по строгому шаблону","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для создания документа","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Акт 154"},"sideValues":{"$ref":"#/components/schemas/StrictTemplateSideValues"}}}}}},"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/stricttemplates/{id}/render/{renderid}":{"get":{"tags":["Строгие шаблоны"],"summary":"Повторное создание файла строгого документа","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"renderid","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Строгие шаблоны"],"summary":"Создание документа на основе другого документа","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"renderid","schema":{"type":"string"}}],"requestBody":{"description":"Данные для создания документа","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Акт 154"},"sideValues":{"$ref":"#/components/schemas/StrictTemplateSideValues"}}}}}},"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictrenders":{"get":{"tags":["Строгие документы"],"summary":"Получить список строгих документов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Название документа и ключевые переменные","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список документов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StrictRender"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictrenders/{id}":{"get":{"tags":["Строгие документы"],"summary":"Получить строгий документ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается документ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictRenderContent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Строгие документы"],"summary":"Удалить строгий документ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictrenders/{id}/name":{"put":{"tags":["Строгие документы"],"summary":"Переименовать строгий документ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Новое название документа","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Новое название документа","example":"Новый акт"}}}}}},"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictproductproperties/":{"get":{"tags":["Строгие свойства продуктов"],"summary":"Получить список строгих свойств продуктов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список строгих свойств продуктов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StrictProductProperty"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Строгие свойства продуктов"],"summary":"Создать новое строгое свойство продуктов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Свойство","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictProductProperty"}}}},"responses":{"201":{"description":"Возвращается свойство","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictProductProperty"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/strictproductproperties/{id}":{"put":{"tags":["Строгие свойства продуктов"],"summary":"Обновить свойство","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdStrictProductProperty"}],"requestBody":{"description":"Свойство","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewStrictProductProperty"}}}},"responses":{"200":{"description":"Возвращается свойство","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrictProductProperty"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Строгие свойства продуктов"],"summary":"Удалить свойство по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdStrictProductProperty"}],"responses":{"200":{"description":"Возвращается id свойства","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdStrictProductProperty"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/storageadmin/{id}":{"parameters":[{"in":"path","name":"id","required":true,"description":"id воркспейса","schema":{"type":"string"}}],"get":{"tags":["Хранилище файлов (админка)"],"summary":"Объём Хранилища и вложений воркспейса","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Объём","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageRoomUsage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/storageadmin/{id}/enabled":{"parameters":[{"in":"path","name":"id","required":true,"description":"id воркспейса","schema":{"type":"string"}}],"put":{"tags":["Хранилище файлов (админка)"],"summary":"Включить или выключить «Хранилище файлов» воркспейсу","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true — включить Хранилище воркспейсу, false — выключить (по умолчанию выключено)","example":true}}}}}},"responses":{"200":{"description":"Объём после изменения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageRoomUsage"}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/storageadmin/{id}/limit":{"parameters":[{"in":"path","name":"id","required":true,"description":"id воркспейса","schema":{"type":"string"}}],"put":{"tags":["Хранилище файлов (админка)"],"summary":"«Лимит хранилища» — общий объём Хранилища и вложений, ГБ","description":"Число через точку, не меньше 1 ГБ (минимальный пакет), округляется до сотых. null или 0 — сброс к умолчанию (Хранилище 0, вложения бесплатно 100 МБ). Значения больше 0 и меньше 1 — ошибка storage.limit.min.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limitGb":{"type":"number","nullable":true,"minimum":0,"maximum":100000,"description":"Общий лимит, ГБ (не меньше 1, до сотых); null или 0 — сбросить к умолчанию","example":1.5}}}}}},"responses":{"200":{"description":"Объём после изменения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageRoomUsage"}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/storageadmin/{id}/testaccount":{"parameters":[{"in":"path","name":"id","required":true,"description":"id воркспейса","schema":{"type":"string"}}],"put":{"tags":["Хранилище файлов (админка)"],"summary":"Признак «Тестовый аккаунт — без ограничений хранилища»","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true — отметить воркспейс тестовым аккаунтом (без ограничений хранилища), false — снять отметку","example":true}}}}}},"responses":{"200":{"description":"Объём после изменения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageRoomUsage"}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/storageadmin/{id}/recount":{"parameters":[{"in":"path","name":"id","required":true,"description":"id воркспейса","schema":{"type":"string"}}],"post":{"tags":["Хранилище файлов (админка)"],"summary":"Пересчитать вес вложений воркспейса по файлам на диске","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Счётчик до и после, байты","content":{"application/json":{"schema":{"type":"object","properties":{"before":{"type":"integer","description":"Счётчик вложений до пересчёта, байты","example":52428800},"after":{"type":"integer","description":"Счётчик вложений после пересчёта (по файлам на диске), байты","example":52431001}}}}}}}}},"/storage":{"get":{"tags":["Хранилище файлов"],"summary":"Содержимое папки Хранилища (без folderid — корень)","description":"Возвращает видимые пользователю вложенные папки и файлы, путь для «хлебных крошек» и занятое место. Папки видны по правилам папок шаблонов (группы, «только администраторы»); закрытая папка скрывает всё, что внутри. Право storage:view. Хранилище доступно только воркспейсам, которым его включил администратор сервиса, иначе 403.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"folderid","required":false,"description":"id папки (24 шестнадцатеричных символа); не передан или пустая строка — корень Хранилища","schema":{"type":"string"},"example":"62bb25949213f16bcd934422"}],"responses":{"200":{"description":"Содержимое папки","content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"type":"object","description":"Текущая папка; нет поля — открыт корень","properties":{"id":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"},"name":{"type":"string","description":"Название папки","example":"Договоры 2026"},"groups":{"type":"array","description":"id групп, которым видна папка; пустой — видят все","items":{"type":"string","description":"id группы пользователей"}},"adminAccessOnly":{"type":"boolean","description":"Папка только для администраторов воркспейса","example":false}}},"path":{"type":"array","description":"Путь от корня до текущей папки включительно (для «хлебных крошек»); пустой — корень","items":{"type":"object","properties":{"id":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"},"name":{"type":"string","description":"Название папки","example":"Договоры 2026"}}}},"folders":{"type":"array","description":"Вложенные папки, по порядку (position, затем имя)","items":{"$ref":"#/components/schemas/StorageFolder"}},"files":{"type":"array","description":"Файлы папки, по порядку (position, затем имя)","items":{"$ref":"#/components/schemas/StorageFile"}},"usage":{"description":"Занятое место и лимит воркспейса","allOf":[{"$ref":"#/components/schemas/StorageRoomUsage"}]},"canTrash":{"type":"boolean","description":"Пользователь — администратор воркспейса и может работать с Корзиной","example":true},"trash":{"type":"object","description":"Сколько в Корзине (только при canTrash = true)","properties":{"files":{"type":"integer","description":"Файлов в Корзине, включая файлы внутри удалённых папок","example":3},"folders":{"type":"integer","description":"Удалённых папок (только удалённые напрямую, без вложенных)","example":1}}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено воркспейсу или нет права storage:view"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/tree":{"get":{"tags":["Хранилище файлов"],"summary":"Дерево доступных папок Хранилища","description":"Все видимые пользователю папки в виде дерева (для окон «Переместить» и «Отправить в Хранилище»). Право storage:view.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Папки верхнего уровня с вложенными","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StorageTreeNode"}},"example":[{"id":"62bb25949213f16bcd934422","name":"Договоры 2026","children":[{"id":"62bb25949213f16bcd934424","name":"Аренда"}]}]}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено воркспейсу или нет права storage:view"}}}},"/storage/trash":{"get":{"tags":["Хранилище файлов"],"summary":"Корзина Хранилища","description":"Удалённые напрямую папки и файлы (вложенное в удалённую папку отдельно не показывается) и сколько дней осталось до автоматической очистки. Только администраторы воркспейса (группа с признаком администратора воркспейса), иначе 403.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Содержимое Корзины","content":{"application/json":{"schema":{"type":"object","properties":{"retentionDays":{"type":"integer","description":"Сколько дней элементы хранятся в Корзине до окончательного удаления (настройка сервера STORAGE_TRASH_DAYS, по умолчанию 10)","example":10},"folders":{"type":"array","description":"Удалённые папки","items":{"allOf":[{"$ref":"#/components/schemas/StorageFolder"},{"$ref":"#/components/schemas/StorageTrashMeta"},{"type":"object","properties":{"filesCount":{"type":"integer","description":"Сколько файлов удалено вместе с папкой (на любой глубине)","example":2},"size":{"type":"integer","description":"Общий размер этих файлов, байты","example":508024}}}]}},"files":{"type":"array","description":"Удалённые файлы","items":{"allOf":[{"$ref":"#/components/schemas/StorageFile"},{"$ref":"#/components/schemas/StorageTrashMeta"}]}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или пользователь не администратор воркспейса"}}}},"/storage/trash/restore":{"post":{"tags":["Хранилище файлов"],"summary":"Восстановить элементы из Корзины","description":"Элемент и всё, что удалено вместе с ним, возвращается на прежнее место; если прежней папки уже нет — в корень. При совпадении имени добавляется суффикс «_2», «_3»… Только администраторы воркспейса, право storage:delete.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageItems"}}}},"responses":{"201":{"description":"Восстановлено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageOk"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или пользователь не администратор воркспейса"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/trash/delete":{"post":{"tags":["Хранилище файлов"],"summary":"Удалить из Корзины навсегда (без items — очистить всю Корзину)","description":"Файлы удаляются с диска, занятое место освобождается. Отменить нельзя. Только администраторы воркспейса, право storage:delete.","security":[{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Удаляемые элементы Корзины (1–500); не передано — очищается вся Корзина","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/StorageItemRef"},"example":[{"type":"file","id":"62bb25949213f16bcd934423"}]}}}}}},"responses":{"201":{"description":"Сколько удалено и сколько места освобождено","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"integer","description":"Удалено файлов","example":1},"folders":{"type":"integer","description":"Удалено папок","example":0},"freed":{"type":"integer","description":"Освобождено места, байты","example":254012}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или пользователь не администратор воркспейса"}}}},"/storage/usage":{"get":{"tags":["Хранилище файлов"],"summary":"Занятое место и лимит Хранилища воркспейса","description":"Право storage:view; Хранилище должно быть подключено воркспейсу, иначе 403.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Занятое место и лимиты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageRoomUsage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено воркспейсу"}}}},"/storage/folders":{"post":{"tags":["Хранилище файлов"],"summary":"Создать папку в Хранилище","description":"Имя — до 100 символов: цифры, пробелы, «-», «_», латинские и русские буквы; в одной родительской папке имена не повторяются (без учёта регистра). Право storage:create.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100,"description":"Название папки (лишние пробелы убираются)","example":"Договоры 2026"},"parentid":{"type":"string","nullable":true,"description":"id родительской папки; null, пустая строка или не передано — папка создаётся в корне","example":"62bb25949213f16bcd934421"},"groups":{"type":"array","description":"id групп пользователей, которым видна папка; пустой или не передан — видят все","items":{"type":"string","description":"id группы пользователей"},"example":["62bb25949213f16bcd934430"]},"adminAccessOnly":{"type":"boolean","description":"Папка только для администраторов воркспейса","example":false}}}}}},"responses":{"201":{"description":"Созданная папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageFolder"}}}},"400":{"description":"Неверные данные (имя недопустимо, папка с таким именем уже есть)"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:create"},"404":{"description":"Родительская папка не найдена или скрыта от пользователя"}}}},"/storage/folders/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"put":{"tags":["Хранилище файлов"],"summary":"Изменить папку Хранилища (имя, доступ, перенос)","description":"Не присланные поля не меняются. Перенос в саму себя или во вложенную папку запрещён. Право storage:edit.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"Новое название папки (те же ограничения, что при создании)","example":"Договоры 2026"},"parentid":{"type":"string","nullable":true,"description":"Новая родительская папка; null или пустая строка — перенести в корень; не передано — не переносить","example":"62bb25949213f16bcd934421"},"groups":{"type":"array","description":"id групп пользователей, которым видна папка (заменяет прежний список)","items":{"type":"string","description":"id группы пользователей"},"example":["62bb25949213f16bcd934430"]},"adminAccessOnly":{"type":"boolean","description":"Папка только для администраторов воркспейса (false снимает ограничение)","example":false}}}}}},"responses":{"200":{"description":"Изменённая папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageFolder"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:edit"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Хранилище файлов"],"summary":"Удалить папку Хранилища в Корзину","description":"Папка со всем содержимым перемещается в Корзину; место освобождается только при окончательном удалении. Если внутри есть папки, скрытые от пользователя, — ошибка 400. Право storage:delete.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"id удалённой папки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:delete"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/files":{"post":{"tags":["Хранилище файлов"],"summary":"Загрузить файлы в Хранилище","description":"Имя файла приводится к допустимому (недопустимые символы заменяются на «_»), при совпадении в папке добавляется суффикс «_2», «_3»… Если место Хранилища закончилось или Хранилище без объёма — ошибка 400. Право storage:create.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"array","description":"Загружаемые файлы (одно или несколько полей file)","items":{"type":"string","format":"binary","description":"Содержимое файла"}},"folderid":{"type":"string","description":"id папки, куда загрузить; не передано или пустая строка — в корень","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Загруженные файлы","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StorageFile"}}}}},"400":{"description":"Нет файлов, превышен объём Хранилища или Хранилище без объёма"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:create"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/files/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"put":{"tags":["Хранилище файлов"],"summary":"Переименовать файл Хранилища","description":"Меняется имя без расширения; в папке не должно быть файла с тем же именем и расширением. Право storage:edit.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100,"description":"Новое имя без расширения (цифры, пробелы, «-», «_», латинские и русские буквы)","example":"Договор аренды"}}}}}},"responses":{"200":{"description":"Изменённый файл","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageFile"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:edit"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Хранилище файлов"],"summary":"Удалить файл Хранилища в Корзину","description":"Место освобождается только при окончательном удалении из Корзины. Право storage:delete.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"id удалённого файла","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:delete"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/files/{id}/download":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Хранилище файлов"],"summary":"Скачать файл Хранилища","description":"Отдаёт содержимое файла с исходным MIME-типом и именем (Content-Disposition attachment). Право storage:view.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Содержимое файла","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:view"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/move":{"put":{"tags":["Хранилище файлов"],"summary":"Переместить папки и файлы в другую папку","description":"Перенос перетаскиванием. Перемещённые элементы встают в конец целевой папки; при совпадении имени файла добавляется суффикс «_2», «_3»… Право storage:edit.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","description":"Перемещаемые элементы (1–500)","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/StorageItemRef"},"example":[{"type":"file","id":"62bb25949213f16bcd934423"}]},"folderid":{"type":"string","nullable":true,"description":"Целевая папка; null, пустая строка или не передано — корень","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"200":{"description":"Перемещено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageOk"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:edit"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/order":{"put":{"tags":["Хранилище файлов"],"summary":"Задать порядок элементов внутри папки","description":"Позиции присваиваются по порядку items (папки и файлы вместе). Право storage:edit.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","description":"Элементы папки в желаемой последовательности (1–500)","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/StorageItemRef"},"example":[{"type":"folder","id":"62bb25949213f16bcd934424"},{"type":"file","id":"62bb25949213f16bcd934423"}]},"folderid":{"type":"string","nullable":true,"description":"Папка, внутри которой меняется порядок; null, пустая строка или не передано — корень","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"200":{"description":"Порядок сохранён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageOk"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:edit"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/storage/fromdocument":{"post":{"tags":["Хранилище файлов"],"summary":"Отправить PDF документа в Хранилище","description":"Кнопка «Отправить в Хранилище» в карточке документа: в папку кладётся PDF — подписанный, если документ подписан, иначе текущий вид. Имя файла — название документа. Документ, скрытый от пользователя, отправить нельзя. Учитывается лимит Хранилища. Право storage:create.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["render","externalInfill"],"description":"Тип документа: render — документ (рендер шаблона, в т.ч. с УКЭП), externalInfill — внешнее заполнение (ПЭП)","example":"render"},"id":{"type":"string","description":"id документа","example":"62bb25949213f16bcd934440"},"folderid":{"type":"string","nullable":true,"description":"Папка Хранилища; null, пустая строка или не передано — корень","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Созданный файл","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageFile"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Хранилище не подключено или нет права storage:create"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/smsgateway":{"get":{"tags":["SMS gateway"],"summary":"Настройки своего СМС шлюза","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки (секреты — только администраторам WS при включённом режиме)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsGatewaySettings"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["SMS gateway"],"summary":"Сохранить подключение (администратор WS, режим включён)","description":"Нужен ключ API или логин вместе с паролем (частично заполненное подключение не сохраняется). Для password, apiKey, login и senderName: строка — задать, null — удалить, не передавать — оставить прежнее. Пароль и ключ хранятся зашифрованно. Подключение не заполнено — СМС идут через шлюз сервиса, ПЭП тарифицируются обычно.\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["smsc"],"description":"Провайдер СМС (только smsc — smsc.ru)","example":"smsc"},"login":{"type":"string","nullable":true,"maxLength":100,"description":"Логин аккаунта smsc.ru; null — удалить, не передан — без изменений","example":"MD_Orsk"},"password":{"type":"string","nullable":true,"maxLength":200,"description":"Пароль аккаунта smsc.ru (нужен вместе с логином); null — удалить, не передан — без изменений","example":"secret-password"},"apiKey":{"type":"string","nullable":true,"maxLength":200,"description":"Ключ API smsc.ru (вместо логина и пароля); null — удалить, не передан — без изменений","example":"4f9c1b2a7d3e8f60"},"senderName":{"type":"string","nullable":true,"pattern":"^[A-Za-z0-9. _-]{0,32}$","description":"Имя отправителя smsc.ru — до 32 символов (латиница, цифры, точка, дефис, подчёркивание, пробел); null — по умолчанию сервиса","example":"DataDoc"}}}}}},"responses":{"200":{"description":"Настройки после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsGatewaySettings"}}}},"400":{"description":"Режим не включён, подключение заполнено не полностью, неверные данные"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}},"delete":{"tags":["SMS gateway"],"summary":"Удалить подключение (СМС снова идут через шлюз сервиса)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки после удаления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsGatewaySettings"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/smsgateway/check":{"post":{"tags":["SMS gateway"],"summary":"Проверка подключения (запрос баланса smsc.ru, СМС не отправляется)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"ok true и баланс либо ok false и текст ошибки провайдера","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"Провайдер принял учётные данные","example":true},"balance":{"type":"string","description":"Баланс аккаунта smsc.ru (только при ok true)","example":"1250.50"},"currency":{"type":"string","description":"Валюта баланса (только при ok true)","example":"RUR"},"error":{"type":"string","description":"Текст ошибки провайдера (только при ok false)","example":"authorise error"}}}}}},"400":{"description":"Подключение не настроено или режим не включён, нет связи с провайдером"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Не администратор рабочего пространства"}}}},"/workspace/signaturetariffs/my":{"get":{"tags":["Рабочее пространство"],"summary":"Прайс ПЭП воркспейса","description":"Как /workspace/signaturetariffs, но при активном своём СМС шлюзе цена за одну ПЭП особая (по умолчанию 5 руб., SIGNATURE_CUSTOM_SMS_PRICE), скидка за объём применяется как обычно. /workspace/signaturetariffs/price и покупка ПЭП считают так же.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Список ступеней прайса"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/workspaces/{id}/smscustom":{"put":{"tags":["Рабочие пространства"],"summary":"Администратор сервиса включает или выключает «Свой СМС шлюз»","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"id воркспейса","schema":{"type":"string","example":"62bb25949213f16bcd934422"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["smsCustom"],"properties":{"smsCustom":{"type":"boolean","description":"true — включить режим «Свой СМС шлюз», false — выключить","example":true}}}}}},"responses":{"200":{"description":"Состояние флагов (smsCustom, smsFree, smsCustomActive, smsFreeActive)"},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/workspaces/{id}/smsfree":{"put":{"tags":["Рабочие пространства"],"summary":"Администратор сервиса включает или выключает «Бесплатные СМС» (нужен «Свой СМС шлюз»)","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"id воркспейса","schema":{"type":"string","example":"62bb25949213f16bcd934422"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["smsFree"],"properties":{"smsFree":{"type":"boolean","description":"true — включить «Бесплатные СМС» (только при включённом «Свой СМС шлюз»), false — выключить","example":true}}}}}},"responses":{"200":{"description":"Состояние флагов"},"400":{"description":"«Свой СМС шлюз» не включён"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signersadmin":{"get":{"tags":["Внешние подписанты (админка)"],"summary":"Внешние подписанты: список и поиск по email/коду/ИНН","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"q","description":"Поиск по части email, кода подписанта, ИНН identity или ФИО, без учёта регистра, до 200 символов","schema":{"type":"string"}},{"in":"query","name":"status","description":"Фильтр: active — не заблокированные, blocked — заблокированные, pinlocked — с паузой пина после неверных вводов","schema":{"type":"string"}},{"in":"query","name":"dateFrom","description":"Дата регистрации подписанта: с этой даты (ISO 8601)","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"dateTo","description":"Дата регистрации подписанта: по эту дату (ISO 8601)","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"from","description":"Индекс первой записи страницы, с 0 (не передан — 0)","schema":{"type":"string"}},{"in":"query","name":"to","description":"Индекс последней записи страницы включительно (не передан — до конца списка)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"items":[{"id":"6720a1c2d3e4f5a6b7c8d9e0","email":"signer01@example.com","name":"Петров Пётр Петрович","code":"GN348K","identities":[{"type":"person","name":"Петров Пётр Петрович","confirmed":false}],"createdAt":"2026-10-31T09:00:00.000Z","lastLoginAt":"2026-10-31T10:00:00.000Z","linksCount":1,"signedCount":3,"blocked":false}],"count":1}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signersadmin/{id}":{"parameters":[{"in":"path","name":"id","description":"id аккаунта подписанта","required":true,"schema":{"type":"string"}}],"get":{"tags":["Внешние подписанты (админка)"],"summary":"Карточка подписанта: связи и документы","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e0","links":[],"documents":[]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signersadmin/{id}/block":{"parameters":[{"in":"path","name":"id","description":"id аккаунта подписанта","required":true,"schema":{"type":"string"}}],"put":{"tags":["Внешние подписанты (админка)"],"summary":"Заблокировать / разблокировать (блокировка закрывает сессии)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"blocked":true,"reason":"По обращению"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e0","blocked":true}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signersadmin/{id}/pinunlock":{"parameters":[{"in":"path","name":"id","description":"id аккаунта подписанта","required":true,"schema":{"type":"string"}}],"put":{"tags":["Внешние подписанты (админка)"],"summary":"Снять паузу пина","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e0"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers":{"get":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Подписанты воркспейса (связи)","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"status","description":"Фильтр по статусу связи: invited — приглашён, accepted — принята, declined — отклонена, revoked — приглашение отозвано, broken — связь разорвана","schema":{"type":"string"}},{"in":"query","name":"q","description":"Поиск по части email или ИНН подписанта, без учёта регистра, до 200 символов","schema":{"type":"string"}},{"in":"query","name":"from","description":"Индекс первой записи страницы, с 0 (не передан — 0)","schema":{"type":"string"}},{"in":"query","name":"to","description":"Индекс последней записи страницы включительно (не передан — до конца списка)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"items":[{"id":"6720a9b8c7d6e5f4a3b2c1d0","email":"signer01@example.com","status":"accepted","invitedBy":"email","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z","acceptedAt":"2026-10-31T09:30:00.000Z","signer":{"code":"GN348K","registered":true,"name":"Петров Пётр Петрович","identity":{"type":"person","name":"Петров Пётр Петрович","confirmed":false}}}],"count":1}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/find":{"get":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Найти подписанта по коду, ИНН (подтверждённые компании) или email","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"code","description":"Код подписанта (например GN348K), до 20 символов. Нужен один из параметров code, email, inn; проверяются в порядке code → email → inn","schema":{"type":"string"}},{"in":"query","name":"inn","description":"ИНН подтверждённой компании или ИП подписанта; у нескольких подписантов одной компании возвращается только компания","schema":{"type":"string"}},{"in":"query","name":"email","description":"Email подписанта","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"found":true,"code":"GN348K","email":"s***1@example.com","companies":[{"name":"ООО Подписант","inn":"7701234567"}],"link":{"id":"6720a9b8c7d6e5f4a3b2c1d0","status":"accepted"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/agreement":{"get":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Соглашение кабинета у отправителя: принято ли (до первой отправки)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"slug":"soglashenie-pep-kabinet-podpisanta","version":"2026-10-31T09:00:00.000Z","accepted":true,"required":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Отправитель принимает соглашение (редакция, сумма, время, IP, пользователь)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"version":"2026-10-31T09:00:00.000Z"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"accepted":true,"required":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/bycode/{code}":{"parameters":[{"in":"path","name":"code","description":"Код подписанта (например GN348K), до 20 символов","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Страница /docs/КОД/ для вошедшего клиента: связь и профиль (если принята)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"code":"GN348K","exists":true,"link":{"id":"6720a9b8c7d6e5f4a3b2c1d0","email":"signer01@example.com","status":"accepted","invitedBy":"email","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z","acceptedAt":"2026-10-31T09:30:00.000Z","signer":{"code":"GN348K","registered":true,"name":"Петров Пётр Петрович","identity":{"type":"person","name":"Петров Пётр Петрович","confirmed":false}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/invite":{"post":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Пригласить к сотрудничеству: по email, коду, ссылке, ИНН","description":"Нет аккаунта — письмо с регистрацией. Связь привязывается к контрагенту (передан, найден по ИНН или создан).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"by":"email","email":"signer01@example.com","counteragentId":"6720c1d2e3f4a5b6c7d8e9f0","senderName":"ООО Отправитель"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","email":"signer01@example.com","status":"invited","invitedBy":"email","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z","acceptedAt":"2026-10-31T09:30:00.000Z","signer":{"code":"GN348K","registered":true,"name":"Петров Пётр Петрович","identity":{"type":"person","name":"Петров Пётр Петрович","confirmed":false}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/{id}":{"parameters":[{"in":"path","name":"id","description":"id связи с подписантом (из GET /signers)","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Связь и её документы","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","email":"signer01@example.com","status":"accepted","invitedBy":"email","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z","acceptedAt":"2026-10-31T09:30:00.000Z","signer":{"code":"GN348K","registered":true,"name":"Петров Пётр Петрович","identity":{"type":"person","name":"Петров Пётр Петрович","confirmed":false}},"documents":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"sent","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/{id}/remind":{"parameters":[{"in":"path","name":"id","description":"id связи с подписантом (из GET /signers)","required":true,"schema":{"type":"string"}}],"post":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Повторить письмо-приглашение (раз в час)","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/{id}/revoke":{"parameters":[{"in":"path","name":"id","description":"id связи с подписантом (из GET /signers)","required":true,"schema":{"type":"string"}}],"put":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Отозвать приглашение","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","email":"signer01@example.com","status":"revoked","invitedBy":"email","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z","acceptedAt":"2026-10-31T09:30:00.000Z","signer":{"code":"GN348K","registered":true,"name":"Петров Пётр Петрович","identity":{"type":"person","name":"Петров Пётр Петрович","confirmed":false}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signers/{id}/break":{"parameters":[{"in":"path","name":"id","description":"id связи с подписантом (из GET /signers)","required":true,"schema":{"type":"string"}}],"put":{"tags":["Подписанты: связи и приглашения (пользователь)"],"summary":"Разорвать связь: ждущие подписи документы отзываются, подписанные остаются","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","email":"signer01@example.com","status":"broken","invitedBy":"email","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z","acceptedAt":"2026-10-31T09:30:00.000Z","signer":{"code":"GN348K","registered":true,"name":"Петров Пётр Петрович","identity":{"type":"person","name":"Петров Пётр Петрович","confirmed":false}},"revokedDocuments":2}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments":{"post":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Отправить в кабинет подписанта: документ или комплект","description":"Документ: по шаблону, свой файл («пустой шаблон») или рендер, подписанный клиентом УКЭП ({renderId}). Нет подписей — signature.limitexceeded; связь не принята — signerlink.notaccepted; соглашение не принято — signers.agreement.required.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"linkId":"6720a9b8c7d6e5f4a3b2c1d0","bundleName":"Договор и акт","documents":[{"templateId":"66f1a2b3c4d5e6f7a8b9c0d1","sideValues":[{"tattrValues":{"101":"Петров"},"tableValues":[],"articleValues":[]}]},{"file":{"name":"Акт.pdf","mimetype":"application/pdf","content":"JVBERi0xLjQK..."}}]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"bundle":{"id":"6720b1c2d3e4f5a6b7c8d9e0","name":"Договор и акт"},"documents":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","status":"sent","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT"}]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"get":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Документы, отправленные в кабинет","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"linkId","description":"id связи с подписантом — только документы этого подписанта","schema":{"type":"string"}},{"in":"query","name":"status","description":"Фильтр по статусу: sent — отправлен, viewed — просмотрен, signed — подписан, rejected — отклонён, revoked — отозван","schema":{"type":"string"}},{"in":"query","name":"bundleId","description":"id комплекта — только документы этого комплекта","schema":{"type":"string"}},{"in":"query","name":"massId","description":"id массовой отправки — только документы этой отправки","schema":{"type":"string"}},{"in":"query","name":"q","description":"Поиск по части названия документа, без учёта регистра, до 200 символов","schema":{"type":"string"}},{"in":"query","name":"from","description":"Индекс первой записи страницы, с 0 (не передан — 0)","schema":{"type":"string"}},{"in":"query","name":"to","description":"Индекс последней записи страницы включительно (не передан — до конца списка)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"items":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"sent","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}],"count":1}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/mass":{"post":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Массовая отправка нескольким подписантам","description":"Каждому — свой документ/комплект; общий список documents или свой у получателя.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"name":"Рассылка договоров","documents":[{"file":{"name":"Договор.pdf","mimetype":"application/pdf","content":"JVBERi0xLjQK..."}}],"items":[{"linkId":"6720a9b8c7d6e5f4a3b2c1d0"},{"linkId":"6720a9b8c7d6e5f4a3b2c1d1"}]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720d1e2f3a4b5c6d7e8f9a0","name":"Рассылка договоров","summary":{"recipients":2,"documents":2,"signed":0,"rejected":0,"revoked":0,"pending":2},"items":[]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/bundles/{id}":{"parameters":[{"in":"path","name":"id","description":"id комплекта документов","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Комплект со сводкой","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b1c2d3e4f5a6b7c8d9e0","summary":{"total":3,"signed":2,"rejected":0,"revoked":0,"pending":1},"status":"pending","documents":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"sent","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/bundles/{id}/revoke":{"parameters":[{"in":"path","name":"id","description":"id комплекта документов","required":true,"schema":{"type":"string"}}],"put":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Отозвать ждущие документы комплекта","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b1c2d3e4f5a6b7c8d9e0","status":"revoked"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/mass/{id}":{"parameters":[{"in":"path","name":"id","description":"id массовой отправки","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Массовая отправка: статусы по получателям","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720d1e2f3a4b5c6d7e8f9a0","summary":{"recipients":2,"documents":2,"signed":1,"rejected":0,"revoked":0,"pending":1},"items":[]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/mass/{id}/remind":{"parameters":[{"in":"path","name":"id","description":"id массовой отправки","required":true,"schema":{"type":"string"}}],"post":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Напомнить всем, у кого есть ждущие документы","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720d1e2f3a4b5c6d7e8f9a0","reminded":1}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/mass/{id}/excel":{"parameters":[{"in":"path","name":"id","description":"id массовой отправки","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Выгрузка статусов массовой отправки (XLSX)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/{id}":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Документ кабинета","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"sent","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","signer":{"email":"signer01@example.com","code":"GN348K","name":"Петров Пётр Петрович"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/{id}/revoke":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"put":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Отозвать документ (ждёт подписи)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"revoked","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/{id}/remind":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"post":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"Напомнить подписанту (раз в час)","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b2c3d4e5f6a7b8c9d0e1"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signerdocuments/{id}/archive":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"get":{"tags":["Подписанты: отправка в кабинет (пользователь)"],"summary":"ZIP подписанного","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinetpublic/code/{code}":{"parameters":[{"in":"path","name":"code","description":"Код подписанта (например GN348K), регистр не важен, до 20 символов","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (публичные)"],"summary":"Есть ли подписант с таким кодом (страница /docs/КОД/)","description":"Регистр не важен; без имени и документов; 20 запросов в минуту с IP.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"code":"GN348K","exists":true}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinetpublic/agreement":{"get":{"tags":["Кабинет подписанта (публичные)"],"summary":"Текущая редакция соглашения о ПЭП кабинета","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"version":"2026-10-31T09:00:00.000Z","slug":"soglashenie-pep-kabinet-podpisanta"}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinetpublic/availability":{"get":{"tags":["Кабинет подписанта (публичные)"],"summary":"Доступен ли кабинет подписанта (показывать ли его на сайте)","description":"enabled: true, если подпись в кабинете включена глобальной настройкой или хотя бы в одном рабочем пространстве.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true — кабинет подписанта включён (глобально или хотя бы в одном рабочем пространстве)"}}},"example":{"enabled":true}}}}}}},"/signercabinet/register":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Регистрация: email (+ пароль при ссылке-приглашении); ссылка подтверждения уходит на email","description":"Пароль принимается только с действующим token ссылки-приглашения (email подтверждается сразу, выдаётся сессия). Без него пароль не сохраняется: его задаёт владелец ссылки подтверждения (POST /signercabinet/register/confirm). Повторная регистрация неподтверждённого email аккаунт не меняет, только отправляет новую ссылку.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com","name":"Петров Пётр Петрович","lang":"ru"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com","linkSent":true}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinet/register/resend":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Повтор кода подтверждения (не чаще раза в минуту)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com","codeSent":true}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinet/register/confirm":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Подтверждение email по ссылке из письма: пароль, аккаунт, код подписанта, сессия","description":"token — из ссылки письма (одноразовый). Пароль задаёт владелец ссылки. Приглашения на этот email привязываются к аккаунту.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com","token":"9c1e...4b","password":"Password-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"token":"4f1c...e9","expiresAt":"2026-11-30T10:00:00.000Z","account":{"id":"6720a1c2d3e4f5a6b7c8d9e0","email":"signer01@example.com","name":"Петров Пётр Петрович","code":"GN348K","lang":"ru","onboarding":{"emailVerified":true,"agreementAccepted":true,"agreementVersion":"2026-10-31T09:00:00.000Z","currentAgreementVersion":"2026-10-31T09:00:00.000Z","agreementRequired":false,"pinSet":true},"pin":{"failures":0},"identities":[{"id":"6720a1c2d3e4f5a6b7c8d9e1","type":"person","name":"Петров Пётр Петрович","confirmed":false}],"mustChangePassword":false}}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinet/login":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Вход: только email + пароль","description":"Сессия 30 дней, продлевается каждым запросом (заголовок X-Signer-Session-Expires). Вход по одноразовому паролю — mustChangePassword: true.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com","password":"Password-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"token":"4f1c...e9","expiresAt":"2026-11-30T10:00:00.000Z","account":{"id":"6720a1c2d3e4f5a6b7c8d9e0","email":"signer01@example.com","name":"Петров Пётр Петрович","code":"GN348K","lang":"ru","onboarding":{"emailVerified":true,"agreementAccepted":true,"agreementVersion":"2026-10-31T09:00:00.000Z","currentAgreementVersion":"2026-10-31T09:00:00.000Z","agreementRequired":false,"pinSet":true},"pin":{"failures":0},"identities":[{"id":"6720a1c2d3e4f5a6b7c8d9e1","type":"person","name":"Петров Пётр Петрович","confirmed":false}],"mustChangePassword":false},"mustChangePassword":false}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinet/password/reset":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Сброс пароля: одноразовый пароль на email (1 час)","description":"Ответ одинаковый, есть аккаунт или нет.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"email":"signer01@example.com"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"sent":true}}}},"400":{"$ref":"#/components/responses/InvalidData"}}}},"/signercabinet/password":{"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Смена пароля (после одноразового пароля — без старого)","description":"Закрывает остальные сессии и выдаёт новую; письмо о смене пароля.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"password":"Password-2","oldPassword":"Password-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"token":"a1b2...","expiresAt":"2026-11-30T10:00:00.000Z"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/logout":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Выход (закрыть сессию)","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/profile":{"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Профиль: шаги (email, соглашение, пин), пауза пина, identities","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e0","email":"signer01@example.com","name":"Петров Пётр Петрович","code":"GN348K","lang":"ru","onboarding":{"emailVerified":true,"agreementAccepted":true,"agreementVersion":"2026-10-31T09:00:00.000Z","currentAgreementVersion":"2026-10-31T09:00:00.000Z","agreementRequired":false,"pinSet":true},"pin":{"failures":0},"identities":[{"id":"6720a1c2d3e4f5a6b7c8d9e1","type":"person","name":"Петров Пётр Петрович","confirmed":false}],"mustChangePassword":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Изменить ФИО и язык (email и код подписанта не меняются)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"name":"Петров Пётр Петрович","lang":"ru"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e0","email":"signer01@example.com","name":"Петров Пётр Петрович","code":"GN348K","lang":"ru","onboarding":{"emailVerified":true,"agreementAccepted":true,"agreementVersion":"2026-10-31T09:00:00.000Z","currentAgreementVersion":"2026-10-31T09:00:00.000Z","agreementRequired":false,"pinSet":true},"pin":{"failures":0},"identities":[{"id":"6720a1c2d3e4f5a6b7c8d9e1","type":"person","name":"Петров Пётр Петрович","confirmed":false}],"mustChangePassword":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/agreement":{"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Текущая редакция соглашения о ПЭП и принятая подписантом","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"version":"2026-10-31T09:00:00.000Z","hash":"3a7bd3e2...","slug":"soglashenie-pep-kabinet-podpisanta","required":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Принять соглашение (редакция, контрольная сумма, время, IP)","description":"Новая редакция (изменён юридический документ soglashenie-pep-kabinet-podpisanta) — подписант принимает её заново перед подписью.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"version":"2026-10-31T09:00:00.000Z"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"agreement":{"version":"2026-10-31T09:00:00.000Z","hash":"3a7bd3e2...","acceptedAt":"2026-10-31T10:00:00.000Z","ip":"203.0.113.5"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/pin":{"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Задать или сменить пин (ровно 4 цифры, 0 допустим); смена — с паролем","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"pin":"0412","password":"Password-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"pinSet":true}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/pin/reset":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"«Забыл пин»: код на email (30 минут)","security":[{"BearerAuth":[]}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"sent":true}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Новый пин по коду из письма (снимает паузу)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"code":"123456","pin":"0412"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"pinSet":true}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/identities":{"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"От чьего имени подписывает: физлицо, самозанятый, ИП, компания","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":[{"id":"6720a1c2d3e4f5a6b7c8d9e1","type":"person","name":"Петров Пётр Петрович","confirmed":false}]}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Добавить identity физлица или самозанятого","description":"Типы individual (ИП) и entity (компания) здесь не принимаются (signercabinet.identity.bycertificate): их добавляют по УКЭП через GET /signercabinet/identities/company/challenge и POST /signercabinet/identities/company. ИНН, если передан, — 12 цифр.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","name"],"properties":{"type":{"type":"string","enum":["person","selfemployed"],"description":"Тип: person — физлицо, selfemployed — самозанятый"},"name":{"type":"string","description":"ФИО"},"inn":{"type":"string","description":"ИНН, 12 цифр (необязательно)"},"kpp":{"type":"string","maxLength":20,"description":"КПП (необязательно)"}}},"example":{"type":"selfemployed","name":"Петров Пётр Петрович","inn":"770123456789"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerCabinetIdentity"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e2","type":"selfemployed","name":"Петров Пётр Петрович","inn":"770123456789","confirmed":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/identities/{id}":{"parameters":[{"in":"path","name":"id","description":"id identity (от чьего имени подписывает) из GET /signercabinet/identities","required":true,"schema":{"type":"string"}}],"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Изменить название/КПП identity физлица или самозанятого","description":"Компания и ИП (из сертификата и реестра) вручную не меняются — signercabinet.identity.bycertificate.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Новое название или ФИО"},"kpp":{"type":"string","maxLength":20,"description":"КПП; пустая строка удаляет"}}},"example":{"name":"Петров Пётр Петрович","kpp":""}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e2"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}},"delete":{"tags":["Кабинет подписанта (подписант)"],"summary":"Удалить identity (первую — физлицо — нельзя)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e2"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/identities/company/challenge":{"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Текст заявления для подписи УКЭП при добавлении компании или ИП (действует 30 минут)","description":"Текст содержит код и email подписанта, дату и случайную строку; сохраняется в аккаунте до POST /signercabinet/identities/company или до истечения 30 минут. Новый запрос заменяет прежний текст.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Текст заявления: его подписывают УКЭП (откреплённая подпись) в браузере и передают в POST /signercabinet/identities/company"},"expiresAt":{"type":"string","format":"date-time","description":"До какого момента текст действует (30 минут с запроса)"}}},"example":{"text":"Прошу добавить организацию в кабинет подписанта GN348K (vm@datadoc.ru), 2026-11-07T10:00:00.000Z, 9f1c2b3a4d5e6f70","expiresAt":"2026-11-07T10:30:00.000Z"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/identities/company":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Добавить компанию или ИП по УКЭП (руководителя или сотрудника с МЧД)","description":"multipart: откреплённая подпись текста из GET /signercabinet/identities/company/challenge (*.sig, обязательно) и машиночитаемая доверенность (*.xml, если подписывает сотрудник). Тип и ИНН берутся из сертификата (ИНН юрлица — компания; ОГРНИП — ИП) или из МЧД (доверитель); название, КПП, ОГРН, адрес и статус — из реестра (DaData). Ликвидируемая, ликвидированная или банкротящаяся организация не добавляется (signercabinet.identity.liquidated). Identity с тем же ИНН обновляется, а не дублируется. Компания сразу подтверждена (confirmed: true). Ошибки: signercabinet.identity.challenge — текст не запрошен или истёк; signercabinet.identity.confirmfiles — нет файла .sig; signercabinet.identity.notcompany — сертификат не организации и не ИП и нет МЧД.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","description":"Файлы: подпись *.sig (обязательно) и МЧД *.xml (необязательно); тип файла определяется по расширению","items":{"type":"string","format":"binary"}}}}}}},"responses":{"200":{"description":"Добавленная (или обновлённая) identity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerCabinetIdentity"},"example":{"id":"6720a1c2d3e4f5a6b7c8d9e2","type":"entity","name":"ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"ПОДПИСАНТ\"","inn":"7701234567","kpp":"770101001","confirmed":true,"confirmedAt":"2026-11-07T10:05:00.000Z","ogrn":"1027700000000","address":"г Москва, ул Тверская, д 1","registryStatus":"ACTIVE","ownerName":"Петров Пётр Петрович","ownerTitle":"Генеральный директор"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/links":{"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Связи с клиентами (без отозванных приглашений)","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"status","description":"Фильтр по статусу связи: invited — приглашён, accepted — принята, declined — отклонена, revoked — приглашение отозвано, broken — связь разорвана","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":[{"id":"6720a9b8c7d6e5f4a3b2c1d0","status":"invited","senderName":"ООО Отправитель","invitedBy":"email","invitedAt":"2026-10-31T09:00:00.000Z","documents":{"pending":0,"signed":0}}]}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/invites/{key}":{"parameters":[{"in":"path","name":"key","description":"Ключ приглашения из ссылки письма, до 40 символов","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Приглашение по ссылке из письма (страница пригласившего)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","status":"invited","senderName":"ООО Отправитель","invitedAt":"2026-10-31T09:00:00.000Z"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/links/{id}/accept":{"parameters":[{"in":"path","name":"id","description":"id связи с клиентом (из GET /signercabinet/links)","required":true,"schema":{"type":"string"}}],"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Принять связь (в т.ч. ранее отклонённую)","description":"identityId — для ИП/компании только подтверждённая.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"identityId":"6720a1c2d3e4f5a6b7c8d9e1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","status":"accepted","acceptedAt":"2026-10-31T09:30:00.000Z"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/links/{id}/decline":{"parameters":[{"in":"path","name":"id","description":"id связи с клиентом (из GET /signercabinet/links)","required":true,"schema":{"type":"string"}}],"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Отклонить приглашение (можно принять позже, пока не отозвано)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720a9b8c7d6e5f4a3b2c1d0","status":"declined"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents":{"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Документы: ждут подписи / подписанные / отклонённые / все; поиск","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"status","description":"Фильтр: pending — ждут подписи (отправлен, просмотрен), signed — подписанные, rejected — отклонённые, all или не передан — все, кроме отозванных","schema":{"type":"string"}},{"in":"query","name":"q","description":"Поиск по части названия документа или имени отправителя, без учёта регистра, до 200 символов","schema":{"type":"string"}},{"in":"query","name":"linkId","description":"id связи с клиентом — только документы этого клиента","schema":{"type":"string"}},{"in":"query","name":"bundleId","description":"id комплекта — только документы этого комплекта","schema":{"type":"string"}},{"in":"query","name":"from","description":"Индекс первой записи страницы, с 0 (не передан — 0)","schema":{"type":"string"}},{"in":"query","name":"to","description":"Индекс последней записи страницы включительно (не передан — до конца списка)","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"items":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"sent","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","expired":false}],"count":1}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/sign":{"post":{"tags":["Кабинет подписанта (подписант)"],"summary":"Подписать выбранные документы одним вводом пина","description":"До 50 документов, можно разных отправителей. 5 неверных пинов подряд — 423 signercabinet.pin.locked на 1 час.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"ids":["6720b2c3d4e5f6a7b8c9d0e1","6720b2c3d4e5f6a7b8c9d0e2"],"pin":"0412"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"signed":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","signatureId":"2b0c7c1e-1d2f-4a6b-9b0e-6c1c1f7a8e01","signedAt":"2026-10-31T12:00:00.000Z"}],"failed":[{"id":"6720b2c3d4e5f6a7b8c9d0e2","resource":"signercabinet.document.wrongstatus","message":"Документ уже подписан, отклонён или отозван"}]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту (из GET /signercabinet/documents)","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Карточка документа (первый просмотр — статус viewed)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"viewed","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","attachments":[{"id":"6720b2c3d4e5f6a7b8c9d0f1","name":"Акт.pdf","filename":"Акт.pdf","mimetype":"application/pdf","size":10040}],"bundle":{"id":"6720b1c2d3e4f5a6b7c8d9e0","name":"Договор и акт","summary":{"total":2,"signed":1,"rejected":0,"revoked":0,"pending":1},"status":"pending"},"canSign":true,"expired":false}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}/file":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"PDF на подпись (его SHA-256 — docHash; его подписывает УКЭП)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}/attachments/{attachmentId}":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}},{"in":"path","name":"attachmentId","description":"id приложения (attachments[].id из карточки документа)","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Файл приложения","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}/signed":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Итоговый PDF со штампом (360 дней после окончания оплаты клиента)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}/archive":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"ZIP подписанного (PDF со штампом, исходный PDF, для УКЭП — .sig и МЧД)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}/signqualified":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Подписать УКЭП (свой сертификат или по МЧД)","description":"multipart: откреплённая подпись файла /file (*.sig), МЧД (*.xml) — необязательно.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","description":"Файлы: откреплённая подпись PDF из /file (*.sig, обязательно) и МЧД (*.xml, если подписывает сотрудник по доверенности)","items":{"type":"string","format":"binary"}},"certCode":{"type":"string","description":"Код (отпечаток) сертификата УКЭП, выбранного в браузере; обязательно","example":"A1B2C3D4E5F60718293A4B5C6D7E8F9012345678"},"signerName":{"type":"string","description":"ФИО владельца сертификата (из сертификата, передаёт браузер)","example":"Петров Пётр Петрович"},"companyName":{"type":"string","description":"Организация из сертификата","example":"ООО Подписант"},"companyInn":{"type":"string","description":"ИНН организации из сертификата","example":"7701234567"},"companyKpp":{"type":"string","description":"КПП организации из сертификата","example":"770101001"},"signerType":{"type":"string","enum":["entity","person","individual"],"description":"Тип владельца сертификата: entity — организация, person — физлицо, individual — ИП"},"identityId":{"type":"string","description":"id identity, от имени которой подписывается документ; не передан — identity связи с клиентом","example":"6720a1c2d3e4f5a6b7c8d9e2"}},"required":["certCode"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b2c3d4e5f6a7b8c9d0e1","signatureId":"2b0c7c1e-...","signedAt":"2026-10-31T12:00:00.000Z"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/documents/{id}/reject":{"parameters":[{"in":"path","name":"id","description":"id документа, отправленного подписанту","required":true,"schema":{"type":"string"}}],"put":{"tags":["Кабинет подписанта (подписант)"],"summary":"Отказать с причиной (письмо отправителю)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"reason":"Неверная сумма"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"rejected","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","rejectReason":"Неверная сумма"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signercabinet/bundles/{id}":{"parameters":[{"in":"path","name":"id","description":"id комплекта документов","required":true,"schema":{"type":"string"}}],"get":{"tags":["Кабинет подписанта (подписант)"],"summary":"Комплект: документы и сводка (подписано N из M)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"6720b1c2d3e4f5a6b7c8d9e0","name":"Договор и акт","senderName":"ООО Отправитель","summary":{"total":2,"signed":2,"rejected":0,"revoked":0,"pending":0},"status":"signed","documents":[{"id":"6720b2c3d4e5f6a7b8c9d0e1","name":"Договор № 12","senderName":"ООО Отправитель","status":"sent","source":"infill","infillId":"6720b2c3d4e5f6a7b8c9d0a1","urlKey":"Xq3kLm9PzT","linkId":"6720a9b8c7d6e5f4a3b2c1d0","sentAt":"2026-10-31T10:00:00.000Z","docHash":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}]}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/signtablet":{"get":{"tags":["DataDoc SIGN"],"summary":"Настройки планшета DataDoc SIGN","description":"Читают профиль ЛК и страница планшета (токен по ключу API, POST /auth/apikey). 403, если функция недоступна рабочему пространству (общая настройка signature.tablet.enabled или свойство WS signTabletAccess).","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignTabletSettings"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Функция DataDoc SIGN недоступна"}}},"put":{"tags":["DataDoc SIGN"],"summary":"Сохранить режим работы планшета","description":"Не присланное остаётся как было; multiLinkUrl = null удаляет ссылку. Режим multilink требует ссылку.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["lastdocument","multilink"],"description":"Режим планшета — lastdocument (последний документ на подпись «Сигнатурой») или multilink (открыть мульти-ссылку); не передан — без изменений","example":"multilink"},"multiLinkUrl":{"type":"string","nullable":true,"maxLength":2000,"description":"Мульти-ссылка для режима multilink — адрес http(s); null удаляет ссылку; не передан — без изменений","example":"https://datadoc.ru/ru/sign/AbCdEf/"}},"example":{"mode":"multilink","multiLinkUrl":"https://datadoc.ru/ru/sign/AbCdEf/"}}}}},"responses":{"200":{"description":"Настройки после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignTabletSettings"}}}},"400":{"description":"Неверный режим или адрес; режим multilink без ссылки"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Функция DataDoc SIGN недоступна"}}}},"/signtablet/background":{"post":{"tags":["DataDoc SIGN"],"summary":"Загрузить подложку планшета","description":"Файл (поле file) - JPEG, PNG, WebP, MP4 или WebM до 10 МБ. Новый файл заменяет прежний. Файл отдаётся публично со статического домена (адрес - в настройках).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Файл подложки (JPEG, PNG, WebP, MP4 или WebM, до 10 МБ)"}}}}}},"responses":{"201":{"description":"Настройки после загрузки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignTabletSettings"}}}},"400":{"description":"Нет файла, неверный тип, файл больше 10 МБ"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Функция DataDoc SIGN недоступна"}}},"delete":{"tags":["DataDoc SIGN"],"summary":"Удалить подложку","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки после удаления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignTabletSettings"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Функция DataDoc SIGN недоступна"}}}},"/signtablet/lastdocument":{"get":{"tags":["DataDoc SIGN"],"summary":"Последний документ пользователя на подпись «Сигнатурой»","description":"Самый новый неподписанный документ владельца токена со способом подписи «Сигнатура» - документ на заполнение и подпись (не мульти-ссылка) или готовый документ, отправленный контрагенту. Ссылка ведёт на стандартную страницу подписания.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Документ","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["externalinfill","render"],"description":"Вид документа — externalinfill (документ на заполнение и подпись) или render (готовый документ, отправленный контрагенту)"},"key":{"type":"string","description":"Ключ ссылки документа (urlKey)"},"name":{"type":"string","description":"Название документа"},"createdAt":{"type":"string","format":"date-time","description":"Дата создания (для готового документа — дата отправки на подпись)"},"url":{"type":"string","description":"Адрес страницы подписания (/<язык>/sign/<key>/ или /<язык>/s/<key>/)"}}},"example":{"kind":"externalinfill","key":"AbCdEf","name":"Договор оказания услуг","createdAt":"2026-10-30T12:00:00.000Z","url":"https://datadoc.ru/ru/sign/AbCdEf/"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Функция DataDoc SIGN недоступна"},"404":{"description":"Нет документа для подписи"}}}},"/signsettings":{"get":{"tags":["Настройки воркспейса"],"summary":"Настройки ПЭП воркспейса","description":"Каналы подписания (СМС, MAX, «Сигнатура»), выбор канала, смена номера подписантом. Читают все пользователи воркспейса.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignSettings"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Настройки воркспейса"],"summary":"Сохранить настройки ПЭП воркспейса","description":"Только администраторы воркспейса (иначе 403). Не присланные поля не меняются, лишние поля не принимаются. Включить MAX или «Сигнатуру», недоступные воркспейсу, нельзя (400). Должен остаться хотя бы один включённый канал, иначе 400.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"sms":{"type":"boolean","description":"Подписание по СМС","example":true},"max":{"type":"boolean","description":"Подписание через MAX","example":false},"draw":{"type":"boolean","description":"Подписание «Сигнатурой» (рисунком подписи)","example":false},"drawForbidNoPressure":{"type":"boolean","description":"«Сигнатура»: запрещать подпись без силы нажатия (сервер определяет по точкам рисунка)","example":false},"drawForbidNoGeo":{"type":"boolean","description":"«Сигнатура»: запрещать подпись без геолокации","example":false},"signChannelChoice":{"type":"boolean","description":"Выбор канала подписания при создании документа","example":true},"signChangePhone":{"type":"boolean","description":"Разрешить подписанту сменить номер телефона","example":false}}}}}},"responses":{"200":{"description":"Настройки после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignSettings"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Пользователь не администратор воркспейса"}}}},"/sharedtemplatespublic":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Получить список общих шаблонов","parameters":[{"in":"query","name":"query","description":"Слово для поиска (поиск по регулярному выражению, поиск идёт и по ключевым словам, имени папкок и категориям)","schema":{"type":"string"}},{"in":"query","name":"name","description":"Имя шаблона (поиск по регулярному выражению, поиск идёт и по ключевым словам)","schema":{"type":"string"}},{"in":"query","name":"folderid","description":"id папки (поиск по точному совпадению)","schema":{"type":"string"}},{"in":"query","name":"hashtags","description":"Список хештегов через запятую (поиск по точному совпадению)","example":"#sometag,#test","schema":{"type":"string"}},{"in":"query","name":"categories","description":"Список ID категорий через запятую (поиск по точному совпадению)","example":"656db153002470a86ca9a081,656f6f0f0178bdbbf63a543c","schema":{"type":"string"}}],"description":"Возвращаются только принятые (approved) шаблоны; параметр approved здесь не учитывается.","responses":{"200":{"description":"Возвращается список общих шаблонов по заданным условиям","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","description":"Найденные общие шаблоны (только принятые)","items":{"type":"object","properties":{"id":{"type":"string","description":"ID шаблона","example":"656f370fd7093eb47b2ad51f"},"name":{"type":"string","description":"Название шаблона","example":"Шаблон"},"translatedName":{"type":"string","description":"Translated name","example":"Nazvanie_shablona"},"description":{"type":"string","description":"Краткое описание шаблона","example":"Это такой классный шаблон, ни у кого такого нет!"},"seo":{"type":"string","description":"HTML для SEO","example":"<some><seo><tags></tags></seo></some>"},"keyWords":{"type":"array","description":"Ключевые слова для поиска шаблона","items":{"type":"string","description":"Какое-то ключевое слово","example":"Шаблон"}},"hashtags":{"type":"array","description":"Хештеги шаблона","items":{"type":"string","description":"Какой-то хештег слово","example":"shablon"}},"categories":{"type":"array","description":"ID категорий, к которым относится шаблон","items":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"}},"previews":{"type":"array","description":"Превью шаблона","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}},"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"},"folder":{"description":"Общая папка шаблона (пустой объект, если шаблон не в папке)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Имя папки"},"translatedName":{"type":"string","description":"Translated name","example":"Imya_papki"}}}]}}}},"categories":{"type":"array","description":"Категории общих шаблонов, название которых совпало с query (без query — все категории)","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории (нет у корневой)","example":"656f6fb3c943707fb750e058"}}}},"folders":{"type":"array","description":"Общие папки (кроме неутверждённых), название которых совпало с query (без query — все)","items":{"type":"object"}}}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/{id}":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Получить общий шаблон по id","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID шаблона","example":"656f370fd7093eb47b2ad51f"},"name":{"type":"string","description":"Название шаблона","example":"Шаблон"},"folderid":{"type":"string","description":"ID папки","example":"656db153002470a86ca9a081"},"previews":{"type":"array","description":"Превью шаблона","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}},"description":{"type":"string","description":"Краткое описание шаблона","example":"Это такой классный шаблон, ни у кого такого нет!"},"seo":{"type":"string","description":"HTML для SEO","example":"<some><seo><tags></tags></seo></some>"},"keyWords":{"type":"array","description":"Ключевые слова для поиска шаблона","items":{"type":"string","description":"Какое-то ключевое слово","example":"Шаблон"}},"hashtags":{"type":"array","description":"Хештеги шаблона","items":{"type":"string","description":"Какой-то хештег","example":"shablon"}},"categories":{"type":"array","description":"Категории общих шаблонов, к которым относится шаблон","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Какое-то название"}}}},"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/byName/{name}":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Получить общий шаблон по translatedName","parameters":[{"in":"path","name":"name","required":true,"description":"translatedName объекта","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID шаблона","example":"656f370fd7093eb47b2ad51f"},"name":{"type":"string","description":"Название шаблона","example":"Шаблон"},"folderid":{"type":"string","description":"ID папки","example":"656db153002470a86ca9a081"},"previews":{"type":"array","description":"Превью шаблона","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}},"description":{"type":"string","description":"Краткое описание шаблона","example":"Это такой классный шаблон, ни у кого такого нет!"},"seo":{"type":"string","description":"HTML для SEO","example":"<some><seo><tags></tags></seo></some>"},"keyWords":{"type":"array","description":"Ключевые слова для поиска шаблона","items":{"type":"string","description":"Какое-то ключевое слово","example":"Шаблон"}},"hashtags":{"type":"array","description":"Хештеги шаблона","items":{"type":"string","description":"Какой-то хештег","example":"shablon"}},"categories":{"type":"array","description":"Категории общих шаблонов, к которым относится шаблон","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Какое-то название"}}}},"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/{id}/content":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Получить контент общего шаблона (для последующего редактирования)","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается контент общего шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateContent"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/{id}/sides":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Получить стороны общего шаблона","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются стороны общего шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"sides":{"type":"array","description":"Стороны последней версии шаблона с заполненными данными переменных (у шаблона без версий — пустой массив)","items":{"$ref":"#/components/schemas/TemplateSideWithFilledTattrs"}},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/{id}/previews":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Получить список превью по ID шаблона","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается массив превью шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/{id}/createrender":{"post":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Создать общий документ","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 154"},"sideValues":{"description":"Значения переменных по сторонам документа","allOf":[{"$ref":"#/components/schemas/TemplateSideValues"}]}}}}}},"responses":{"201":{"description":"Возвращается общий документ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedTemplateRender"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatespublic/{id}/render/{renderid}":{"get":{"tags":["Общие шаблоны (публичные методы)"],"summary":"Скачать документ","parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"renderid","required":true,"description":"renderid","schema":{"type":"string"}},{"in":"query","name":"format","description":"Формат","schema":{"type":"string","enum":["pdf","docx","doc"]}}],"responses":{"200":{"description":"Возвращается файл","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin":{"get":{"tags":["Общие шаблоны (Админка)"],"summary":"Получить список общих шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"query","description":"Слово для поиска (поиск по регулярному выражению, поиск идёт и по ключевым словам, имени папкок и категориям)","schema":{"type":"string"}},{"in":"query","name":"name","description":"Имя шаблона (поиск по регулярному выражению, поиск идёт и по ключевым словам)","schema":{"type":"string"}},{"in":"query","name":"folderid","description":"id папки (поиск по точному совпадению)","schema":{"type":"string"}},{"in":"query","name":"hashtags","description":"Список хештегов через запятую (поиск по точному совпадению)","example":"#sometag,#test","schema":{"type":"string"}},{"in":"query","name":"categories","description":"Список ID категорий через запятую (поиск по точному совпадению)","example":"656db153002470a86ca9a081,656f6f0f0178bdbbf63a543c","schema":{"type":"string"}},{"in":"query","name":"approved","description":"Флаг \"принят/не принят\"","example":true,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Возвращается список общих шаблонов по заданным условиям","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","description":"Найденные общие шаблоны (все, включая непринятые, если не задан approved)","items":{"allOf":[{"$ref":"#/components/schemas/SharedTemplate"},{"type":"object","properties":{"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"},"categories":{"type":"array","description":"ID категорий, к которым относится шаблон","items":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"}},"previews":{"type":"array","description":"Превью шаблона","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}},"folder":{"description":"Общая папка шаблона (пустой объект, если шаблон не в папке)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Имя папки"},"translatedName":{"type":"string","description":"Translated name","example":"Imya_papki"}}}]}}}]}},"categories":{"type":"array","description":"Категории общих шаблонов, название которых совпало с query (без query — все категории)","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории (нет у корневой)","example":"656f6fb3c943707fb750e058"}}}},"folders":{"type":"array","description":"Общие папки, название которых совпало с query (без query — все)","items":{"type":"object"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Создать новый общий шаблон","security":[{"BearerAuth":[]}],"requestBody":{"description":"Шаблон","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSharedTemplate"}}}},"responses":{"201":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedTemplate"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}":{"get":{"tags":["Общие шаблоны (Админка)"],"summary":"Получить общий шаблон по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SharedTemplate"},{"type":"object","properties":{"categories":{"type":"array","description":"Категории общих шаблонов, к которым относится шаблон","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Какое-то название"}}}},"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Общие шаблоны (Админка)"],"summary":"Обновить общий шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Шаблон","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewSharedTemplate"},{"type":"object","properties":{"approve":{"type":"boolean","description":"Флаг \"шаблон принят/не принят\"","example":true}}}]}}}},"responses":{"200":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedTemplate"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Общие шаблоны (Админка)"],"summary":"Удалить общий шаблон по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/content":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Создать контент общего шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Контент шаблона","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTemplateContent"}}}},"responses":{"201":{"description":"Возвращается id контента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/previews":{"put":{"tags":["Общие шаблоны (Админка)"],"summary":"Поменять позиции превью","security":[{"BearerAuth":[]}],"requestBody":{"description":"Массив с ID превью и их новыми позициями","required":true,"content":{"multipart/form-data":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID превью","example":"656f1dab11578466cb60025b"},"position":{"type":"integer","description":"Новая позиция превью","example":1}}}}}}},"responses":{"201":{"description":"Возвращается массив изменённых превью шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/previews":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Загрузить превью для шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для загрузки (возможна загрузка множества файлов)","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается массив созданных превью шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/previews/{previewid}":{"delete":{"tags":["Общие шаблоны (Админка)"],"summary":"Удалить превью шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"previewid","required":true,"description":"id превью","schema":{"type":"string"}}],"responses":{"201":{"description":"Возвращается ID удалённого превью шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID превью","example":"656f2e4de1fa947273c3e841"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/render":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Создание документа по шаблону","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 154"},"scale":{"type":"integer","description":"Scale документа","example":1.3},"format":{"type":"string","description":"Формат вывода","enum":["pdf","docx","doc"],"example":"pdf"},"sideValues":{"description":"Значения переменных по сторонам документа","allOf":[{"$ref":"#/components/schemas/TemplateSideValues"}]}}}}}},"responses":{"200":{"description":"Возвращается pdf файл","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/doc":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Создать общий шаблон из файла","security":[{"BearerAuth":[]}],"requestBody":{"description":"Шаблон","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"},"name":{"type":"string","description":"Наименование","example":"Договор подряда"},"folderid":{"type":"string","description":"id общей папки","example":"62bb25949213f16bcd934422"},"description":{"type":"string","description":"Описание общего шаблона","example":"Описание общего шаблона"},"keyWords":{"type":"string","description":"Слово","example":"Ключевые слова общего шаблона"},"seo":{"type":"string","description":"someseotags","example":"SEO-теги для общего шаблона"},"hashtags":{"type":"string","description":"#круто","example":"Хеш-теги для общего шаблона"}}}}}},"responses":{"201":{"description":"Возвращается шаблон","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/categories":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Создать категорию общих шаблонов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные категории","required":true,"content":{"json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории","example":"656f6fb3c943707fb750e058"}}}}}},"responses":{"201":{"description":"Возвращается созданная категория","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории","example":"656f6fb3c943707fb750e058"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/categories/{id}":{"put":{"tags":["Общие шаблоны (Админка)"],"summary":"Обновить категорию общих шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные категории","required":true,"content":{"json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории","example":"656f6fb3c943707fb750e058"}}}}}},"responses":{"201":{"description":"Возвращается категория","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории","example":"656f6fb3c943707fb750e058"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Общие шаблоны (Админка)"],"summary":"Удалить категорию общих шаблонов по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается ID удалённой категории","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/copy":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Скопировать общий шаблон в общие шаблоны","description":"Создаёт новый общий шаблон с содержимым последней версии исходного. Если копия создаётся в той же папке, к названию добавляется «копия» (в английском интерфейсе — «copy»). Последняя версия исходного шаблона помечается использованной (следующее сохранение контента создаст новую версию).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Папка назначения (тело можно не передавать — копия создаётся без папки)","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"folderid":{"type":"string","description":"ID общей папки, в которую положить копию (папка должна существовать)","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Возвращается id и translatedName созданной копии","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID нового общего шаблона","example":"6572ec6d5ef72b47965d1938"},"translatedName":{"type":"string","description":"Переведённое (транслитерированное) имя копии, уникальное","example":"Dogovor_podryada_kopiya"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/attachments":{"post":{"tags":["Общие шаблоны (Админка)"],"summary":"Загрузить файлы для шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для загрузки (возможна загрузка множества файлов)","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается массив загруженных файлов шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateAttachmentElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplatesadmin/{id}/attachments/{attachmentid}":{"delete":{"tags":["Общие шаблоны (Админка)"],"summary":"Удалить файл шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"attachmentid","required":true,"description":"id файла","schema":{"type":"string"}}],"responses":{"201":{"description":"Возвращается ID удалённого файла шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID превью","example":"656f2e4de1fa947273c3e841"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates":{"get":{"tags":["Общие шаблоны"],"summary":"Получить список общих шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"query","description":"Слово для поиска (поиск по регулярному выражению, поиск идёт и по ключевым словам, имени папкок и категориям)","schema":{"type":"string"}},{"in":"query","name":"name","description":"Имя шаблона (поиск по регулярному выражению, поиск идёт и по ключевым словам)","schema":{"type":"string"}},{"in":"query","name":"folderid","description":"id папки (поиск по точному совпадению)","schema":{"type":"string"}},{"in":"query","name":"hashtags","description":"Список хештегов через запятую (поиск по точному совпадению)","example":"#sometag,#test","schema":{"type":"string"}},{"in":"query","name":"categories","description":"Список ID категорий через запятую (поиск по точному совпадению)","example":"656db153002470a86ca9a081,656f6f0f0178bdbbf63a543c","schema":{"type":"string"}}],"description":"Пользователю возвращаются только принятые (approved) шаблоны; параметр approved здесь не учитывается.","responses":{"200":{"description":"Возвращается список общих шаблонов по заданным условиям","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","description":"Найденные общие шаблоны (только принятые)","items":{"allOf":[{"$ref":"#/components/schemas/SharedTemplate"},{"type":"object","properties":{"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"},"categories":{"type":"array","description":"ID категорий, к которым относится шаблон","items":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"}},"previews":{"type":"array","description":"Превью шаблона","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}},"folder":{"description":"Общая папка шаблона (пустой объект, если шаблон не в папке)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Имя папки"},"translatedName":{"type":"string","description":"Translated name","example":"Imya_papki"}}}]}}}]}},"categories":{"type":"array","description":"Категории общих шаблонов, название которых совпало с query (без query — все категории)","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории (нет у корневой)","example":"656f6fb3c943707fb750e058"}}}},"folders":{"type":"array","description":"Общие папки (кроме неутверждённых), название которых совпало с query (без query — все)","items":{"type":"object"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/{id}":{"get":{"tags":["Общие шаблоны"],"summary":"Получить общий шаблон по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SharedTemplate"},{"type":"object","properties":{"categories":{"type":"array","description":"Категории общих шаблонов, к которым относится шаблон","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Какое-то название"}}}},"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/byName/{name}":{"get":{"tags":["Общие шаблоны"],"summary":"Получить общий шаблон по translatedName","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"name","required":true,"description":"translatedName объекта","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается общий шаблон","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SharedTemplate"},{"type":"object","properties":{"categories":{"type":"array","description":"Категории общих шаблонов, к которым относится шаблон","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Какое-то название"}}}},"approved":{"type":"boolean","description":"Флаг \"принят/не принят\"","example":true},"approvedAt":{"type":"string","description":"Дата принятия шаблона","example":"2023-12-08T10:57:46.771Z"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/{id}/content":{"get":{"tags":["Общие шаблоны"],"summary":"Получить контент общего шаблона (для последующего редактирования)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается контент общего шаблона","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateContent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/{id}/copy":{"post":{"tags":["Общие шаблоны"],"summary":"Скопировать общий шаблон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Папка назначения","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Возвращается id шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID нового шаблона","example":"6572ec6d5ef72b47965d1938"},"translatedName":{"type":"string","description":"Переведённое имя скопированного шаблона","example":"Testovii_shablon_5_5"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/copy":{"post":{"tags":["Общие шаблоны"],"summary":"Скопировать общие шаблоны в шаблоны пользователя по id категории","security":[{"BearerAuth":[]}],"requestBody":{"description":"Категория общих шаблонов и папка назначения","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"categoryid":{"type":"string","description":"id категории","example":"6671765e7bc1c9e1a836573f"},"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Возвращается массив шаблонов","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"templateIds":{"type":"string","description":"id шаблона","example":"656f6f0f0178bdbbf63a543c"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/{id}/previews":{"get":{"tags":["Общие шаблоны"],"summary":"Получить список превью по ID шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается массив превью шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplatePreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/categories":{"get":{"tags":["Общие шаблоны"],"summary":"Получить список категорий общих шаблонов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается массив категорий","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории","example":"656f6fb3c943707fb750e058"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/categories/all":{"get":{"tags":["Общие шаблоны"],"summary":"Получить дерево категорий общих шаблонов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается массив дерева категорий","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6fb3c943707fb750e058"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"children":{"type":"array","description":"Дочерние категории (того же вида, рекурсивно; поля нет, если дочерних категорий нет)","items":{"type":"object","properties":{"id":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"},"name":{"type":"string","description":"Название категории","example":"Тестовая категория 4"},"parentid":{"type":"string","description":"ID родительской категории","example":"656f6fb3c943707fb750e058"}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/{id}/attachments":{"get":{"tags":["Общие шаблоны"],"summary":"Получить список прикреплённых файлов по ID шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается массив файлов шаблона","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateAttachmentElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedtemplates/request":{"post":{"tags":["Общие шаблоны"],"summary":"Оправка письма с запросом нового шаблона","security":[{"BearerAuth":[]}],"requestBody":{"description":"Оправка письма с запросом нового шаблона","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"string","description":"Текст запроса","example":"Требуется шаблон заявления на отпуск по ухожу за ..."}}}}}},"responses":{"201":{"description":"Возвращается почта пользователя и текст запроса","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"Имя пользователя","example":"Иванов Иван"},"useremail":{"type":"string","description":"Электронная почта пользователя","example":"user@mail.ru"},"primaryemail":{"type":"string","description":"Электронная почта владельца","example":"user@mail.ru"},"request":{"type":"string","description":"Текст запроса","example":"Требуется шаблон заявления на отпуск по ухожу за ..."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedrenderspublic/{id}":{"get":{"tags":["Общие документы (публичные методы)"],"summary":"Получить общий документ по id","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается общий документ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedTemplateRender"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedrenderspublic/{id}/send":{"post":{"tags":["Общие документы (публичные методы)"],"summary":"Отправить письмо для скачивания документа","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные запроса","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email","example":"test@mail.ru"}}}}}},"responses":{"201":{"description":"Возвращается email","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email","example":"test@mail.ru"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedrendersadmin/emails":{"get":{"tags":["Общие документы (админка)"],"summary":"Получить список email-адресов, на которые отправлены общие документы","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"from","type":"string","description":"Дата (от)","example":"2024-01-31T21:00:00.000Z"},{"in":"query","name":"to","type":"string","description":"Дата (до)","example":"2024-01-31T21:00:00.000Z"}],"responses":{"200":{"description":"Возвращается список email-адресов с названием документа и датой отправки","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Название документа","example":"Документ"},"date":{"type":"string","description":"Дата отправки сообщения","example":"2024-12-23T20:29:57.878Z"},"email":{"type":"string","description":"Адрес электронной почты","example":"user@mail.ru"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolderspublic/":{"get":{"tags":["Общие папки (публичные методы)"],"summary":"Получить список общих корневых папок","responses":{"200":{"description":"Возвращается список общих корневых папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RootSharedFolder"}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolderspublic/{id}":{"get":{"tags":["Общие папки (публичные методы)"],"summary":"Получить список дочерних общих папок по id родительской","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается список общих папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolderspublic/content/{id}":{"get":{"tags":["Общие папки (публичные методы)"],"summary":"Получить содержимое папки по id","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается содержимое папки","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChildrenSharedFolder"},{"type":"object","properties":{"templates":{"type":"array","description":"Общие шаблоны в папке","items":{"$ref":"#/components/schemas/SharedTemplate"}},"children":{"type":"array","description":"Дочерние общие папки","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolderspublic/contentByName/{name}":{"get":{"tags":["Общие папки (публичные методы)"],"summary":"Получить содержимое папки по name","parameters":[{"in":"path","name":"name","description":"translatedName объекта","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается содержимое папки","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChildrenSharedFolder"},{"type":"object","properties":{"templates":{"type":"array","description":"Общие шаблоны в папке","items":{"$ref":"#/components/schemas/SharedTemplate"}},"children":{"type":"array","description":"Дочерние общие папки","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfoldersadmin/":{"get":{"tags":["Общие папки (Админка)"],"summary":"Получить список общих корневых папок","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список общих корневых папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RootSharedFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Общие папки (Админка)"],"summary":"Создать новую общую папку","security":[{"BearerAuth":[]}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewChildrenSharedFolder"}}}},"responses":{"201":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfoldersadmin/all":{"get":{"tags":["Общие папки (Админка)"],"summary":"Получить дерево общих папок","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается дерево всех общих папок","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewRootSharedFolder"},{"type":"object","properties":{"templates":{"type":"array","description":"Общие шаблоны, лежащие в этой папке","items":{"allOf":[{"$ref":"#/components/schemas/Template"},{"type":"object","properties":{"versions":{"type":"array","description":"Версии шаблона","items":{"type":"object","properties":{"contentid":{"type":"string","description":"ID контента шаблона","example":"656d85981ba733ee9c9c4812"},"used":{"type":"boolean","description":"Флаг используется","example":false},"sides":{"type":"array","description":"Стороны версии шаблона","example":[]}}}},"type":{"type":"string","description":"Тип сущности","example":"template"}}}]}},"children":{"type":"array","description":"Дочерние общие папки того же вида (рекурсивно; поля нет, если дочерних нет)","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}},"type":{"type":"string","description":"Тип сущности","example":"folder"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfoldersadmin/{id}":{"get":{"tags":["Общие папки (Админка)"],"summary":"Получить список дочерних общих папок по id родительской","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается список общих папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Общие папки (Админка)"],"summary":"Обновить общую папку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewChildrenSharedFolder"}}}},"responses":{"200":{"description":"Возвращается общая папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Общие папки (Админка)"],"summary":"Удалить общую папку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной общей папки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfoldersadmin/previews":{"put":{"tags":["Общие папки (Админка)"],"summary":"Поменять позиции превью","security":[{"BearerAuth":[]}],"requestBody":{"description":"Массив с ID превью и их новыми позициями","required":true,"content":{"multipart/form-data":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID превью","example":"656f1dab11578466cb60025b"},"position":{"type":"integer","description":"Новая позиция превью","example":1}}}}}}},"responses":{"201":{"description":"Возвращается массив изменённых превью папки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderPreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfoldersadmin/{id}/previews":{"get":{"tags":["Общие папки (Админка)"],"summary":"Получить список превью по ID папки","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается массив превью папки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderPreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Общие папки (Админка)"],"summary":"Загрузить превью для папки","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для загрузки (возможна загрузка множества файлов)","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается массив созданных превью папки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderPreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfoldersadmin/{id}/previews/{previewid}":{"delete":{"tags":["Общие папки (Админка)"],"summary":"Удалить превью папки","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается ID удалённого превью папки","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID превью","example":"656f2e4de1fa947273c3e841"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolders/":{"get":{"tags":["Общие папки"],"summary":"Получить список общих корневых папок","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список общих корневых папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RootSharedFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolders/all":{"get":{"tags":["Общие папки"],"summary":"Получить дерево общих папок","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается дерево всех общих папок","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewRootSharedFolder"},{"type":"object","properties":{"templates":{"type":"array","description":"Общие шаблоны, лежащие в этой папке","items":{"allOf":[{"$ref":"#/components/schemas/Template"},{"type":"object","properties":{"versions":{"type":"array","description":"Версии шаблона","items":{"type":"object","properties":{"contentid":{"type":"string","description":"ID контента шаблона","example":"656d85981ba733ee9c9c4812"},"used":{"type":"boolean","description":"Флаг используется","example":false},"sides":{"type":"array","description":"Стороны версии шаблона","example":[]}}}},"type":{"type":"string","description":"Тип сущности","example":"template"}}}]}},"children":{"type":"array","description":"Дочерние общие папки того же вида (рекурсивно; поля нет, если дочерних нет)","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}},"type":{"type":"string","description":"Тип сущности","example":"folder"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolders/{id}":{"get":{"tags":["Общие папки"],"summary":"Получить список дочерних общих папок по id родительской","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается список общих папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChildrenSharedFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sharedfolders/{id}/previews":{"get":{"tags":["Общие папки"],"summary":"Получить список превью по ID папки","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается массив превью папки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderPreviewElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/settingspublic":{"get":{"tags":["Настройки сервиса (публичные методы)"],"summary":"Публичные настройки сервиса (лимиты загрузок, длины названий и т.п.)","description":"Без авторизации. Значения настроек, помеченных публичными: личный кабинет и виджеты читают по ним лимиты (размеры файлов, количество вложений, длины названий, срок пробного периода, версию соглашения кабинета подписанта). Секреты сюда никогда не попадают. Ключ — ключ настройки, значение — действующее значение (изменённое администратором или по умолчанию).\n","responses":{"200":{"description":"Объект «ключ настройки → значение»","content":{"application/json":{"schema":{"type":"object","description":"Ключи — ключи публичных настроек, значения — число, строка или логическое","additionalProperties":{"description":"Действующее значение настройки","oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]}},"example":{"attachments.maxSizeMb":10,"attachments.maxCount":10,"templates.aiFileMaxSizeMb":5,"masscreate.maxRows":1000,"limits.documentNameLength":255,"trial.durationDays":7,"signercabinet.agreementVersion":"1.0"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/settingsadmin":{"get":{"tags":["Настройки сервиса (админка)"],"summary":"Все настройки сервиса с названиями, ограничениями и текущими значениями","description":"Настройки, которые администратор меняет в админке вместо констант в коде. Секреты показываются расшифрованными. Значения кешируются в памяти сервера до 30 секунд.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Список настроек","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminSetting"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/settingsadmin/logs":{"get":{"tags":["Настройки сервиса (админка)"],"summary":"Журнал изменений настроек сервиса","description":"Последние 200 записей, новые первыми.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"key","description":"Ключ настройки — только её изменения; не передан — все настройки","schema":{"type":"string","pattern":"^[a-zA-Z.]+$","example":"attachments.maxSizeMb"}}],"responses":{"200":{"description":"Записи журнала","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SettingLog"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/settingsadmin/{key}":{"put":{"tags":["Настройки сервиса (админка)"],"summary":"Изменить значение настройки сервиса","description":"Только администратор с ролью COMMON_ADMIN (иначе 403). Тип значения должен совпадать с типом настройки; число — целое в пределах min-max; строка — до 1000 символов. links.landingUrl — https://<хост> без пути или пустая строка; mail.rusender.keyId и reserveKeyId — только цифры или пусто; mail.rusender.from и reserveFrom — e-mail или пусто. У секрета пустая строка удаляет значение (как сброс). Изменение пишется в журнал.\n","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/SettingKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Новое значение (число, строка или логическое — по типу настройки)","oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}],"example":20}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingResult"}}}},"400":{"description":"Неизвестный ключ, неверный тип, значение вне диапазона или не прошло проверку формата","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"}}}},"/settingsadmin/{key}/reset":{"post":{"tags":["Настройки сервиса (админка)"],"summary":"Сбросить настройку сервиса к значению по умолчанию","description":"Только администратор с ролью COMMON_ADMIN (иначе 403). Сброс пишется в журнал; если настройка не менялась, ответ тот же без записи в журнал.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/SettingKey"}],"responses":{"201":{"description":"Значение по умолчанию","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingResult"}}}},"400":{"description":"Неизвестный ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"}}}},"/schemas/types":{"get":{"tags":["Схемы"],"summary":"Получить схему типов переменных","responses":{"200":{"description":"Возвращается cхема типов переменных","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/schemas/strictattrs":{"get":{"tags":["Схемы"],"summary":"Получить схему строгих переменных","responses":{"200":{"description":"Возвращается cхема строгих переменных","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/schemas/strictattrsfolders":{"get":{"tags":["Схемы"],"summary":"Получить схему групп строгих переменных","responses":{"200":{"description":"Возвращается cхема групп строгих переменных","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/schemas/strictattrssections":{"get":{"tags":["Схемы"],"summary":"Получить схему разделов строгих переменных","responses":{"200":{"description":"Возвращается cхема разделов строгих переменных","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/schemas/strictattrshierarhy":{"get":{"tags":["Схемы"],"summary":"Получить схему иерархии строгих переменных","responses":{"200":{"description":"Возвращается cхема иерархии строгих переменных","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/schemas/permissions":{"get":{"tags":["Схемы"],"summary":"Получить схему разрешений","responses":{"200":{"description":"Возвращается cхема разрешений","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/schemas/strictproductproperties":{"get":{"tags":["Схемы"],"summary":"Получить схему строгих свойств продуктов","responses":{"200":{"description":"Возвращается cхема строгих свойств продуктов","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"string","description":"Схема","example":{"schema":"..."}}}}}}}}}},"/resources":{"get":{"tags":["Ресурсы"],"summary":"Получить список ресурсов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список ресурсов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Ресурсы"],"summary":"Создать новый ресурс","security":[{"BearerAuth":[]}],"requestBody":{"description":"Ресурс","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"responses":{"201":{"description":"Возвращается id ресурса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/resources/{id}/{lang}":{"get":{"tags":["Ресурсы"],"summary":"Получить ресурс по id и lang","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id ресурса","schema":{"type":"string"}},{"in":"path","name":"lang","required":true,"description":"Язык","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается ресурс","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Ресурсы"],"summary":"Обновить ресурс","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id ресурса","schema":{"type":"string"}},{"in":"path","name":"lang","required":true,"description":"Язык","schema":{"type":"string"}}],"requestBody":{"description":"Ресурс","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResource"}}}},"responses":{"200":{"description":"Возвращается ресурс","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Ресурсы"],"summary":"Удалить ресурс","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"id ресурса","schema":{"type":"string"}},{"in":"path","name":"lang","required":true,"description":"Язык","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается id и lang удаленного ресурса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceId"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}":{"get":{"tags":["Документы (публичные методы)"],"summary":"Получить документ","parameters":[{"$ref":"#/components/parameters/key"}],"responses":{"200":{"description":"Возвращается документ","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 203"},"signature":{"$ref":"#/components/schemas/TemplateRenderSignature"},"urlKey":{"type":"string","description":"URL-ключ для внешнего доступа","example":"dFsAff"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/signed":{"get":{"tags":["Документы (публичные методы)"],"summary":"Получить сведения о подписанном документе (страница подписанного документа)","description":"Только для документа, подписанного обеими сторонами. Архив, PDF и PDF с печатями сторон — методы archive, pdf, preview.","parameters":[{"$ref":"#/components/parameters/key"}],"responses":{"200":{"description":"Возвращаются сведения о подписанном документе","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Ключ","example":"ZTeFD3"},"name":{"type":"string","description":"Название","example":"Договор 203"},"createdAt":{"type":"string","format":"date-time","description":"Дата создания документа"},"signedAt":{"type":"string","format":"date-time","description":"Дата подписи второй стороной"},"sides":{"type":"array","description":"Подписавшие стороны (описание подписи каждой стороны)","items":{"type":"string","example":"Подписано УКЭП | ООО Ромашка | ИНН 1234567890"}},"files":{"type":"array","description":"Пути файлов в архиве с подписанным документом","items":{"type":"string","example":"preview.pdf"}},"mchdLinks":{"type":"array","description":"Ссылки на проверку машиночитаемых доверенностей, использованных при подписи","items":{"type":"string","example":"https://m4d.nalog.gov.ru/emchd/check-status?guid=..."}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/archive":{"get":{"tags":["Документы (публичные методы)"],"summary":"Скачать архив с подписанным документом и сопутствующими файлами","parameters":[{"$ref":"#/components/parameters/key"}],"responses":{"200":{"description":"Возвращается zip-архив","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/pdf":{"get":{"tags":["Документы (публичные методы)"],"summary":"Скачать pdf подписанного документа","parameters":[{"$ref":"#/components/parameters/key"}],"responses":{"200":{"description":"Возвращается файл pdf","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/preview":{"get":{"tags":["Документы (публичные методы)"],"summary":"Скачать pdf документа с печатями сторон","parameters":[{"$ref":"#/components/parameters/key"}],"responses":{"200":{"description":"Возвращается файл pdf","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/signaccept/simple":{"put":{"tags":["Документы (публичные методы)"],"summary":"Подписать документ ПЭП","parameters":[{"$ref":"#/components/parameters/key"}],"requestBody":{"description":"Код из SMS","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"Код из SMS","example":123456}}}}}},"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/signaccept/qualified":{"put":{"tags":["Документы (публичные методы)"],"summary":"Подписать документ УКЭП","parameters":[{"$ref":"#/components/parameters/key"}],"requestBody":{"description":"Данные для загрузки","required":true,"content":{"multipart/form-data":{"schema":{"allOf":[{"type":"object","properties":{"file":{"type":"array","description":"Файлы подписи УКЭП: откреплённая подпись .sig (обязательна), при наличии — .pdf и .xml (МЧД); тип определяется по расширению имени файла","items":{"type":"string","description":"Файл","format":"binary"}}}},{"$ref":"#/components/schemas/QualifiedSignatureWithoutMchdGuid"}]}}}},"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/signreject":{"put":{"tags":["Документы (публичные методы)"],"summary":"Отказаться от подписания документа","parameters":[{"$ref":"#/components/parameters/key"}],"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/signaccept/draw":{"put":{"tags":["Документы (публичные методы)"],"summary":"Подписание документа сигнатурой (рисунок)","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Рисунок подписи (ПЭП «Сигнатура»)","required":true,"content":{"application/json":{"schema":{"type":"object","required":["data","image"],"properties":{"data":{"type":"object","description":"JSON рисовалки (точки signaturePoints, метаданные, геолокация; версия схемы 1)"},"image":{"type":"string","description":"PNG рисунка (data URL или base64)","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="}}}}}},"responses":{"200":{"description":"Подпись принята","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Ключ документа","example":"902fd2c03ba52ca302dccb3e5546543e"},"signatureId":{"type":"string","description":"ID записи подписи (имя файла JSON подписи — signature-{signatureId}.json)","example":"672c8f1e9213f16bcd934422"},"sha256":{"type":"string","description":"SHA-256 сохранённого JSON подписи (hex)","example":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"},"pressure":{"type":"boolean","description":"Сервер нашёл силу нажатия в точках рисунка"},"geolocation":{"type":"boolean","description":"В данных рисунка передана геолокация подписанта"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/signdata":{"get":{"tags":["Документы (публичные методы)"],"summary":"JSON подписи сигнатурой подписанного документа","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON подписи (файл)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renderspublic/{key}/sendemail":{"post":{"tags":["Документы (публичные методы)"],"summary":"Отправить подписанный документ на email (итоговая страница подписанта, только способ «Сигнатура»)","description":"Публичный метод по ключу документа. Доступен только для подписанного документа со способом подписи draw («Сигнатура»). Письмо — штатное письмо о подписанном документе с PDF во вложении; отправляется один раз на документ (повтор — 409).","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","description":"Адрес подписанта (проверяется формат, до 254 символов)","example":"vm@datadoc.ru"}}}}}},"responses":{"201":{"description":"Письмо отправлено","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Ключ документа","example":"902fd2c03ba52ca302dccb3e5546543e"},"email":{"type":"string","description":"Адрес, на который отправлено письмо","example":"vm@datadoc.ru"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"404":{"description":"Документ не найден"},"409":{"description":"Документ по этой ссылке уже отправлялся на email (письмо отправляется один раз)"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/rendersadmin/edo":{"get":{"tags":["Документы (админка)"],"summary":"Получить список документов, отправленных в систему ЭДО","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/fromPublishedAt"},{"$ref":"#/components/parameters/toPublishedAt"}],"responses":{"200":{"description":"Возвращается список документов","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"signature":{"type":"object","description":"Подпись документа через ЭДО","properties":{"status":{"type":"string","description":"Статус подписи","enum":["EDO_PUBLISHED","EDO_DOUBLE_SIGNED","REJECTED"],"example":"EDO_PUBLISHED"},"publishedAt":{"type":"string","description":"Дата публикации документа","example":"2022-07-16T13:10:43.284+00:00"},"primary":{"type":"object","description":"Первая сторона (отправитель)","properties":{"companyInn":{"type":"string","description":"ИНН организации","example":1234567890}}},"counter":{"type":"object","description":"Вторая сторона (получатель)","properties":{"companyInn":{"type":"string","description":"ИНН организации","example":1234567890}}}}}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/rendersadmin/edo/excel":{"get":{"tags":["Документы (админка)"],"summary":"Получить файл Excel с информацией о документах, отправленных в систему ЭДО","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/fromPublishedAt"},{"$ref":"#/components/parameters/toPublishedAt"}],"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders":{"get":{"tags":["Документы"],"summary":"Получить список документов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"templateid","description":"Id шаблона","schema":{"type":"string"}},{"in":"query","name":"counteragentid","description":"Id контрагента","schema":{"type":"string"}},{"in":"query","name":"name","description":"Название документа и ключевые переменные","schema":{"type":"string"}},{"in":"query","name":"pack","description":"Флаг создания в составе пакета","schema":{"type":"boolean"}},{"in":"query","name":"fromCreatedAt","description":"Дата/время документа от","schema":{"type":"string"}},{"in":"query","name":"toCreatedAt","description":"Дата/время документа до","schema":{"type":"string"}},{"in":"query","name":"confirmed","description":"Флаг подтверждения","schema":{"type":"boolean"}},{"in":"query","name":"fromConfirmedAt","description":"Дата/время подтверждения документа от","schema":{"type":"string"}},{"in":"query","name":"toConfirmedAt","description":"Дата/время подтверждения документа до","schema":{"type":"string"}},{"in":"query","name":"hasSignature","description":"Флаг подписи","schema":{"type":"boolean"}},{"in":"query","name":"fromPrimarySignedAt","description":"Дата/время подписи документа первой стороной от","schema":{"type":"string"}},{"in":"query","name":"toPrimarySignedAt","description":"Дата/время подписи документа первой стороной до","schema":{"type":"string"}},{"in":"query","name":"fromCounterSignedAt","description":"Дата/время подписи документа второй стороной от","schema":{"type":"string"}},{"in":"query","name":"toCounterSignedAt","description":"Дата/время подписи документа второй стороной до","schema":{"type":"string"}},{"in":"query","name":"from","description":"Номер записи, с которой осуществлять выборку (0-based)","schema":{"type":"number"}},{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"number"}}],"responses":{"200":{"description":"Возвращается список документов","content":{"application/json":{"schema":{"type":"object","properties":{"renders":{"type":"array","description":"Документы, подходящие под условия (страница выборки)","items":{"$ref":"#/components/schemas/TemplateRender"}},"count":{"type":"integer","description":"Общее количество документов по условиям (без учёта постраничной выборки)","example":12}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/editeddocument":{"get":{"tags":["Документы"],"summary":"Получить HTML документа, изменённого пользователем в предпросмотре","description":"Возвращает именно тот HTML (editedHtml), из которого строится PDF документа. Если документ не менялся (в GET /renders/{id} edited = false) — 404.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается изменённый документ","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id документа","example":"64d5e8685186ca28a0567747"},"html":{"type":"string","description":"HTML документа","example":"<p>Текст</p>"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}":{"get":{"tags":["Документы"],"summary":"Получить документ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается документ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateRenderFull"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Документы"],"summary":"Удалить рендер","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/name":{"put":{"tags":["Документы"],"summary":"Переименовать документ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Новое название документа","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Новое название документа","example":"Новый документ"}}}}}},"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/owner":{"put":{"tags":["Документы"],"summary":"Установить ответственного за документ","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Id ответственного","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/confirm":{"put":{"tags":["Документы"],"summary":"Установить/снять флаг подписания","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/archive":{"get":{"tags":["Документы"],"summary":"Скачать архив с подписанным документом и сопутствующими файлами","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается zip-архив","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/preview":{"get":{"tags":["Документы"],"summary":"Скачать pdf документа с печатями сторон","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается файл pdf","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/publish":{"put":{"tags":["Документы"],"summary":"Опубликовать документ для подписания второй стороной","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные подписи","required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","description":"Тип подписи","example":"simple"},"signerName":{"type":"string","description":"ФИО подписанта второй стороны","example":"Иванов Иван Иванович"},"signerPhone":{"type":"string","description":"Телефон подписанта второй стороны","example":79999999999}}},{"type":"object","properties":{"type":{"type":"string","description":"Тип подписи","example":"qualified"}}}]},"examples":{"ПЭП":{"value":{"type":"simple","signerName":"Иванов Иван Иванович","signerPhone":79999999999}},"УКЭП":{"value":{"type":"qualified"}}}}}},"responses":{"200":{"description":"Возвращается URL-ключ","content":{"application/json":{"schema":{"type":"object","properties":{"urlKey":{"type":"string","description":"Ключ","example":"dSfAda"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/sms":{"put":{"tags":["Документы"],"summary":"Отправить СМС для подписания ПЭП","description":"Каждая отправленная СМС списывает подпись. Нет подписей (и не действуют «Бесплатные СМС») — ошибка signature.limitexceeded, СМС не отправляется (FOR-2823).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/email":{"put":{"tags":["Документы"],"summary":"Отправить письмо для подписания УКЭП","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные подписи","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Адрес электронной почты подписанта второй стороны","example":"user@mail.ru"}}}}}},"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/edosigned/archive":{"get":{"tags":["Документы"],"summary":"Скачать архив с подписанным документом из системы ЭДО","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается zip-архив","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/edosigned/send":{"put":{"tags":["Документы"],"summary":"Отправить документ в систему ЭДО","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные подписи","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"counteragentInn":{"type":"string","description":"ИНН контрагента (получателя)","example":1234567890},"counteragentName":{"type":"string","description":"Название контрагента (получателя)","example":"ООО Умные документы"}}}}}},"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/signdata":{"get":{"tags":["Документы"],"summary":"Скачать JSON подписи «Сигнатурой» (рисунок) подписанного документа","description":"Отдаёт файл signature-{id подписи}.json — исходный JSON рисунка подписи (точки, метаданные, геолокация и серверные признаки), тот же, что вложен в итоговый PDF. Только для документа своего воркспейса, подписанного способом «Сигнатура»; иначе 400 (signdraw.notforthisdocument).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Файл JSON подписи (Content-Disposition attachment)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/renders/{id}/signed/sms/status":{"get":{"tags":["Документы"],"summary":"Статус доставки отправленного СМС для подписания ПЭП","description":"Запрашивает у провайдера (smsc.ru) статус СМС, отправленного методом PUT /renders/{id}/signed/sms. Ничего не отправляет и не списывает. Если СМС ещё не отправлялось — status \"notsent\".","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Статус СМС","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsStatus"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/publicstats":{"get":{"tags":["Статистика сервиса (публичные методы)"],"summary":"Числа сервиса для сайта","description":"Количество всех рабочих пространств (как в списке пространств панели администратора). Считается раз в сутки ночной задачей и отдаётся готовым; первый запрос считает сам, если значения ещё нет.","responses":{"200":{"description":"Числа сервиса","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"integer","description":"Количество рабочих пространств","example":1802},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"Когда посчитано","example":"2026-11-09T03:20:00.000Z"}}}}}}}}},"/promocodesadmin":{"get":{"tags":["Промокоды (админка)"],"summary":"Получить список промокодов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список промокодов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Promocode"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Промокоды (админка)"],"summary":"Создать новый промокод","security":[{"BearerAuth":[]}],"requestBody":{"description":"Переменная","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promocode"}}}},"responses":{"201":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promocode"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/promocodesadmin/{id}":{"get":{"tags":["Промокоды (админка)"],"summary":"Получить промокод по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PromocodeId"}],"responses":{"200":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promocode"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Промокоды (админка)"],"summary":"Обновить промокод","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PromocodeId"}],"requestBody":{"description":"промокод","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPromocode"}}}},"responses":{"200":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promocode"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Промокоды (админка)"],"summary":"Удалить промокод по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PromocodeId"}],"responses":{"200":{"description":"Возвращается id промокода","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromocodeId"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/promocodes":{"post":{"tags":["Промокоды"],"summary":"Применить промокод","security":[{"BearerAuth":[]}],"requestBody":{"description":"Промокоды","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id промокода","example":"discount_30"}}}}}},"responses":{"201":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"type":"object","properties":{"promocode":{"description":"Применённый промокод","allOf":[{"$ref":"#/components/schemas/Promocode"}]},"tariffs":{"type":"array","description":"Тарифы рабочего пространства после применения промокода (как в списке тарифов)","items":{"$ref":"#/components/schemas/Tariff"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/promocodes/{id}":{"get":{"tags":["Промокоды"],"summary":"Получить данные промокода","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/PromocodeId"}],"responses":{"200":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promocode"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/promocodes/current":{"get":{"tags":["Промокоды"],"summary":"Получить текущий примененный промокод","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Promocode"},{"type":"object","properties":{"used":{"type":"boolean","description":"Флаг использования","example":false}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/promocodespublic/{id}":{"get":{"tags":["Промокоды (публичные методы)"],"summary":"Получить данные промокода","parameters":[{"$ref":"#/components/parameters/PromocodeId"}],"responses":{"200":{"description":"Возвращается промокод","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Promocode"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products":{"get":{"tags":["Продукты"],"summary":"Получить список продуктов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"nameOrVendorCode","description":"Название продукта или его артикул","schema":{"type":"string"}},{"in":"query","name":"category","description":"Массив ID категорий продукта","schema":{"type":"array","items":{"type":"string"}}},{"in":"query","name":"from","description":"Номер записи, от которой осуществлять выборку (0-based)","schema":{"type":"number"}},{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"number"}}],"responses":{"200":{"description":"Возвращается список продуктов","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","description":"Продукты выбранного диапазона","items":{"$ref":"#/components/schemas/Product"}},"count":{"type":"integer","description":"Общее количество продуктов воркспейса","example":12}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Продукты"],"summary":"Создать продукт","security":[{"BearerAuth":[]}],"requestBody":{"description":"Продукт","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewProduct"}}}},"responses":{"200":{"description":"Возвращается продукт","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Продукты"],"summary":"Удалить продукты по массиву ID","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"ids","description":"ID продуктов","required":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Возвращаются ID удалённых продуктов","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","description":"id объекта","example":"62bb25949213f16bcd934422"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products/categories":{"get":{"tags":["Продукты"],"summary":"Получить список всех категорий","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список категорий","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Продукты"],"summary":"Создать категорию продуктов","description":"Создаёт категорию продуктов в текущем воркспейсе. Уникальность названия не проверяется.","security":[{"BearerAuth":[]}],"requestBody":{"description":"Категория","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCategory"}}}},"responses":{"200":{"description":"Возвращается созданная категория","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products/categories/{id}":{"get":{"tags":["Продукты"],"summary":"Получить категорию по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается категория","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Продукты"],"summary":"Обновить категорию по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Категория","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCategory"}}}},"responses":{"200":{"description":"Возвращается категория","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Продукты"],"summary":"Удалить категорию по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается ID удалённой категории","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products/batch":{"post":{"tags":["Продукты"],"summary":"Создать продукты из списка","security":[{"BearerAuth":[]}],"requestBody":{"description":"Продукты","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NewProduct"}}}}},"responses":{"200":{"description":"Возвращается список созданных продуктов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products/{id}":{"get":{"tags":["Продукты"],"summary":"Получить продукт по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается продукт","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Продукты"],"summary":"Обновить данные продукта по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Продукт","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewProduct"}}}},"responses":{"200":{"description":"Возвращается продукт","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Продукты"],"summary":"Удалить продукт по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается ID удалённого продукта","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/productproperties":{"get":{"tags":["Свойства продуктов"],"summary":"Получить список свойств","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список свойств","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductProperty"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Свойства продуктов"],"summary":"Создать свойство продуктов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Свойство","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewProductProperty"}}}},"responses":{"201":{"description":"Возвращается свойство","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductProperty"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/productproperties/{id}":{"get":{"tags":["Свойства продуктов"],"summary":"Получить свойство по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается свойство","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductProperty"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Свойства продуктов"],"summary":"Обновить свойства по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Свойство","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewProductProperty"}}}},"responses":{"200":{"description":"Возвращается категория","content":{"application/json":{"$ref":"#/components/schemas/ProductProperty"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Свойства продуктов"],"summary":"Удалить свойство по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается ID удалённого свойства","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id документа","example":"62bb25949213f16bcd934422"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prerenderspublic/{id}":{"get":{"tags":["Пререндеры (публичные методы)"],"summary":"Получить пререндер по id","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается пререндер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prerender"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prerenderspublic/{id}/ocr/upload":{"put":{"tags":["Пререндеры (публичные методы)"],"summary":"Загрузить изображение для распознавания (bmp, jpeg, jpg, tif, tiff, gif, png)","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для распознавания","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"},"sideId":{"type":"string","description":"id стороны для заполнения распознанными данными","example":"sideOne"},"tattrFolderId":{"type":"string","description":"id группы переменных для заполнения распознанными данными","example":100}}}}}},"responses":{"200":{"description":"Возвращается id пререндера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrerenderId"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prerenders":{"post":{"tags":["Пререндеры"],"summary":"Создать пререндер","security":[{"BearerAuth":[]}],"requestBody":{"description":"Свойство","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPrerender"}}}},"responses":{"201":{"description":"Возвращается пререндер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prerender"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prerenders/{id}":{"get":{"tags":["Пререндеры"],"summary":"Получить пререндер по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается пререндер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prerender"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prerenders/{id}/sidevalues":{"put":{"tags":["Пререндеры"],"summary":"Обновить значения переменных пререндера","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Свойство","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"}}}}}},"responses":{"200":{"description":"Возвращается пререндер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prerender"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partnersadmin":{"get":{"tags":["Партнёрская программа (админка)"],"summary":"Получить список рекрутеров","description":"Все рабочие пространства с признаком рекрутера, их ставки, блокировка и сводка. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются рекрутеры","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"wid":{"type":"string","description":"id рабочего пространства рекрутера","example":"62bb25949213f16bcd934422"},"login":{"type":"string","nullable":true,"description":"Логин владельца (null — владельца нет)","example":"vm@datadoc.ru"},"name":{"type":"string","nullable":true,"description":"Имя владельца (null — не задано)","example":"Иван Петров"},"rateTariff":{"type":"number","nullable":true,"description":"Индивидуальная ставка за тарифы, % (null — общая)","example":null},"rateOther":{"type":"number","nullable":true,"description":"Индивидуальная ставка за прочие услуги, % (null — общая)","example":15},"blocked":{"type":"boolean","description":"true — рекрутер заблокирован","example":false},"summary":{"description":"Сводка рекрутера (null — не удалось рассчитать)","nullable":true,"allOf":[{"$ref":"#/components/schemas/PartnerSummary"}]}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partnersadmin/withdrawals":{"get":{"tags":["Партнёрская программа (админка)"],"summary":"Получить заявки на вывод всех рекрутеров","description":"До 500 последних заявок по убыванию даты. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"status","description":"Фильтр по статусу. new — новая; processing — в работе; paid — выплачена; rejected — отклонена; не задан — все","schema":{"type":"string","enum":["new","processing","paid","rejected"],"example":"new"}}],"responses":{"200":{"description":"Возвращаются заявки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PartnerWithdrawal"}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partnersadmin/withdrawals/{id}":{"put":{"tags":["Партнёрская программа (админка)"],"summary":"Изменить статус заявки на вывод","description":"Сохраняются статус, комментарий (если передан), время и администратор. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","description":"Новый статус. new — новая; processing — в работе; paid — выплачена; rejected — отклонена (сумма возвращается в доступное)","enum":["new","processing","paid","rejected"],"example":"paid"},"comment":{"type":"string","maxLength":500,"description":"Комментарий администратора, до 500 символов (не передан — прежний сохраняется)","example":"Выплачено платёжным поручением № 123"}}}}}},"responses":{"200":{"description":"Возвращается изменённая заявка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerWithdrawal"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partnersadmin/{id}":{"get":{"tags":["Партнёрская программа (админка)"],"summary":"Получить страницу рекрутера (как её видит рекрутер)","description":"Сводка, оплаты рефералов и заявки на вывод рекрутера. Не рекрутер — 404. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/partnerWid"}],"responses":{"200":{"description":"Возвращаются данные страницы рекрутера","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/PartnerSummary"},"transactions":{"type":"array","description":"Оплаты рефералов по убыванию даты","items":{"$ref":"#/components/schemas/PartnerTransaction"}},"withdrawals":{"type":"array","description":"Заявки на вывод по убыванию даты","items":{"$ref":"#/components/schemas/PartnerWithdrawal"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Партнёрская программа (админка)"],"summary":"Изменить ставки и блокировку рекрутера","description":"Сохраняются переданные поля (индивидуальные ставки, блокировка); новые ставки сразу применяются к ещё не выплаченному вознаграждению. Не рекрутер — 404. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/partnerWid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rateTariff":{"type":"number","nullable":true,"minimum":0,"maximum":100,"description":"Индивидуальная ставка за тарифы, % от 0 до 100 (null — общая ставка)","example":25},"rateOther":{"type":"number","nullable":true,"minimum":0,"maximum":100,"description":"Индивидуальная ставка за прочие услуги, % от 0 до 100 (null — общая ставка)","example":null},"blocked":{"type":"boolean","description":"true — заблокировать рекрутера, false — разблокировать","example":false}}}}}},"responses":{"200":{"description":"Возвращается пересчитанная сводка рекрутера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerSummary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partnersadmin/{id}/referrals":{"get":{"tags":["Партнёрская программа (админка)"],"summary":"Получить рефералов рекрутера","description":"Рабочие пространства, применившие промокод рекрутера, постранично. Не рекрутер — 403. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/partnerWid"},{"in":"query","name":"limit","description":"Размер страницы (по умолчанию 50, максимум 200)","schema":{"type":"integer","default":50,"maximum":200,"example":50}},{"in":"query","name":"offset","description":"Сколько рефералов пропустить (по умолчанию 0)","schema":{"type":"integer","default":0,"example":0}}],"responses":{"200":{"description":"Возвращается страница рефералов","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","description":"Общее число рефералов","example":14},"limit":{"type":"integer","description":"Применённый размер страницы","example":50},"offset":{"type":"integer","description":"Применённое смещение","example":0},"items":{"type":"array","description":"Рефералы страницы","items":{"$ref":"#/components/schemas/PartnerReferral"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partnersadmin/{id}/referrals/{refwid}":{"get":{"tags":["Партнёрская программа (админка)"],"summary":"Получить карточку реферала рекрутера","description":"Данные реферала со счетами, оплатами и счётчиками использования. Не рекрутер — 403; рабочее пространство не применяло промокод рекрутера — 404. Доступно общему администратору и менеджеру по продажам.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/partnerWid"},{"in":"path","name":"refwid","required":true,"description":"id рабочего пространства реферала (24 шестнадцатеричных символа)","schema":{"type":"string","example":"62bb25949213f16bcd934424"}}],"responses":{"200":{"description":"Возвращается карточка реферала","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerReferralDetails"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnersAdminForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partner/summary":{"get":{"tags":["Партнёрская программа"],"summary":"Получить сводку рекрутера","description":"Только для рабочего пространства с признаком рекрутера (иначе 403), заблокированному рекрутеру — 403. Оплата тарифа не требуется.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается сводка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerSummary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnerForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partner/transactions":{"get":{"tags":["Партнёрская программа"],"summary":"Получить оплаты рефералов и вознаграждение по ним","description":"Все оплаты рефералов по убыванию даты. Только для незаблокированного рекрутера (иначе 403). Оплата тарифа не требуется.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются оплаты","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PartnerTransaction"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnerForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/partner/withdrawals":{"get":{"tags":["Партнёрская программа"],"summary":"Получить заявки на вывод вознаграждения","description":"Заявки рабочего пространства по убыванию даты. Только для незаблокированного рекрутера (иначе 403). Оплата тарифа не требуется.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются заявки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PartnerWithdrawal"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnerForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Партнёрская программа"],"summary":"Создать заявку на вывод вознаграждения","description":"Сумма — не меньше minWithdraw и не больше доступной (иначе 400). Получатель проверяется по ИНН в DaData: должен быть найден, действовать и быть ООО или ИП (иначе 400). Только для незаблокированного рекрутера (иначе 403). Оплата тарифа не требуется.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount","inn"],"properties":{"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":100000000,"description":"Сумма к выплате, руб. (больше 0, до 100000000; округляется до копеек)","example":1500},"inn":{"type":"string","pattern":"^(\\d{10}|\\d{12})$","description":"ИНН получателя — ООО (10 цифр) или ИП (12 цифр)","example":"7707083893"}}}}}},"responses":{"201":{"description":"Возвращается созданная заявка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerWithdrawal"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/PartnerForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/packs":{"get":{"tags":["Пакеты шаблонов"],"summary":"Получить список пакетов шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Имя пакета (поиск по регулярному выражению)","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список пакетов по заданным условиям","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pack"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Пакеты шаблонов"],"summary":"Создать новый пакет шаблонов","security":[{"BearerAuth":[]}],"requestBody":{"description":"Пакет шаблонов","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPack"}}}},"responses":{"201":{"description":"Возвращается пакет","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pack"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/packs/{id}":{"get":{"tags":["Пакеты шаблонов"],"summary":"Получить пакет шаблонов по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается пакет шаблонов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackWithPath"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Пакеты шаблонов"],"summary":"Обновить пакет шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Пакет шаблонов","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPack"}}}},"responses":{"200":{"description":"Возвращается пакет шаблонов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pack"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Пакеты шаблонов"],"summary":"Удалить пакет шаблонов по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного пакета шаблонов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/packs/{id}/sides":{"get":{"tags":["Пакеты шаблонов"],"summary":"Получить стороны пакета шаблона (для последующего рендеринга)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращаются стороны пакета шаблона","content":{"application/json":{"schema":{"type":"object","properties":{"sides":{"description":"Стороны пакета шаблонов с переменными и комбо-полями","type":"array","items":{"$ref":"#/components/schemas/TemplateSideWithComboattrs"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/packs/{id}/render":{"post":{"tags":["Пакеты шаблонов"],"summary":"Создание документа по пакету шаблона","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Значения сторон и переменных пакета шаблона","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","enum":["pdf","zip"],"default":"pdf","description":"Формат результата: pdf — PDF документов пакета, zip — архив документов; по умолчанию pdf","example":"pdf"},"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"}}}}}},"responses":{"201":{"description":"Возвращается pdf файл","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/messengerbotsadmin/events":{"get":{"tags":["Боты подписания (админка)"],"summary":"Журнал событий бота подписания (ПЭП через MAX)","description":"Для разбора работы бота администратором сервиса. Новые первыми. Тексты сообщений и коды не хранятся; номер телефона и id пользователя мессенджера показываются только последними 4 символами.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"infillId","description":"id внешнего заполнения — только события по нему; не передан — все события","schema":{"type":"string","example":"62bb25949213f16bcd934429"}},{"in":"query","name":"limit","description":"Сколько событий вернуть","schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"example":20}}],"responses":{"200":{"description":"События бота","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["max"],"description":"Мессенджер","example":"max"},"kind":{"type":"string","enum":["start","contact","message","signed","push"],"description":"Вид события — start запуск бота, contact пользователь поделился контактом, message сообщение, signed уведомление «Документ подписан», push отправка ботом","example":"start"},"result":{"type":"string","description":"Итог обработки — received, forwarded, forward_failed, ratelimited, contact_requested, foreign_contact, no_documents, code_issued, send_failed, error; для kind = signed — signed_notified, signed_link_only (файл не ушёл), send_failed","example":"code_issued"},"error":{"type":"string","description":"Причина сбоя (стадия и код ответа платформы, без текстов и персональных данных); только при сбое","example":"sendMessage: 403"},"createdAt":{"type":"string","format":"date-time","description":"Время события","example":"2026-11-06T10:15:00.000Z"},"infillId":{"type":"string","description":"id внешнего заполнения, если событие связано с ним","example":"62bb25949213f16bcd934429"},"phoneTail":{"type":"string","description":"Последние 4 цифры подтверждённого телефона (если пользователь делился контактом)","example":"0107"},"userIdTail":{"type":"string","description":"Последние 4 символа id пользователя мессенджера","example":"4821"}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/messengerbots/max/webhook":{"post":{"tags":["Боты подписания (публичные методы)"],"summary":"Вебхук бота подписания в MAX (ПЭП через мессенджер)","description":"Вызывает платформа мессенджера MAX при событиях бота (запуск бота, сообщение, отправка контакта). Без авторизации пользователя: подлинность проверяется по секрету вебхука в заголовке X-Max-Bot-Api-Secret (сравнивается с переменной окружения MAX_SIGN_WEBHOOK_SECRET или настройкой сервиса messengers.max.webhookSecret); нет или не совпал — 403. Повтор события с тем же id отбрасывается; ошибки обработки не возвращаются платформе (ответ всё равно {ok: true}), а пишутся в журнал событий (GET /messengerbotsadmin/events).\n","parameters":[{"in":"header","name":"X-Max-Bot-Api-Secret","required":true,"description":"Секрет вебхука, заданный при регистрации вебхука в MAX","schema":{"type":"string","example":"webhook-secret"}}],"requestBody":{"required":true,"description":"Событие (Update) платформы MAX как есть; обрабатываются update_type = bot_started и message_created (в т.ч. с вложением-контактом) из личного диалога, сообщения от ботов пропускаются","content":{"application/json":{"schema":{"type":"object","properties":{"update_type":{"type":"string","description":"Тип события MAX (bot_started, message_created и др.)","example":"bot_started"},"timestamp":{"type":"integer","description":"Время события MAX (мс)","example":1762423200000},"chat_id":{"type":"integer","description":"id чата (для bot_started)","example":123456789},"user":{"type":"object","description":"Пользователь, запустивший бота (для bot_started)","example":{"user_id":987654321,"is_bot":false}},"payload":{"type":"string","description":"Параметр запуска бота из ссылки (для bot_started) — по нему находится документ на подпись","example":"abc123"},"message":{"type":"object","description":"Сообщение (для message_created) — sender, recipient.chat_id, body.mid, body.text, body.attachments","example":{"sender":{"user_id":987654321},"recipient":{"chat_id":123456789},"body":{"mid":"mid.0000","text":"Привет"}}}}}}}},"responses":{"200":{"description":"Событие принято","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"Всегда true","example":true}}}}}},"403":{"description":"Нет секрета вебхука или он неверный"}}}},"/mchds":{"post":{"tags":["Машиночитаемая доверенность (МЧД)"],"summary":"Создать запись об МЧД","security":[{"BearerAuth":[]}],"requestBody":{"description":"XML-файл МЧД","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается информация об МЧД","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mchd"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"get":{"tags":["Машиночитаемая доверенность (МЧД)"],"summary":"Получить список всех МЧД текущего пользователя","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список МЧД","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Mchd"}}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mchds/{guid}":{"delete":{"tags":["Машиночитаемая доверенность (МЧД)"],"summary":"Удалить запись об МЧД","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/guid"}],"responses":{"200":{"description":"Возвращается GUID МЧД","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MchdGuid"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mchds/{guid}/description":{"put":{"tags":["Машиночитаемая доверенность (МЧД)"],"summary":"Обновить описание МЧД","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/guid"}],"requestBody":{"description":"Описание МЧД","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","description":"Описание доверенности","example":"Иванов Иван Иванович | ИНН 1234567890 по доверенности d4158e30-f9da-496e-9fe4-bc10edd44ff2 | выдана 01.08.2025 | действует до 31.12.2025 | ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"УМНЫЕ ДОКУМЕНТЫ\" | ИНН 1234567890"}}}}}},"responses":{"200":{"description":"Возвращается информация об МЧД","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mchd"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/managerspublic/{id}":{"get":{"tags":["Менеджеры (публичные методы)"],"summary":"Получить менеджера по id","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается менеджер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Manager"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/managersadmin":{"get":{"tags":["Менеджеры (админка)"],"summary":"Получить список менеджеров","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список менеджеров","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Manager"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Менеджеры (админка)"],"summary":"Создать менеджера","security":[{"BearerAuth":[]}],"requestBody":{"description":"Менеджер","required":true,"content":{"multipart/form-data":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewManager"},{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}]}}}},"responses":{"200":{"description":"Возвращается менеджер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Manager"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет прав — метод доступен только администратору сервиса (COMMON_ADMIN)"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/managersadmin/{id}":{"get":{"tags":["Менеджеры (админка)"],"summary":"Получить менеджера по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается менеджер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Manager"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Менеджеры (админка)"],"summary":"Обновить менеджера","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Менеджер","required":true,"content":{"multipart/form-data":{"schema":{"allOf":[{"$ref":"#/components/schemas/NewManager"},{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}]}}}},"responses":{"200":{"description":"Возвращается менеджер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Manager"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет прав — метод доступен только администратору сервиса (COMMON_ADMIN)"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Менеджеры (админка)"],"summary":"Удалить менеджера","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного менеджера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет прав — метод доступен только администратору сервиса (COMMON_ADMIN)"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/managersadmin/{id}/timeslots/{timeslotId}":{"put":{"tags":["Менеджеры (админка)"],"summary":"Разблокировать таймслот для менеджера","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"$ref":"#/components/parameters/timeslotId"}],"responses":{"200":{"description":"Возвращается id менеджера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Менеджеры (админка)"],"summary":"Заблокировать таймслот для менеджера","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"$ref":"#/components/parameters/timeslotId"}],"responses":{"200":{"description":"Возвращается id менеджера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/managers":{"get":{"tags":["Менеджеры"],"summary":"Получить список менеджеров","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список менеджеров","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Manager"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin":{"get":{"tags":["Рассылки (админка)"],"summary":"Получить список рассылок","description":"Рассылки по убыванию даты создания, постранично. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/mailingFrom"},{"in":"query","name":"to","description":"Конец страницы (не включительно) — вернётся to − from записей (целое ≥ 0, по умолчанию 50)","schema":{"type":"integer","minimum":0,"default":50,"example":50}}],"responses":{"200":{"description":"Возвращаются рассылки страницы и общее число","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Рассылки страницы","items":{"$ref":"#/components/schemas/Mailing"}},"count":{"type":"integer","description":"Общее число рассылок","example":12}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Рассылки (админка)"],"summary":"Создать черновик рассылки","description":"Создаётся рассылка в статусе draft; автор — текущий администратор. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailingSaveBody"}}}},"responses":{"201":{"description":"Возвращается созданная рассылка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/config":{"get":{"tags":["Рассылки (админка)"],"summary":"Получить настройки отправки рассылок","description":"Тестовый режим, скорость отправки и наличие ключей RuSender по доменам (из настроек сервиса). Доступно только общему администратору.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются настройки отправки","content":{"application/json":{"schema":{"type":"object","properties":{"testMode":{"type":"boolean","description":"true — задана настройка mailing.onlyRecipients, письма уходят только на адреса из неё","example":true},"onlyRecipients":{"type":"string","description":"Шаблоны разрешённых адресов через запятую (* — любой текст); пустая строка — ограничения нет","example":"vm@datadoc.ru,vm+*@datadoc.ru"},"ratePerMinute":{"type":"number","description":"Скорость отправки, писем в минуту (настройка mailing.ratePerMinute)","example":60},"domains":{"type":"array","description":"Домены отправителя и их ключи RuSender","items":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/MailingDomain"},"key":{"type":"string","description":"Пара ключей RuSender домена. reserve — резервная, primary — основная","enum":["reserve","primary"],"example":"reserve"},"configured":{"type":"boolean","description":"true — у пары заданы и токен, и id (можно запускать рассылку с этим доменом)","example":true}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/recipients/count":{"post":{"tags":["Рассылки (админка)"],"summary":"Посчитать получателей рассылки","description":"Сколько адресов получит рассылка с такими условиями: подтверждённые e-mail владельцев (или всех пользователей) рабочих пространств нужных типов, по одному письму на адрес, без тестовых логинов; в тестовом режиме — только адреса из mailing.onlyRecipients. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/MailingRecipientsBody"},{"type":"object","required":["recipientTypes"]}]}}}},"responses":{"201":{"description":"Возвращается число получателей","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","description":"Число уникальных адресов","example":120},"testMode":{"type":"boolean","description":"true — действует тестовый режим (число посчитано только по разрешённым адресам)","example":false}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/preview":{"post":{"tags":["Рассылки (админка)"],"summary":"Предпросмотр письма рассылки","description":"Полный HTML письма — тело очищается от недопустимых тегов, получает стили писем DataDoc и вставляется в шапку и подвал; переменная имени заменяется именем текущего администратора. Ничего не сохраняется. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["html"],"properties":{"html":{"type":"string","maxLength":500000,"description":"Тело письма из редактора (до 500000 символов)","example":"<p>Здравствуйте, <span data-var=\"user_name\" data-fallback=\"Уважаемый пользователь\">Имя</span>!</p>"}}}}}},"responses":{"201":{"description":"Возвращается полный HTML письма","content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"Готовый HTML письма с шапкой и подвалом","example":"<html><body><p style=\"margin: 0 0 16px 0;\">Здравствуйте, Иван!</p></body></html>"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/test":{"post":{"tags":["Рассылки (админка)"],"summary":"Отправить тестовое письмо","description":"Отправляет письмо на указанный адрес через пару ключей RuSender выбранного домена; имя для переменной — у пользователя с таким логином, иначе текст по умолчанию. Тема, имя отправителя и непустое тело обязательны. Ошибка RuSender возвращается как 400. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/MailingEmailBody"},{"type":"object","required":["email","subject","domain","fromLocal","fromName","html"],"properties":{"email":{"type":"string","format":"email","description":"Адрес, на который отправить тестовое письмо","example":"vm@datadoc.ru"}}}]}}}},"responses":{"201":{"description":"Письмо отправлено; возвращается адрес","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Адрес, на который ушло письмо","example":"vm@datadoc.ru"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/images":{"post":{"tags":["Рассылки (админка)"],"summary":"Загрузить изображение для тела письма","description":"jpg, png или gif (по сигнатуре файла) до 500 КБ. Имя файла — md5 содержимого; файл публично доступен на сайте как /i/<md5>.<ext> (и методом GET /mailingimages/{file}). Доступно только общему администратору.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Файл изображения (берётся первый файл запроса)"}}}}}},"responses":{"201":{"description":"Возвращаются имя и публичный адрес изображения","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Имя файла — md5 содержимого и расширение","example":"0cc175b9c0f1b6a831c399e269772661.png"},"url":{"type":"string","description":"Публичный адрес изображения на сайте","example":"https://datadoc.ru/i/0cc175b9c0f1b6a831c399e269772661.png"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}":{"get":{"tags":["Рассылки (админка)"],"summary":"Получить рассылку по id","description":"Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается рассылка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Рассылки (админка)"],"summary":"Изменить черновик рассылки","description":"Менять можно только рассылку в статусе draft (иначе 400). Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailingSaveBody"}}}},"responses":{"200":{"description":"Возвращается изменённая рассылка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}/copy":{"post":{"tags":["Рассылки (админка)"],"summary":"Копировать рассылку","description":"Новый черновик с тем же письмом, получателями и датами; автор — текущий администратор. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается новый черновик","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}/start":{"post":{"tags":["Рассылки (админка)"],"summary":"Запустить рассылку","description":"Только из статуса draft. Проверяются тема, имя отправителя, тело, типы получателей и ключи RuSender домена; список адресов фиксируется, статус становится inProgress и начинается отправка письмами реальным получателям со скоростью mailing.ratePerMinute. Нет получателей — 400. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается запущенная рассылка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}/stop":{"post":{"tags":["Рассылки (админка)"],"summary":"Остановить рассылку","description":"Только из статусов inProgress или paused (иначе 400); статус становится stopped. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается остановленная рассылка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}/resume":{"post":{"tags":["Рассылки (админка)"],"summary":"Продолжить рассылку","description":"Только из статусов paused или stopped (иначе 400); проверяются ключи RuSender домена, оставшимся адресам продолжается отправка. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается рассылка в статусе inProgress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}/retryfailed":{"post":{"tags":["Рассылки (админка)"],"summary":"Повторить отправку на адреса с ошибкой","description":"Только для рассылок не в статусах draft и inProgress, и только если есть адреса со статусом failed (иначе 400). Такие адреса снова ставятся в очередь, счётчик ошибок уменьшается, статус становится inProgress. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается рассылка в статусе inProgress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mailing"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingsadmin/{id}/log":{"get":{"tags":["Рассылки (админка)"],"summary":"Получить журнал отправки рассылки","description":"Адреса рассылки по убыванию времени изменения, постранично, с фильтром по статусу. Доступно только общему администратору.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"query","name":"status","description":"Фильтр по статусу отправки. pending — ожидает; sent — отправлено; failed — не отправлено; не задан — все","schema":{"type":"string","enum":["pending","sent","failed"],"example":"failed"}},{"$ref":"#/components/parameters/mailingFrom"},{"in":"query","name":"to","description":"Конец страницы (не включительно) — вернётся to − from записей (целое ≥ 0, по умолчанию 100)","schema":{"type":"integer","minimum":0,"default":100,"example":100}}],"responses":{"200":{"description":"Возвращаются записи журнала страницы и их общее число","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Записи журнала страницы","items":{"$ref":"#/components/schemas/MailingRecipient"}},"count":{"type":"integer","description":"Общее число записей с учётом фильтра","example":2}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/MailingsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/mailingimages/{file}":{"get":{"tags":["Рассылки (публичные методы)"],"summary":"Получить изображение из письма рассылки","description":"Публичный метод без авторизации: отдаёт изображение, загруженное в тело письма (POST /mailingsadmin/images); сайт показывает его как /i/<md5>.<ext>. Имя — md5 содержимого, поэтому файл не меняется и кэшируется на год (Cache-Control immutable).","parameters":[{"in":"path","name":"file","required":true,"description":"Имя файла — 32 шестнадцатеричных символа md5 и расширение jpg, png или gif; иное имя — 404","schema":{"type":"string","pattern":"^[0-9a-f]{32}\\.(jpg|png|gif)$","example":"0cc175b9c0f1b6a831c399e269772661.png"}}],"responses":{"200":{"description":"Возвращается изображение","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/maildomain":{"get":{"tags":["Домены почты"],"summary":"Получить почтовый сервис по домену","parameters":[{"in":"query","name":"email","description":"Email","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращает домены по емейлу","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название почтового сервиса","example":"Gmail"},"domain":{"type":"array","description":"Домены","items":{"type":"string","example":"gmail.com"}},"url":{"type":"string","description":"Ссылка на почтовый сервис","example":"https://mail.google.com/mail"},"logoUrl":{"type":"string","description":"Ссылка на логотип почтового сервиса","example":"https://safe.forma.today/mailicons/Gmail.svg"}}}]}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/legaldocumentspublic":{"get":{"tags":["Юридические документы (публичные методы)"],"summary":"Список опубликованных документов (для ссылок на сайте)","responses":{"200":{"description":"Список","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Название документа","example":"Политика обработки данных"},"slug":{"type":"string","description":"Адрес страницы документа на сайте (/<язык>/<slug>/)","example":"privacy"}}}}}}}}}},"/legaldocumentspublic/{slug}":{"get":{"tags":["Юридические документы (публичные методы)"],"summary":"Опубликованный документ по адресу","parameters":[{"in":"path","name":"slug","required":true,"description":"Адрес страницы документа (slug)","schema":{"type":"string"},"example":"ai-terms"},{"in":"query","name":"lang","description":"Язык страницы; нет английского тела — отдаётся русское","schema":{"type":"string","enum":["ru","en"]}}],"responses":{"200":{"description":"Документ","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название документа","example":"Условия использования AI-ассистента"},"slug":{"type":"string","description":"Адрес страницы документа","example":"ai-terms"},"html":{"type":"string","description":"Тело документа (HTML) на запрошенном языке; английского тела нет — русское","example":"<h1>УСЛОВИЯ…</h1><p>…</p>"},"updatedAt":{"type":"string","format":"date-time","description":"Дата и время последнего изменения документа","example":"2026-10-30T10:00:00.000Z"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/legaldocumentsadmin":{"get":{"tags":["Юридические документы (админка)"],"summary":"Список юридических документов (без тел)","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Список документов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LegalDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Юридические документы (админка)"],"summary":"Создать документ","description":"HTML тела очищается на сервере (без скриптов, фреймов, обработчиков событий и javascript-ссылок). Адрес занят, недопустим или совпадает со страницей сайта — 400","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewLegalDocument"}}}},"responses":{"201":{"description":"Созданный документ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/legaldocumentsadmin/slug":{"get":{"tags":["Юридические документы (админка)"],"summary":"Свободный адрес из названия (транслит кириллицы)","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","required":true,"description":"Название документа, из которого строится адрес (транслит)","schema":{"type":"string"},"example":"Тестовый юридический документ"},{"in":"query","name":"id","description":"Редактируемый документ (его собственный адрес не считается занятым)","schema":{"type":"string"}}],"responses":{"200":{"description":"Адрес","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"Свободный адрес страницы (не занят другим документом и не совпадает со страницей сайта; при совпадении добавляется -2, -3…)","example":"testovii-yuridicheskii-dokument"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/legaldocumentsadmin/{id}":{"parameters":[{"in":"path","name":"id","required":true,"description":"id юридического документа","schema":{"type":"string"}}],"get":{"tags":["Юридические документы (админка)"],"summary":"Документ с телами","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Документ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Юридические документы (админка)"],"summary":"Изменить документ (переданные поля)","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewLegalDocument"}}}},"responses":{"200":{"description":"Документ после изменения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Юридические документы (админка)"],"summary":"Удалить документ","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Документ удалён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/langbase/suggestfio/firstname":{"get":{"tags":["Языковые функции"],"summary":"Подсказки по имени","parameters":[{"in":"query","name":"query","description":"Запрос","schema":{"type":"string","example":"иван"}}],"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"string","example":"Иван"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/langbase/suggestfio/middlename":{"get":{"tags":["Языковые функции"],"summary":"Подсказки по отчеству","parameters":[{"in":"query","name":"query","description":"Запрос","schema":{"type":"string","example":"иван"}}],"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"string","example":"Иванович"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/langbase/suggestfio/familyname":{"get":{"tags":["Языковые функции"],"summary":"Подсказки по фамилии","parameters":[{"in":"query","name":"query","description":"Запрос","schema":{"type":"string","example":"иван"}}],"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"string","example":"Иванов"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/langbase/suggestfmsunit":{"get":{"tags":["Языковые функции"],"summary":"Подсказки по \"Паспорт выдан\"","parameters":[{"in":"query","name":"query","description":"Поиск по коду или значению","schema":{"type":"string","example":"310-001"}},{"in":"query","name":"id","description":"Поиск по коду","schema":{"type":"string","example":"310-001"}},{"in":"query","name":"value","description":"Поиск по значению","schema":{"type":"string","example":"ленинград"}}],"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","properties":{"id":{"type":"string","description":"Код подразделения","example":"310-001"},"value":{"type":"string","description":"Название подразделения («Паспорт выдан»)","example":"ОТДЕЛЕНИЕМ № 4 ОУФМС РОССИИ ПО БЕЛГОРОДСКОЙ ОБЛ. В Г. БЕЛГОРОД"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/landing/contact":{"post":{"tags":["Лендинг"],"summary":"Отправка в amoCRM данных формы обратной связи","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название формы","example":"Обратный звонок"},"clientEmail":{"type":"string","description":"Email клиента","example":"some@mail.ru"},"clientPhone":{"type":"string","description":"Телефон клиента","example":79999999999},"companyName":{"type":"string","description":"Название компании","example":"ООО Рога и Копыта"},"companySize":{"type":"string","description":"Размер компании","example":100},"clientFullName":{"type":"string","description":"ФИО клиента","example":"Александр Александрович Александров"},"areaOfActivityId":{"type":"string","description":"id сферы деятельности","example":"64d12317bfd535ac3ad7ab92"},"employeeRole":{"type":"string","description":"Должность работника","example":"Директор"},"registerQuery":{"$ref":"#/components/schemas/RegisterQuery"}}}}}},"responses":{"200":{"description":"Уведомление об успешном создании формы","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Успешная отправка формы","example":true}}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/landing/resume":{"post":{"tags":["Лендинг"],"summary":"Отправка резюме на почту из формы обратной связи","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"ФИО соискателя","example":"Раст Питон Ноджеэсович"},"phone":{"type":"string","description":"Телефон клиента из формы обратной связи","example":79882850385},"comment":{"type":"string","description":"Поле \"О себе\"","example":"Хочу очень работать"},"resume":{"type":"string","description":"Ссылка на резюме","example":"ссылка.на/резюме"}}}}}},"responses":{"200":{"description":"Уведомление об успешной отправке резюме","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Успешная отправка отправка резюме","example":true}}}}}}}}},"/folders":{"get":{"tags":["Папки"],"summary":"Получить список корневых папок","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список корневых папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RootFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Папки"],"summary":"Создать новую папку","security":[{"BearerAuth":[]}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewChildFolder"}}}},"responses":{"201":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/all":{"get":{"tags":["Папки"],"summary":"Получить дерево папок","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается дерево всех папок","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/RootFolder"},{"type":"object","properties":{"children":{"type":"array","description":"Дочерние папки (рекурсивно; поля нет, если дочерних папок нет)","items":{"$ref":"#/components/schemas/ChildFolder"}}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/allcontent":{"get":{"tags":["Папки"],"summary":"Получить дерево папок и шаблонов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"favorite","description":"Флаг по избранному","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Возвращается дерево всех папок и шаблонов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RootFolderOrTemplateTree"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/{id}":{"get":{"tags":["Папки"],"summary":"Получить список дочерних папок по id родительской","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается список папок","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChildFolder"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Папки"],"summary":"Обновить папку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Папка","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewChildFolder"}}}},"responses":{"200":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Папки"],"summary":"Удалить папку по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной папки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/content":{"get":{"tags":["Папки"],"summary":"Получить список корневых папок и шаблонов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список корневых папок и шаблонов","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/FolderType"},{"type":"object","properties":{"items":{"type":"array","description":"Папки и шаблоны корневого уровня","items":{"$ref":"#/components/schemas/ChildFolderOrTemplate"}},"path":{"type":"array","description":"Путь от корня до папки (для корня всегда пустой)","items":{},"maxItems":0}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/content/{id}":{"get":{"tags":["Папки"],"summary":"Получить список папок и шаблонов в папке","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается список папок и шаблонов в папке","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RootFolder"},{"$ref":"#/components/schemas/FolderType"},{"type":"object","properties":{"items":{"type":"array","description":"Папки и шаблоны внутри папки (видимые пользователю)","items":{"$ref":"#/components/schemas/ChildFolderOrTemplate"}},"path":{"type":"array","description":"Путь от корня до родительской папки (родительские папки по порядку)","items":{"$ref":"#/components/schemas/RootPath"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/contentByName/{name}":{"get":{"tags":["Папки"],"summary":"Получить список папок и шаблонов в папке по translatedName","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"name","required":true,"description":"translatedName объекта","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список папок и шаблонов в папке","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RootFolder"},{"$ref":"#/components/schemas/FolderType"},{"type":"object","properties":{"items":{"type":"array","description":"Папки и шаблоны внутри папки (видимые пользователю)","items":{"$ref":"#/components/schemas/ChildFolderOrTemplate"}},"path":{"type":"array","description":"Путь от корня до родительской папки (родительские папки по порядку)","items":{"$ref":"#/components/schemas/RootPath"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/search":{"get":{"tags":["Папки"],"summary":"Поиск шаблонов и папок","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Имя шаблона или папки (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"folderid","description":"id папки","schema":{"type":"string"}},{"in":"query","name":"limit","description":"Лимит количества возвращаемых элементов","schema":{"type":"integer"}},{"in":"query","name":"external","description":"Включить в поиск общие папки и шаблоны","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Возвращается список шаблонов и папок в папке и ее подпапках по заданным условиям","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ChildFolderOrTemplate"},{"type":"object","properties":{"external":{"type":"string","description":"Флаг общего шаблона или папки","example":true}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/favorites":{"get":{"tags":["Папки"],"summary":"Получить список избранных папок и шаблонов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список избранных папок и шаблонов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChildFolderOrTemplate"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/favorites/{id}":{"put":{"tags":["Папки"],"summary":"Добавить папку в избранное","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildFolder"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Папки"],"summary":"Удалить папку из избранного","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildFolder"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/folders/{id}/copy":{"post":{"tags":["Папки"],"summary":"Скопировать папку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Папка назначения","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}}}}},"responses":{"201":{"description":"Возвращается папка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildFolder"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/facsimiles":{"get":{"tags":["Факсимиле"],"summary":"Получить список факсимиле","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список всех факсимиле","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facsimile"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Факсимиле"],"summary":"Загрузить факсимиле","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для загрузки","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"200":{"description":"Возвращается созданный факсимиле","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Facsimile"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/facsimiles/{id}":{"get":{"tags":["Факсимиле"],"summary":"Получить факсимиле по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается факсимиле","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Facsimile"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Факсимиле"],"summary":"Удалить факсимиле по ID","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается ID удалённого факсимиле","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID удалённого факсимиле","example":"64da1c4e77f778b212b041c4"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Получить шаблон для внешнего заполнения по ключу","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается элемент внешнего заполнения","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExternalInfillReuseConfig"},{"type":"object","properties":{"name":{"type":"string","description":"Название документа (с подставленными значениями и номером для многоразовой ссылки)","example":"Документ"},"sides":{"type":"array","description":"Стороны версии шаблона документа (переменные для заполнения)","items":{"$ref":"#/components/schemas/TemplateSideWithComboattrs"}},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"},"attachments":{"$ref":"#/components/schemas/ExternalInfillAttachments"},"isReady":{"type":"boolean","description":"Статус документа","example":true},"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"},"entity":{"$ref":"#/components/schemas/ExternalInfillEntity"},"signature":{"$ref":"#/components/schemas/ExternalInfillSignatureShort"}}}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Внести данные в элемент внешнего заполнения по ключу","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"},"signature":{"type":"object","description":"Данные подписанта (если документ отправляется на подпись)","properties":{"signer":{"$ref":"#/components/schemas/ExternalInfillSigner"}}}}}}}},"responses":{"200":{"description":"Возвращается статус элемента внешнего заполнения","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/Key"},{"type":"object","properties":{"isReady":{"type":"boolean","description":"Статус документа","example":true},"isChild":{"type":"boolean","description":"Флаг дочернего элемента внешнего заполнения","example":true},"attachments":{"$ref":"#/components/schemas/ExternalInfillAttachments"}}}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/attachments/{attachmentId}":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Скачать вложение по ключу и id","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}},{"in":"path","name":"attachmentId","required":true,"description":"id вложения","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается файл","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/attachments":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"summary":"Скачать все вложения по ключу как zip-архив","responses":{"200":{"description":"Возвращается файл","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Загрузить вложения","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Данные для загрузки","content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":{"type":"string","format":"binary","description":"Файл"},"example":{"b2bb25949213f16bcd934422":"(binary)","b2bb25949213f16bcd934423":"(binary)"}}}}},"responses":{"201":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/sms":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Отправить SMS для подписания","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/signerphone":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Подписант меняет свой номер телефона (подпись через MAX)","description":"Работает, только если в воркспейсе включена настройка signChangePhone, подпись запрошена (статус SIGN_REQUESTED) и способ подписи — мессенджер MAX; для СМС номер менять нельзя (400 signsettings.changephonesms). Выданный на старый номер код и подтверждения старого номера сбрасываются, новый код приходит на новый номер. Метод защищён ключом безопасности: в теле нужно поле sch (без него или с просроченным ключом — 403); при вызове по API-ключу sch не нужен.","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"Новый номер телефона подписанта (символы + - ( ) и пробелы отбрасываются, остаётся 6–13 цифр)","example":"+79991050107"},"sch":{"type":"string","description":"Ключ безопасности (защита от автоматических запросов): HTML-строка, которую формирует страница подписанта; сервер берёт текст пятого тега pre и проверяет, что ключ действителен (выдан не более 3 минут назад)","example":"<pre>a</pre><pre>b</pre><pre>c</pre><pre>d</pre><pre>ключ безопасности</pre>"}}}}}},"responses":{"200":{"description":"Номер изменён, возвращается ключ документа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"403":{"description":"Нет или неверный ключ безопасности sch"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/qrcode":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Получить QR-код ссылки на страницу документа","description":"QR-код ведёт на страницу подписания и проверки документа на лендинге (вида https://datadoc.ru/ru/sign/{key}/). Ответ — строка data URL с PNG-картинкой.","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"QR-код (PNG в формате data URL)","content":{"application/json":{"schema":{"type":"string","description":"Картинка QR-кода в формате data URL (data:image/png;base64,...)","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/previewname":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Получить название документа по введённым значениям (предпросмотр)","description":"Подставляет переданные значения переменных в название документа (шаблон названия с переменными и номер документа). Для многоразовой ссылки (reusable) название строится с нумерацией будущего дочернего документа. Ничего не сохраняет.","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sideValues"],"properties":{"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"}}}}}},"responses":{"200":{"description":"Название документа","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Название документа с подставленными значениями","example":"Договор № 15 с Ивановым И.И."}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/signaccept":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Подписание документа","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Данные","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"Код подтверждения","example":123456}}}}}},"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/signreject":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Отказ в подписании документа","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/signcomment":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Подписание документа","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Данные","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","description":"Комментарии","example":"Не подписываю"}}}}}},"responses":{"200":{"description":"Возвращается ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Key"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/pdf":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Скачивание pdf заполненного документа","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается файл","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/preview":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Предпросмотр заполнения","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Данные для предпросмотра","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","description":"Формат документа для предпросмотра","enum":["html","pdf"],"example":"html"},"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"}}}}}},"responses":{"200":{"description":"Возвращается html или pdf в зависимости от указанного формата","content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string","description":"HTML документа с подставленными значениями (если документ изменён отправителем в предпросмотре — сохранённый изменённый HTML)","example":"<p>test</p>"}}}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/sign":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Получить данные подписи","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращаются данные подписи","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название документа","example":"Документ"},"isChild":{"type":"boolean","description":"Флаг дочернего элемента внешнего заполнения","example":true},"signature":{"description":"Подпись документа (ПЭП)","allOf":[{"$ref":"#/components/schemas/ExternalInfillSignatureShort"},{"type":"object","properties":{"signVerificationCode":{"type":"string","description":"Код из СМС","example":123456}}}]}}}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/signdraw":{"put":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Подписание документа сигнатурой (рисунок)","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"description":"Рисунок подписи (ПЭП «Сигнатура»)","required":true,"content":{"application/json":{"schema":{"type":"object","required":["data","image"],"properties":{"data":{"type":"object","description":"JSON рисовалки (точки signaturePoints, метаданные, геолокация; версия схемы 1)"},"image":{"type":"string","description":"PNG рисунка (data URL или base64)","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="}}}}}},"responses":{"200":{"description":"Подпись принята","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Ключ документа","example":"902fd2c03ba52ca302dccb3e5546543e"},"signatureId":{"type":"string","description":"ID записи подписи (имя файла JSON подписи — signature-{signatureId}.json)","example":"672c8f1e9213f16bcd934422"},"sha256":{"type":"string","description":"SHA-256 сохранённого JSON подписи (hex)","example":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"},"pressure":{"type":"boolean","description":"Сервер нашёл силу нажатия в точках рисунка"},"geolocation":{"type":"boolean","description":"В данных рисунка передана геолокация подписанта"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/signdata":{"get":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"JSON подписи сигнатурой подписанного документа","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"responses":{"200":{"description":"JSON подписи (файл)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillspublic/{key}/sendemail":{"post":{"tags":["Внешнее заполнение (публичные методы)"],"summary":"Отправить подписанный документ на email (итоговая страница подписанта, только способ «Сигнатура»)","description":"Публичный метод по ключу документа. Доступен только для подписанного документа со способом подписи draw («Сигнатура»). Письмо — штатное письмо о подписанном документе с PDF во вложении; отправляется один раз на документ (повтор — 409).","parameters":[{"in":"path","name":"key","required":true,"description":"Ключ","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","description":"Адрес подписанта (проверяется формат, до 254 символов)","example":"vm@datadoc.ru"}}}}}},"responses":{"201":{"description":"Письмо отправлено","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Ключ документа","example":"902fd2c03ba52ca302dccb3e5546543e"},"email":{"type":"string","description":"Адрес, на который отправлено письмо","example":"vm@datadoc.ru"}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"404":{"description":"Документ не найден"},"409":{"description":"Документ по этой ссылке уже отправлялся на email (письмо отправляется один раз)"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/editeddocument":{"get":{"tags":["Внешнее заполнение"],"summary":"Получить HTML документа, изменённого пользователем в предпросмотре","description":"Если документ не менялся (в GET /externalinfills/{id} edited = false) — 404.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается изменённый документ","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID элемента внешнего заполнения","example":"64d5e8685186ca28a0567747"},"html":{"type":"string","description":"HTML документа, сохранённый после правки в предпросмотре","example":"<p>Текст</p>"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills":{"get":{"tags":["Внешнее заполнение"],"summary":"Получить список всех документов для внешнего заполнения","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Название заполнения","schema":{"type":"string"}},{"in":"query","name":"fromCreatedAt","description":"Дата создания от","schema":{"type":"string"}},{"in":"query","name":"toCreatedAt","description":"Дата создания до","schema":{"type":"string"}},{"in":"query","name":"fromReadAt","description":"Дата чтения от","schema":{"type":"string"}},{"in":"query","name":"toReadAt","description":"Дата чтения до","schema":{"type":"string"}},{"in":"query","name":"fromSignedAt","description":"Дата подписания от","schema":{"type":"string"}},{"in":"query","name":"toSignedAt","description":"Дата подписания до","schema":{"type":"string"}},{"in":"query","name":"hasSignature","description":"Флаг наличия подписи","schema":{"type":"boolean"}},{"in":"query","name":"signatureStatus","description":"Статус подписи","schema":{"$ref":"#/components/schemas/ExternalInfillSignatureStatus"}},{"in":"query","name":"reusable","description":"Флаг многоразового внешнего заполнения","schema":{"type":"boolean"}},{"in":"query","name":"from","description":"Номер записи, с которой осуществлять выборку (0-based)","schema":{"type":"number"}},{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"number"}}],"responses":{"200":{"description":"Возвращаются все предзаполненные документы","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Элементы внешнего заполнения (страница выборки from–to)","items":{"allOf":[{"$ref":"#/components/schemas/ExternalInfillShort"},{"type":"object","properties":{"signature":{"$ref":"#/components/schemas/ExternalInfillSignatureShort"}}}]}},"count":{"type":"integer","description":"Количество записей","example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Внешнее заполнение"],"summary":"Создать элемент внешнего заполнения","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExternalInfillReuseConfig"},{"type":"object","properties":{"templateId":{"type":"string","description":"ID шаблона по которому создаётся элемент внешнего заполнения","example":"64d5e8685186ca28a0567747"},"name":{"type":"string","description":"Наименование","example":"Название документа"},"entityId":{"type":"string","description":"ID организации, собирающей ПД для заполнения","example":"64d5e8685186ca28a0567741"},"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"},"signature":{"type":"object","description":"Запрос подписи ПЭП (без него документ создаётся без подписи)","properties":{"signer":{"$ref":"#/components/schemas/ExternalInfillSigner"},"omitEntityStamp":{"type":"boolean","description":"Флаг отмены рендеринга печати создателя заполнения","example":true}}},"editedHtml":{"type":"string","description":"HTML документа, изменённый пользователем в предпросмотре (необязательно). Если передан, документ строится из него (значения уже подставлены), а не из шаблона; шаблон не меняется. HTML очищается (script, iframe, формы, on*-атрибуты, внешние картинки удаляются), размер не больше ~5 МБ. Если у группы пользователя включён запрет редактирования (право previewEditing:denied), ответ 403 (permission.previewediting). Сохраняется вместе с документом: признак edited в ответе, сам HTML — GET /externalinfills/{id}/editeddocument. Только для отправки на подпись (ПЭП, signature.signer) и не для многоразовой ссылки (reusable) — иначе 400","example":"<p>Договор № 15 от 07.11.2026</p>"},"attachmentNames":{"type":"array","description":"Список имен вложений","items":{"type":"string","example":"attachment"}},"attachmentContents":{"type":"array","description":"Загружаемые приложения. Картинки (jpeg, png, webp, gif, bmp, tiff) и PDF (в том числе многостраничные) добавляются в конец итогового PDF в порядке перечисления; на каждой странице приложения справа вверху выводится «Приложение к документу № {номер, если есть} / от {дата, если есть} / {caption, если задан}», справа внизу — «Приложение — страница X из Y» (при нескольких приложениях — «Приложение N — страница X из Y»)","items":{"type":"object","properties":{"caption":{"type":"string","maxLength":255,"description":"Необязательная подпись приложения (без разметки), например «Генеральный план объекта»","example":"Генеральный план объекта"},"name":{"type":"string","description":"Название","example":"attachment"},"filename":{"type":"string","description":"Имя файла","example":"test.txt"},"mimetype":{"type":"string","description":"Тип файла","example":"text/plain"},"content":{"type":"string","description":"Содержимое файла в base64","example":"0YLQtdGB0YI="}}}}}}]}}}},"responses":{"201":{"description":"Возвращается элемент внешнего заполнения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfill"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}":{"get":{"tags":["Внешнее заполнение"],"summary":"Получить элемент внешнего заполнения по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается элемент внешнего заполнения","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExternalInfillShort"},{"type":"object","properties":{"version":{"type":"integer","description":"Версия шаблона","example":0},"externalUserEmail":{"type":"string","description":"Email внешнего пользователя","example":"test@mail.ru"},"attachments":{"$ref":"#/components/schemas/ExternalInfillAttachments"},"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"},"sides":{"type":"array","description":"Стороны версии шаблона документа с заполненными данными переменных","items":{"$ref":"#/components/schemas/TemplateSideWithFilledTattrs"}},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"},"edited":{"type":"boolean","description":"Документ изменён пользователем в предпросмотре (HTML — GET /externalinfills/{id}/editeddocument)","example":false},"entity":{"description":"Организация, собирающая данные для заполнения","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"ООО Вектор"},"inn":{"type":"string","description":"ИНН","example":1234567890},"kpp":{"type":"string","description":"КПП","example":12345678},"email":{"type":"string","description":"Email","example":"test@mail.ru"},"phone":{"type":"string","description":"Телефон","example":79012345678}}}]},"signature":{"$ref":"#/components/schemas/ExternalInfillSignatureShort"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Внешнее заполнение"],"summary":"Обновить элемент внешнего заполнения","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для обновления","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Название документа"},"reuseActive":{"type":"boolean","description":"Является ли многоразовое внешнее заполнение активным","example":true}}}}}},"responses":{"200":{"description":"Возвращается элемент внешнего заполнения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfill"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Внешнее заполнение"],"summary":"Удалить элемент внешнего заполнения","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается ID удалённого предзаполненного документа","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID удалённого элемента","example":"64d8e0120f6123c8a3360dd1"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/copy":{"post":{"tags":["Внешнее заполнение"],"summary":"Дублировать внешнее заполнение","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Возвращается элемент внешнего заполнения","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExternalInfill"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/attachments/{attachmentId}":{"get":{"tags":["Внешнее заполнение"],"summary":"Скачать вложение по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"},{"in":"path","name":"attachmentId","required":true,"description":"id вложения","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается файл","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/attachments":{"get":{"tags":["Внешнее заполнение"],"summary":"Скачать все вложения по id как zip-архив","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается файл","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Внешнее заполнение"],"summary":"Загрузить вложения","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для загрузки","content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":{"type":"string","format":"binary","description":"Файл"},"example":{"b2bb25949213f16bcd934422":"(binary)","b2bb25949213f16bcd934423":"(binary)"}}}}},"responses":{"201":{"description":"Возвращается элемент внешнего заполнения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfill"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/email":{"put":{"tags":["Внешнее заполнение"],"summary":"Отправить письмо для заполнения","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Данные для отправки","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email","example":"test@mail.ru"}}}}}},"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/sms":{"put":{"tags":["Внешнее заполнение"],"summary":"Отправить SMS для подписания","description":"Каждая отправленная СМС списывает подпись. Нет подписей (и не действуют «Бесплатные СМС») — ошибка signature.limitexceeded, СМС не отправляется (FOR-2823).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/signdata":{"get":{"tags":["Внешнее заполнение"],"summary":"Скачать JSON подписи «Сигнатурой» (рисунок) подписанного документа","description":"Отдаёт файл signature-{id подписи}.json — исходный JSON рисунка подписи (точки, метаданные, геолокация и серверные признаки), тот же, что вложен в итоговый PDF. Только для документа своего воркспейса, подписанного способом «Сигнатура»; иначе 400 (signdraw.notforthisdocument).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Файл JSON подписи (Content-Disposition attachment)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfills/{id}/sms/status":{"get":{"tags":["Внешнее заполнение"],"summary":"Статус доставки отправленного СМС для подписания","description":"Запрашивает у провайдера (smsc.ru) статус СМС, отправленного методом PUT /externalinfills/{id}/sms. Ничего не отправляет и не списывает. Если СМС ещё не отправлялось — status \"notsent\".","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Статус СМС","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsStatus"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillentitiesadmin/{wid}":{"get":{"tags":["Внешнее заполнение - организации (админка)"],"summary":"Получить список организаций по wid","parameters":[{"in":"path","name":"wid","required":true,"description":"ID воркспейса","example":"65576f45c1433e2251e97a45","schema":{"type":"string"}}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список организаций","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Внешнее заполнение - организации (админка)"],"summary":"Создать новую организацию","parameters":[{"in":"path","name":"wid","required":true,"description":"ID воркспейса","example":"65576f45c1433e2251e97a45","schema":{"type":"string"}}],"security":[{"BearerAuth":[]}],"requestBody":{"description":"Организация","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewExternalInfillEntityWithApprovedFlag"}}}},"responses":{"201":{"description":"Возвращается организация","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillentitiesadmin/{wid}/{id}":{"delete":{"tags":["Внешнее заполнение - организации (админка)"],"summary":"Удалить организацию по id","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"wid","required":true,"description":"ID воркспейса","example":"65576f45c1433e2251e97a45","schema":{"type":"string"}},{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной организации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillentitiesadmin/{wid}/{id}/approved":{"put":{"tags":["Внешнее заполнение - организации (админка)"],"summary":"Изменить флаг подтверждения","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"wid","required":true,"description":"ID воркспейса","example":"65576f45c1433e2251e97a45","schema":{"type":"string"}},{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Организация","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"boolean","description":"Флаг подтверждения","example":true}}}}}},"responses":{"200":{"description":"Возвращается организация","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillentities":{"get":{"tags":["Внешнее заполнение - организации"],"summary":"Получить список организаций","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список организаций","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Внешнее заполнение - организации"],"summary":"Создать новую организацию","security":[{"BearerAuth":[]}],"requestBody":{"description":"Организация","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewExternalInfillEntityWithApprovedFlag"}}}},"responses":{"201":{"description":"Возвращается организация","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillentities/{id}":{"get":{"tags":["Внешнее заполнение - организации"],"summary":"Получить организацию по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается организация","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Внешнее заполнение - организации"],"summary":"Обновить организацию","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Организация","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewExternalInfillEntity"}}}},"responses":{"200":{"description":"Возвращается организация","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Внешнее заполнение - организации"],"summary":"Удалить организацию по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной организации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/externalinfillentities/{wid}/{id}":{"get":{"tags":["Внешнее заполнение - организации"],"summary":"Получить организацию по id в воркспейсе (публичный метод)","parameters":[{"in":"path","name":"wid","required":true,"description":"id воркспейса","schema":{"type":"string"}},{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается организация","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalInfillEntity"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents":{"get":{"tags":["Документы (рендеры и внешние заполнения)"],"summary":"Получить список всех документов без подписи (рендеров и внешних заполнений)","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Название и ключевые переменные (в случае документов и строгих документов)","schema":{"type":"string"}},{"in":"query","name":"confirmed","description":"Флаг подтверждения","schema":{"type":"boolean"}},{"in":"query","name":"fromConfirmedAt","description":"Дата/время подтверждения документа от","schema":{"type":"string"}},{"in":"query","name":"toConfirmedAt","description":"Дата/время подтверждения документа до","schema":{"type":"string"}},{"$ref":"#/components/parameters/fromCreatedAt"},{"$ref":"#/components/parameters/toCreatedAt"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Возвращаются все документы","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Документы выбранного диапазона — документы по шаблону, внешние заполнения и строгие документы (вид — в поле type)","items":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/RenderBase"},{"type":"object","properties":{"confirmed":{"type":"boolean","description":"Флаг подписи","example":true},"confirmedAt":{"type":"string","description":"Дата и время подписи","example":"2022-07-16T13:10:43.284+00:00"}}}]},{"$ref":"#/components/schemas/ExternalInfillBase"},{"$ref":"#/components/schemas/StrictRenderBase"}]}},"count":{"type":"integer","description":"Количество записей","example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents/signed":{"get":{"tags":["Документы (рендеры и внешние заполнения)"],"summary":"Получить список всех документов с подписью (рендеров и внешних заполнений)","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Название и ключевые переменные (в случае документов)","schema":{"type":"string"}},{"in":"query","name":"primaryType","description":"Тип подписи первой стороны","schema":{"type":"string","enum":["simple","qualified"],"example":"simple"}},{"in":"query","name":"counterType","description":"Тип подписи второй стороны","schema":{"type":"string","enum":["simple","qualified","edo","null"],"example":"simple"}},{"in":"query","name":"status","description":"Статус(ы) подписи","schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/TemplateRenderSignatureStatus"},{"$ref":"#/components/schemas/ExternalInfillSignatureStatus"}]}},"explode":false},{"in":"query","name":"fromSignedAt","description":"Дата подписания от","schema":{"type":"string"}},{"in":"query","name":"toSignedAt","description":"Дата подписания до","schema":{"type":"string"}},{"$ref":"#/components/parameters/fromCreatedAt"},{"$ref":"#/components/parameters/toCreatedAt"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Возвращаются все документы","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"Документы с подписью выбранного диапазона — документы по шаблону и внешние заполнения (вид — в поле type)","items":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/RenderBase"},{"type":"object","properties":{"signature":{"type":"object","description":"Подпись документа по шаблону","properties":{"status":{"$ref":"#/components/schemas/TemplateRenderSignatureStatus"},"primary":{"description":"Подпись первой стороны (отправителя)","allOf":[{"$ref":"#/components/schemas/TemplateRenderListSideSignature"}]},"counter":{"description":"Подпись второй стороны (контрагента)","allOf":[{"$ref":"#/components/schemas/TemplateRenderListSideSignature"}]}}}}}]},{"allOf":[{"$ref":"#/components/schemas/ExternalInfillBase"},{"type":"object","properties":{"signature":{"type":"object","description":"Подпись внешнего заполнения","properties":{"status":{"description":"Статус подписи: SIGN_REQUESTED — ждёт подписи, SIGNED — подписан, REJECTED — отклонён","allOf":[{"$ref":"#/components/schemas/ExternalInfillSignatureStatus"}]},"signedAt":{"type":"string","description":"Дата подписи","example":"2024-10-27T13:38:25.156+00:00"},"signer":{"type":"object","description":"Подписант","properties":{"name":{"type":"string","description":"ФИО подписанта","example":"Иванов Иван Иванович"}}},"entity":{"type":"object","description":"Организация-отправитель","properties":{"name":{"type":"string","description":"Наименование отправителя","example":"ООО Умные документы"}}}}}}}]}]}},"count":{"type":"integer","description":"Количество записей","example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents/signed/archive":{"post":{"tags":["Документы (рендеры и внешние заполнения)"],"summary":"Скачать ZIP-архив PDF подписанных ПЭП одной страницы списка /documents/signed (не более 100 документов)","description":"Фильтры - те же, что у списка /documents/signed, тип подписи ПЭП обязателен (primaryType=simple). Берётся страница from..to (включительно, не более 100 записей),\nв архив попадают только подписанные ПЭП этой страницы (тот же файл, что при обычном скачивании подписанного PDF). Имена файлов - названия документов,\nзапрещённые символы заменяются на «_», одинаковые имена получают «_2», «_3». Нужны права signedExternalInfills:view и pepArchive:download\n(у группы «Администраторы» преференция есть всегда). Архив отдаётся в ответе, без временных ссылок.\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["primaryType","from","to"],"properties":{"primaryType":{"type":"string","enum":["simple"],"description":"Тип подписи первой стороны — только simple (ПЭП), иначе 400 signedarchive.peponly","example":"simple"},"counterType":{"type":"string","enum":["simple"],"description":"Тип подписи второй стороны — только simple (ПЭП); необязательный фильтр","example":"simple"},"name":{"type":"string","description":"Название и ключевые переменные","example":"Договор 203"},"status":{"type":"string","description":"Статус(ы) подписи через запятую (значения как у фильтра status списка /documents/signed)","example":"DOUBLE_SIGNED,SIGNED"},"fromCreatedAt":{"type":"string","description":"Дата создания от (ISO 8601)","example":"2026-10-01T00:00:00.000Z"},"toCreatedAt":{"type":"string","description":"Дата создания до (ISO 8601)","example":"2026-10-31T23:59:59.999Z"},"fromSignedAt":{"type":"string","description":"Дата подписания от (ISO 8601)","example":"2026-10-01T00:00:00.000Z"},"toSignedAt":{"type":"string","description":"Дата подписания до (ISO 8601)","example":"2026-10-31T23:59:59.999Z"},"from":{"type":"integer","description":"Номер первой записи страницы (0-based)","example":0},"to":{"type":"integer","description":"Номер последней записи страницы (0-based, включительно; to - from < 100)","example":99}}}}}},"responses":{"200":{"description":"Возвращается ZIP-архив (signed_pep.zip)","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права signedExternalInfills:view или преференции pepArchive:download"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents/signed/excel":{"get":{"tags":["Документы (рендеры и внешние заполнения)"],"summary":"Выгрузить документы с подписью в файл XLSX с теми же фильтрами, что у списка /documents/signed","description":"Выгружаются все найденные документы (без страниц, если не переданы from/to). Колонки и их заголовки берутся из ресурса signeddocuments.excelcolumns\n(строки «ключ ширина заголовок»; ключи name, companyName, createdAt, readAt, filledAt, signedAt, signerName, url).\nПодписант внешней стороны заполняется только для ПЭП, ссылка - только для подписанных документов. Нужно право signedExternalInfills:view.\n","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Название и ключевые переменные (в случае документов)","schema":{"type":"string"}},{"in":"query","name":"primaryType","description":"Тип подписи первой стороны","schema":{"type":"string","enum":["simple","qualified"]}},{"in":"query","name":"counterType","description":"Тип подписи второй стороны","schema":{"type":"string","enum":["simple","qualified","edo","null"]}},{"in":"query","name":"status","description":"Статус(ы) подписи через запятую","schema":{"type":"string"}},{"in":"query","name":"fromSignedAt","description":"Дата подписания от","schema":{"type":"string"}},{"in":"query","name":"toSignedAt","description":"Дата подписания до","schema":{"type":"string"}},{"in":"query","name":"tzOffset","description":"Смещение часового пояса пользователя в минутах, как его возвращает Date.getTimezoneOffset() (по умолчанию -180, Москва)","schema":{"type":"integer","example":-180}},{"$ref":"#/components/parameters/fromCreatedAt"},{"$ref":"#/components/parameters/toCreatedAt"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Возвращается файл XLSX (signatures.xlsx)","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права signedExternalInfills:view"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/cleanname":{"post":{"tags":["API dadata.ru"],"summary":"Стандартизация ФИО","requestBody":{"description":"ФИО","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"ФИО для обработки","example":"Срегей владимерович иванов"}}}}}},"responses":{"200":{"description":"Стандартизированные данные","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","description":"Исходное ФИО одной строкой","example":"Срегей владимерович иванов"},"result":{"type":"string","description":"Стандартизованное ФИО одной строкой","example":"Иванов Сергей Владимирович"},"result_genitive":{"type":"string","description":"ФИО в родительном падеже (кого?)","example":"Иванова Сергея Владимировича"},"result_dative":{"type":"string","description":"ФИО в дательном падеже (кому?)","example":"Иванову Сергею Владимировичу"},"result_ablative":{"type":"string","description":"ФИО в творительном падеже (кем?)","example":"Ивановым Сергеем Владимировичем"},"surname":{"type":"string","description":"Фамилия","example":"Иванов"},"name":{"type":"string","description":"Имя","example":"Сергей"},"patronymic":{"type":"string","description":"Отчество","example":"Владимирович"},"gender":{"type":"string","description":"Пол","example":"М"},"qc":{"type":"integer","description":"Код проверки","example":1}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestparty":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по организациям","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"Сбербанк"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/party/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestfio/firstname":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по имени","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"Иван"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/name/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestfio/middlename":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по отчеству","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"Иван"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/name/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestfio/familyname":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по фамилии","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"Иван"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/name/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/findbank":{"post":{"tags":["API dadata.ru"],"summary":"Поиск банка","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":44525225}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/find-bank/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestbank":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по банку","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"Сбер"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/bank/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestaddress":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по адресу","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"Моск"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/address/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/suggestfmsunit":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по \"Паспорт выдан\"","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Запрос для обработки","example":"772-053"}}}}}},"responses":{"200":{"description":"Массив подсказок","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","example":"См. https://dadata.ru/api/suggest/fms_unit/"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/dadata/cities":{"post":{"tags":["API dadata.ru"],"summary":"Подсказки по городам","requestBody":{"description":"Запрос","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Название города","example":"Москва"}}}}}},"responses":{"200":{"description":"Массив городов","content":{"application/json":{"schema":{"type":"array","description":"Массив подсказок","items":{"type":"object","properties":{"title":{"type":"string","description":"Название города","example":"Москва"},"area":{"type":"string","description":"Район, в котором находится населённый пункт","example":"Верхошижемский район"},"region":{"type":"object","description":"Объект региона (области)","properties":{"title":{"type":"string","description":"Название региона (области)","example":"Кировская область"}}},"country":{"type":"object","description":"Объект страны","properties":{"title":{"type":"string","description":"Название страны","example":"Россия"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/crmleads":{"post":{"tags":["CRM: данные лида (пользователь)"],"summary":"FOR-2367: сохранить данные лида CRM, полученные виджетом","description":"Данные хранятся в рабочем пространстве пользователя 7 дней. Повторная запись того же лида (crm + entityId + entityType) заменяет данные, сохраняет id и продлевает срок хранения.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveCrmLead"}}}},"responses":{"200":{"description":"Сохранённая запись","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"400":{"description":"Неверные данные (ресурсы crmlead.crm.invalid, crmlead.entityid.invalid, crmlead.entitytype.invalid, crmlead.account.invalid, crmlead.data.invalid, crmlead.data.toolarge)"},"401":{"description":"Нет авторизации"},"500":{"$ref":"#/components/responses/InternalError"}}},"get":{"tags":["CRM: данные лида (пользователь)"],"summary":"FOR-2367: данные лида CRM по CRM и id лида","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"crm","description":"Тип CRM лида","required":true,"schema":{"$ref":"#/components/schemas/CrmLeadType"}},{"in":"query","name":"entityId","description":"id лида (сделки) в CRM, до 64 символов","required":true,"schema":{"type":"string"},"example":"27461057"},{"in":"query","name":"entityType","description":"Тип сущности в CRM, с учётом регистра (не передан — пустая строка)","schema":{"type":"string"},"example":"leads"}],"responses":{"200":{"description":"Запись лида","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"400":{"description":"Неверные параметры"},"401":{"description":"Нет авторизации"},"404":{"description":"Лид не сохранён в рабочем пространстве или срок хранения истёк"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/crmleads/{id}":{"get":{"tags":["CRM: данные лида (пользователь)"],"summary":"FOR-2367: данные лида CRM по id записи (для страницы ЛК)","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"id","description":"id записи лида (поле id из ответа POST /crmleads)","required":true,"schema":{"type":"string"},"example":"672a1f3e9b1c2d0012a3b4c5"}],"responses":{"200":{"description":"Запись лида","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"400":{"description":"Неверный id"},"401":{"description":"Нет авторизации"},"404":{"description":"Записи нет в рабочем пространстве пользователя (в том числе запись другого пространства) или срок хранения истёк"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/crm/activate":{"post":{"tags":["CRM"],"summary":"Активировать интеграцию с CRM","requestBody":{"description":"Данные пользователя","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"crm":{"$ref":"#/components/schemas/CrmType"},"user_data":{"type":"object","description":"Данные главного пользователя","properties":{"id":{"type":"string","description":"id главного пользователя в CRM","example":1234567890},"name":{"type":"string","description":"ФИО главного пользователя","example":"Иванов Иван Иванович"},"email":{"type":"string","description":"Email главного пользователя","example":"user@mail.ru"},"phone":{"type":"string","description":"Телефон главного пользователя","example":79999999999}}},"user_data_sign":{"type":"string","description":"Хеш для валидации запроса","example":"adafd23849f37f49ae23efd56c2a2acb0d6df5f2"}}}}}},"responses":{"201":{"description":"Возвращается URL-токен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlToken"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents":{"get":{"tags":["Контрагенты"],"summary":"Получить список контрагентов","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"filter","description":"Фильтр по полям контрагента","schema":{"type":"string"}},{"in":"query","name":"selfowned","description":"Признак \"мой контрагент\"","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/type"},{"$ref":"#/components/parameters/sort"},{"in":"query","name":"from","description":"Номер записи, с которой осуществлять выборку (0-based)","schema":{"type":"integer"}},{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"integer"}}],"responses":{"200":{"description":"Возвращается список контрагентов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Контрагенты"],"summary":"Создать нового контрагента","security":[{"BearerAuth":[]}],"requestBody":{"description":"Контрагент","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCounteragent"}}}},"responses":{"201":{"description":"Возвращается контрагент","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Counteragent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/batch":{"post":{"tags":["Контрагенты"],"summary":"Создать новых контрагентов пакетом","security":[{"BearerAuth":[]}],"requestBody":{"description":"Контрагенты","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NewCounteragent"}}}}},"responses":{"201":{"description":"Возвращаются контрагенты","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Counteragent"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/{id}":{"get":{"tags":["Контрагенты"],"summary":"Получить контрагента по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается контрагент","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Counteragent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Контрагенты"],"summary":"Обновить контрагента","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Контрагент","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCounteragent"}}}},"responses":{"200":{"description":"Возвращается контрагент","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Counteragent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Контрагенты"],"summary":"Удалить контрагента по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленного контрагента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/favorites":{"get":{"tags":["Контрагенты"],"summary":"Получить список избранных контрагентов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список избранных контрагентов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/favorites/{id}":{"put":{"tags":["Контрагенты"],"summary":"Добавить контрагента в избранное","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается контрагент","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Counteragent"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Контрагенты"],"summary":"Удалить контрагента из избранного","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается контрагент","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Counteragent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/excel":{"get":{"tags":["Контрагенты"],"summary":"Получить файл Excel с информацией о контрагентах","description":"Нужны права counteragents:view и counteragentsXlsx:download (преференция группы «Скачивать контрагентов XLSX»; по умолчанию включена у всех групп, у группы администраторов — всегда). Без них ответ 403 с текстом ресурса permission.group («У вашей группы недостаточно прав»)","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/type"},{"$ref":"#/components/parameters/sort"}],"responses":{"200":{"description":"Возвращается файл xslx","content":{"application/vnd.ms-excel":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"description":"Нет права counteragents:view или преференции counteragentsXlsx:download (ресурс permission.group)"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/baseattrs":{"get":{"tags":["Контрагенты"],"summary":"Получить список базовых переменных контрагентов","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/type"}],"responses":{"200":{"description":"Возвращается список переменных","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CounteragentBaseattr"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Контрагенты"],"summary":"Создать новую базовую переменную контрагента","security":[{"BearerAuth":[]}],"requestBody":{"description":"Контрагент","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentBaseattr"}}}},"responses":{"201":{"description":"Возвращается переменная контрагента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentBaseattr"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/baseattrs/{type}/{id}":{"delete":{"tags":["Контрагенты"],"summary":"Удалить базовую переменную контрагента","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"type","required":true,"description":"Тип","example":"entity","schema":{"$ref":"#/components/schemas/CounteragentType"}},{"in":"path","name":"id","required":true,"description":"id переменной","example":101,"schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается переменная контрагента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentBaseattr"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/matching":{"get":{"tags":["Контрагенты"],"summary":"Правила «Как определяем контрагентов» по типам","description":"Читают все пользователи; менять может администратор рабочего пространства (editable). Пока рабочее пространство не сохранило свои правила, действует базовый набор (isDefault).","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Правила по типам и базовый набор","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentMatching"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/matching/{type}":{"put":{"tags":["Контрагенты"],"summary":"Сохранить правила «Как определяем контрагентов» типа","description":"Только администратор рабочего пространства (иначе 403 permission.onlyadmin). Списки блоков заменяются целиком. Изменения действуют с текущего момента, существующие карточки не меняются.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"type","required":true,"description":"Тип контрагента: entity — юрлицо, person — физлицо, individual — ИП","schema":{"$ref":"#/components/schemas/CounteragentType"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentMatchingRules"},"example":{"required":[["304","2006"],["305","2006"]],"match":[["2006","2009"],["2006"],["302"],["304"],["305"]]}}}},"responses":{"200":{"description":"Правила по типам после сохранения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentMatching"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"description":"Пользователь не администратор рабочего пространства (permission.onlyadmin)"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Контрагенты"],"summary":"Вернуть базовый набор правил «Как определяем контрагентов» для типа","description":"Удаляет собственные правила рабочего пространства для типа, после чего действует базовый набор (isDefault). Только администратор рабочего пространства (иначе 403 permission.onlyadmin).","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"type","required":true,"description":"Тип контрагента: entity — юрлицо, person — физлицо, individual — ИП","schema":{"$ref":"#/components/schemas/CounteragentType"}}],"responses":{"200":{"description":"Правила по типам после сброса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentMatching"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"description":"Пользователь не администратор рабочего пространства (permission.onlyadmin)"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/counteragents/duplicates":{"get":{"tags":["Контрагенты"],"summary":"Поиск дублей","description":"Карточки типа, которые по правилам «Как определяем» считаются одной карточкой, по группам (временный фильтр справочника).","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"type","required":true,"description":"Тип контрагента: entity — юрлицо, person — физлицо, individual — ИП","schema":{"$ref":"#/components/schemas/CounteragentType"}},{"in":"query","name":"filter","description":"Фильтр по полям контрагента (строка поиска)","schema":{"type":"string"}},{"$ref":"#/components/parameters/sort"},{"in":"query","name":"from","description":"Номер записи, с которой осуществлять выборку (0-based)","schema":{"type":"integer"}},{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"integer"}}],"responses":{"200":{"description":"Карточки-дубли","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounteragentDuplicates"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/converters/doctohtml":{"post":{"tags":["Конвертеры"],"summary":"Конвертировать doc в html","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для конвертации","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/File"}}}},"responses":{"200":{"description":"Возвращается html","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"HTML-содержимое документа (тело без обёртки html/body, после фильтрации и с проставленными стилями по умолчанию)","example":"<html>test</html>"},"border":{"type":"object","description":"Поля страницы по умолчанию","properties":{"top":{"type":"string","description":"Отступ вверху","example":"2.00cm"},"bottom":{"type":"string","description":"Отступ внизу","example":"2.00cm"},"left":{"type":"string","description":"Отступ слева","example":"2.00cm"},"right":{"type":"string","description":"Отступ справа","example":"1.00cm"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/converters/doctopdf":{"post":{"tags":["Конвертеры"],"summary":"Конвертировать docx (doc) в pdf","security":[{"BearerAuth":[]}],"requestBody":{"description":"Файл для конвертации","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/File"}}}},"responses":{"200":{"description":"Возвращается pdf","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/converters/pdftodoc/external":{"post":{"tags":["Конвертеры"],"summary":"Конвертировать pdf в docx через внешний сервис","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для конвертации","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/File"}}}},"responses":{"200":{"description":"Возвращается docx (файл response.docx)","content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"description":"Ошибка сервиса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/converters/pdftodoc/external-test":{"post":{"tags":["Конвертеры"],"summary":"Конвертировать pdf в docx встроенным конвертером","description":"Конвертация PDF в DOCX конвертером внутри приложения, независимо от настройки режима сервера (нужно для сравнения результата с внешним сервисом на реальных файлах). Ответ — файл response.docx.","security":[{"BearerAuth":[]}],"requestBody":{"description":"PDF-файл для конвертации","required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/File"}}}},"responses":{"200":{"description":"Возвращается docx","content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Файл не передан (validation.file.notfound) или конвертация не удалась (rendering.error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/statics/defaultStyle":{"post":{"tags":["Статические файлы"],"summary":"Записать файл стилей","security":[{"BearerAuth":[]}],"requestBody":{"description":"Файл","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}}}}},"responses":{"201":{"description":"Возвращается ссылка на файл","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Адрес загруженного файла стилей","example":"http://safe.forma.today/default-style.css"}}}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/cattrs":{"get":{"tags":["Пользовательские переменные"],"summary":"Получить список переменных","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Имя переменной (поиск по регулярному выражению)","schema":{"type":"string"}},{"in":"query","name":"type","description":"Тип переменной (поиск по точному совпадению)","schema":{"$ref":"#/components/schemas/CattrType"}}],"responses":{"200":{"description":"Возвращается список переменных по заданным условиям","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Cattr"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Пользовательские переменные"],"summary":"Создать новую переменную","security":[{"BearerAuth":[]}],"requestBody":{"description":"Переменная","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCattr"}}}},"responses":{"201":{"description":"Возвращается переменная","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cattr"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/cattrs/{id}":{"get":{"tags":["Пользовательские переменные"],"summary":"Получить переменную по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается переменная","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cattr"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Пользовательские переменные"],"summary":"Обновить переменную","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Переменная","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCattr"}}}},"responses":{"200":{"description":"Возвращается переменная","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cattr"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Пользовательские переменные"],"summary":"Удалить переменную по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной переменной","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/cattrs/similars":{"get":{"tags":["Пользовательские переменные"],"summary":"Получить список переменных, похожих на заданную","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","required":true,"description":"Имя переменной","example":"нумбер паспарта","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается список переменных, похожих на заданный","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Тип переменной","example":"strictattr"},"id":{"type":"string","description":"id переменной","example":1005},"name":{"type":"string","description":"Наименование переменной","example":"Номер паспорта"},"distance":{"type":"number","description":"Расстояние между переменной и заданной","example":0.25}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/buttonsettings":{"get":{"tags":["Настройки воркспейса"],"summary":"Настройка видимости кнопок воркспейса","description":"Читают все пользователи воркспейса. Пока функция недоступна (available false), списки пустые - все кнопки видны.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Настройки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ButtonSettings"},"example":{"available":true,"hiddenButtons":{"render":["downloadDocx","massRender"],"document":["downloadDocx"]},"editable":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Настройки воркспейса"],"summary":"Сохранить скрытые кнопки","description":"Меняет администратор воркспейса; списки заменяются целиком. Неизвестный код кнопки - 400 (buttonsettings.invalid), функция недоступна - 400 (buttonsettings.unavailable).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hiddenButtons"],"properties":{"hiddenButtons":{"$ref":"#/components/schemas/HiddenButtons"}}}}}},"responses":{"200":{"description":"Сохранённые настройки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ButtonSettings"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Пользователь не в группе администраторов воркспейса"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{id}/buttons":{"put":{"tags":["Рабочие пространства"],"summary":"Свойство воркспейса «Настройка видимости кнопок» (администратор сервиса)","description":"default - как в общей настройке сервиса workspaces.buttons.enabled (по умолчанию выключена), enabled / disabled - явно для воркспейса.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["buttonsAccess"],"properties":{"buttonsAccess":{"type":"string","enum":["default","enabled","disabled"],"description":"default — по общей настройке сервиса workspaces.buttons.enabled, enabled — включена воркспейсу, disabled — выключена","example":"enabled"}}}}}},"responses":{"200":{"description":"Сохранённое значение","content":{"application/json":{"example":{"id":"6ad973f3669f6e7194c48199","buttonsAccess":"enabled"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/boxlicensespublic/check":{"post":{"tags":["Лицензии коробки (публичные методы)"],"summary":"Проверить лицензию коробки по коду (коробка)","description":"Вызывает сервер коробки (on-prem версии), без авторизации: активация, продление и периодическая проверка лицензии — один и тот же метод, он же источник подписанного времени вендора. Первая успешная проверка привязывает код к установке (installId); с другой установки код вернёт reason = bound, пока администратор не сбросит привязку. Ответ всегда подписан ключом вендора (Ed25519), коробка не доверяет неподписанному. Ограничение частоты по IP — при превышении 429; если на сервере не задан ключ подписи — 503.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","installId"],"properties":{"code":{"type":"string","minLength":8,"maxLength":64,"description":"Код лицензии (регистр и разделители не важны)","example":"ABCDE-FGHJK-LMNPQ-RS234"},"installId":{"type":"string","minLength":8,"maxLength":100,"description":"id установки (сервера) коробки","example":"9b1d4c7e-0000-4a00-8000-123456789abc"},"version":{"type":"string","maxLength":40,"description":"Версия коробки (сохраняется для администратора)","example":"1.4.0"}}}}}},"responses":{"200":{"description":"Подписанный ответ о лицензии","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean","description":"Лицензия действует для этой установки","example":true},"reason":{"type":"string","enum":["notfound","notstarted","expired","revoked","bound"],"description":"Причина отказа (только при valid = false) — notfound код не найден, notstarted срок ещё не начался, expired срок истёк, revoked отозвана, bound код привязан к другой установке","example":"expired"},"time":{"type":"string","format":"date-time","description":"Время вендора (ISO)","example":"2026-11-07T10:00:00.000Z"},"timeSignature":{"type":"string","description":"Подпись (base64) текста \"time:<time>\"","example":"MEUCIQ..."},"licenseId":{"type":"string","description":"id лицензии (есть, если код найден)","example":"3f0c9a52-7a4e-4d2b-9a77-1f2e3d4c5b6a"},"checkSignature":{"type":"string","description":"Подпись (base64) текста \"check:<installId>:<licenseId>:<valid>:<time>\" (есть, если код найден)","example":"MEUCIQ..."},"license":{"type":"object","description":"Подписанный файл лицензии (только при valid = true)","properties":{"license":{"type":"object","description":"Данные лицензии","properties":{"v":{"type":"integer","description":"Версия формата (1)","example":1},"id":{"type":"string","description":"id лицензии","example":"3f0c9a52-7a4e-4d2b-9a77-1f2e3d4c5b6a"},"org":{"type":"string","description":"Организация","example":"ООО Ромашка"},"installId":{"type":"string","description":"Установка, к которой привязана лицензия","example":"9b1d4c7e-0000-4a00-8000-123456789abc"},"issuedAt":{"type":"string","format":"date-time","description":"Начало срока действия","example":"2026-11-01T00:00:00.000Z"},"expiresAt":{"type":"string","format":"date-time","description":"Конец срока действия","example":"2027-11-01T00:00:00.000Z"},"perpetual":{"type":"boolean","description":"Бессрочная лицензия","example":false},"modules":{"type":"array","description":"Модули лицензии","items":{"type":"string","description":"Код модуля"},"example":["core"]}}},"signature":{"type":"string","description":"Подпись Ed25519 (base64) канонического JSON поля license (ключи отсортированы)","example":"MEUCIQ..."}}}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"429":{"description":"Слишком много запросов с этого адреса"},"503":{"description":"Сервис лицензий не настроен (нет ключа подписи)"}}}},"/boxlicensesadmin":{"get":{"tags":["Лицензии коробки (админка)"],"summary":"Список лицензий коробки (коробка)","description":"Только администратор сервиса с ролью COMMON_ADMIN (иначе 403). Новые первыми.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Лицензии","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BoxLicense"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"}}},"post":{"tags":["Лицензии коробки (админка)"],"summary":"Создать лицензию коробки (коробка)","description":"Только COMMON_ADMIN. Код и licenseId создаёт сервер. Нужна дата окончания (позже начала) или признак бессрочной (тогда срок — 99 лет от начала).\n","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["org","startsAt"],"properties":{"org":{"type":"string","minLength":1,"maxLength":200,"description":"Организация, на которую выдаётся лицензия","example":"ООО Ромашка"},"inn":{"type":"string","maxLength":20,"description":"ИНН организации","example":"7700000000"},"startsAt":{"type":"string","format":"date-time","description":"Начало срока действия (дата или дата-время)","example":"2026-11-01T00:00:00.000Z"},"expiresAt":{"type":"string","format":"date-time","description":"Конец срока действия; обязателен, если perpetual не true","example":"2027-11-01T00:00:00.000Z"},"perpetual":{"type":"boolean","description":"Бессрочная лицензия (expiresAt не нужен)","example":false},"modules":{"type":"array","maxItems":20,"description":"Модули лицензии (каждый 1-40 символов); пусто или не передано — [core]","items":{"type":"string","description":"Код модуля"},"example":["core"]},"note":{"type":"string","maxLength":2000,"description":"Заметка администратора","example":"Договор № 15 от 01.11.2026"}}}}}},"responses":{"201":{"description":"Созданная лицензия","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoxLicense"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"}}}},"/boxlicensesadmin/{id}":{"put":{"tags":["Лицензии коробки (админка)"],"summary":"Изменить лицензию коробки (коробка)","description":"Только COMMON_ADMIN. Поля необязательны, непереданное не меняется; срок проверяется заново (конец позже начала или бессрочная). Код и привязка не меняются.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"org":{"type":"string","minLength":1,"maxLength":200,"description":"Организация","example":"ООО Ромашка"},"inn":{"type":"string","maxLength":20,"description":"ИНН организации","example":"7700000000"},"startsAt":{"type":"string","format":"date-time","description":"Начало срока действия","example":"2026-11-01T00:00:00.000Z"},"expiresAt":{"type":"string","format":"date-time","description":"Конец срока действия (продление)","example":"2028-11-01T00:00:00.000Z"},"perpetual":{"type":"boolean","description":"Бессрочная лицензия","example":false},"modules":{"type":"array","maxItems":20,"description":"Модули лицензии; пустой массив — [core]","items":{"type":"string","description":"Код модуля"},"example":["core"]},"note":{"type":"string","maxLength":2000,"description":"Заметка администратора","example":"Продлено до 2028"}}}}}},"responses":{"200":{"description":"Лицензия после изменения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoxLicense"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Лицензии коробки (админка)"],"summary":"Удалить лицензию коробки (коробка)","description":"Только COMMON_ADMIN. Удалить можно только ни разу не активированную лицензию (не привязанную к установке), иначе 400 — отзовите её.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"id удалённой лицензии","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/boxlicensesadmin/{id}/revoke":{"post":{"tags":["Лицензии коробки (админка)"],"summary":"Отозвать лицензию коробки (коробка)","description":"Только COMMON_ADMIN. Следующая проверка коробки вернёт valid = false, reason = revoked.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Лицензия после отзыва","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoxLicense"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/boxlicensesadmin/{id}/restore":{"post":{"tags":["Лицензии коробки (админка)"],"summary":"Восстановить отозванную лицензию коробки (коробка)","description":"Только COMMON_ADMIN. Снимает отзыв.","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Лицензия после восстановления","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoxLicense"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/boxlicensesadmin/{id}/resetbinding":{"post":{"tags":["Лицензии коробки (админка)"],"summary":"Сбросить привязку кода лицензии к установке (коробка)","description":"Только COMMON_ADMIN. Удаляет installId и boundAt — код можно активировать на другой установке (переезд сервера).","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"Лицензия после сброса привязки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoxLicense"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет роли COMMON_ADMIN"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/auth/check":{"post":{"tags":["Вход в систему"],"summary":"Проверка email перед регистрацией","requestBody":{"description":"Email","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Логин (адрес электронной почты)","example":"user@mail.ru"}}}}}},"responses":{"200":{"description":"Возвращается, если email валиден","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/register":{"post":{"tags":["Вход в систему"],"summary":"Регистрация нового пользователя (аккаунт партнера)","requestBody":{"description":"Данные для регистрации","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginPasswordUser"}}}},"responses":{"201":{"description":"Возвращается id пользователя и токен авторизации","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/Token"}]}}}},"400":{"$ref":"#/components/responses/AlreadyExists"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/confirm":{"post":{"tags":["Вход в систему"],"summary":"Подтверждение адреса электронной почты","requestBody":{"description":"Данные для подтверждения","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/Key"}]}}}},"responses":{"201":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/login":{"post":{"tags":["Вход в систему"],"summary":"Вход в систему с помощью email и получение токена","requestBody":{"description":"Данные для аутентификации","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginPassword"}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/apikey":{"post":{"tags":["Вход в систему"],"summary":"Вход в систему с помощью API-ключа и получение токена","requestBody":{"description":"API-ключ","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","description":"API-ключ","example":"XQyRYUwgCs5L8W3I5VbADPANgUCxrCwpZvBJFyRrLio6aqLuXrRCJ1FkjcErQQEjkwO96oN1MYCcgEFJmsxLTKp4PdevuP1PqW74GHtl7C8Td2XheSKK5rgqwp4m9rNB"}}}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/yclients":{"post":{"tags":["Вход в систему"],"summary":"Вход в систему с помощью данных филиала YCLIENTS","requestBody":{"description":"Данные филиала","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"salon_id":{"type":"integer","description":"id филиала","example":1312083},"hash":{"type":"string","description":"Хеш для валидации запроса","example":"adafd23849f37f49ae23efd56c2a2acb0d6df5f2"}}}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/crm":{"post":{"tags":["Вход в систему"],"summary":"Вход в систему с помощью данных CRM","requestBody":{"description":"Данные CRM","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"crm":{"$ref":"#/components/schemas/CrmType"},"user_id":{"type":"string","description":"id пользователя","example":1312083},"hash":{"type":"string","description":"Хеш для валидации запроса","example":"adafd23849f37f49ae23efd56c2a2acb0d6df5f2"}}}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/urltoken":{"post":{"tags":["Вход в систему"],"summary":"Вход в систему с помощью URL-токена","requestBody":{"description":"URL-токен","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"urlToken":{"type":"string","description":"URL-токен","example":"04d125b0c994432dbf09a6fe3b503c8e"}}}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/recover":{"post":{"tags":["Вход в систему"],"summary":"Запрос восстановления пароля","requestBody":{"description":"Email","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Логин (адрес электронной почты)","example":"user@mail.ru"}}}}}},"responses":{"200":{"description":"Возвращается, если запрос выполнен успешно","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/Key"}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/recoverpassword":{"post":{"tags":["Вход в систему"],"summary":"Восстановление пароля","requestBody":{"description":"Данные для восстановления","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/Key"},{"type":"object","properties":{"password":{"type":"string","description":"Пароль","example":"Passw0rD"}}}]}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/invitepassword":{"post":{"tags":["Вход в систему"],"summary":"Подтверждение приглашенного пользователя","requestBody":{"description":"Данные для подтверждения","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/Key"},{"type":"object","properties":{"password":{"type":"string","description":"Пароль","example":"Passw0rD"}}}]}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/easyregister":{"post":{"tags":["Вход в систему"],"summary":"Простая регистрация","requestBody":{"description":"Данные для регистрации","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Логин (адрес электронной почты)","example":"user@mail.ru"},"code":{"type":"string","description":"Код проверки","example":726739},"name":{"type":"string","description":"ФИО","example":"Иванов Иван Иванович"},"phone":{"type":"string","description":"Телефон","example":79121324567}}}}}},"responses":{"200":{"description":"Возвращается токен авторизации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/verifyeasyregister":{"post":{"tags":["Вход в систему"],"summary":"Отправка письма с кодом подтверждения адреса почты для регистрации","requestBody":{"description":"Данные для регистрации","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Логин (адрес электронной почты)","example":"user@mail.ru"}}}}}},"responses":{"200":{"description":"Возвращается, если запрос выполнен успешно","content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","description":"Логин (адрес электронной почты)","example":"user@mail.ru"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/areasofactivitypublic/all":{"get":{"tags":["Сфера деятельности"],"summary":"Получить все сферы деятельности","responses":{"200":{"description":"Возвращаются сферы деятельности","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AreaOfActivity"}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/areasofactivity":{"get":{"tags":["Сфера деятельности"],"summary":"Получить сферу деятельности по параметру","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"name","description":"Имя сферы деятельности","schema":{"type":"string"}},{"in":"query","name":"okved","description":"ОКВЭД","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается сфера деятельности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaOfActivity"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/appendixjournal":{"get":{"tags":["Вложения"],"summary":"Журнал «Вложений» воркспейса","description":"Файлы «Вложений»: вложения документов (внешних заполнений), файлы задач, подписанные PDF ПЭП и архивы подписанных документов УКЭП, хранящиеся у нас; новые сверху, по 100 на страницу. Видны документы, которые пользователь видит в списках документов: права externalInfills:view, signedExternalInfills:view (ПЭП), renders:view (УКЭП), скрытые шаблоны и «только свои документы» групп. Без прав просмотра — 403.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","minimum":1,"default":1},"description":"Номер страницы"}],"responses":{"200":{"description":"Страница журнала","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AppendixJournalItem"}},"count":{"type":"integer","description":"Всего файлов в журнале","example":152},"page":{"type":"integer","example":1},"pageSize":{"type":"integer","example":100}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права просмотра документов"}}}},"/appendixjournal/download":{"post":{"tags":["Вложения"],"summary":"Скачать выбранные файлы журнала архивом","description":"ZIP-архив attachments.zip: папка на документ или задачу, совпадающие имена получают суффикс « (2)». Каждый файл должен быть виден пользователю в журнале, иначе 404.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendixJournalItems"}}}},"responses":{"200":{"description":"Архив","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права просмотра документов"},"404":{"description":"Файл не найден (удалён, чужой или скрыт от пользователя)"}}}},"/appendixjournal/delete":{"post":{"tags":["Вложения"],"summary":"Удалить выбранные файлы журнала","description":"Необратимо удаляет файлы и возвращает их объём во «Вложения». В документе вложение остаётся с отметкой deletedAt (в карточке — «Файлы удалены пользователем»); у подписанного документа — отметка signedPdfDeletedAt (ПЭП) или signature.archiveDeletedAt (УКЭП), скачивание и предпросмотр такого документа отвечают 400 с ресурсом signedfile.deletedbyuser; файл задачи удаляется из задачи с записью в истории. Файлы без права удаления (canDelete = false) пропускаются. Нужно право удалять документы (externalInfills:delete, signedExternalInfills:delete или renders:delete).","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendixJournalItems"}}}},"responses":{"201":{"description":"Итог удаления","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"integer","example":3},"skipped":{"type":"integer","description":"Пропущено без права удаления или из-за кабинета подписанта","example":1},"freed":{"type":"integer","description":"Освобождено, байт","example":307200}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права удалять документы"},"404":{"description":"Файл не найден (уже удалён, чужой или скрыт от пользователя)"}}}},"/apikey/check":{"post":{"tags":["API-ключ"],"summary":"Проверить существование API-ключа","requestBody":{"description":"API-ключ","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string","description":"API-ключ","example":"XQyRYUwgCs5L8W3I5VbADPANgUCxrCwpZvBJFyRrLio6aqLuXrRCJ1FkjcErQQEjkwO96oN1MYCcgEFJmsxLTKp4PdevuP1PqW74GHtl7C8Td2XheSKK5rgqwp4m9rNB"}}}}}},"responses":{"200":{"description":"Возвращается результат проверки","content":{"application/json":{"schema":{"type":"object","properties":{"exists":{"type":"boolean","description":"Существует ли API-ключ","example":true}}}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/apikey/usage":{"get":{"tags":["API-ключ"],"summary":"Счётчики запросов по API-ключу воркспейса","description":"Возвращает статистику запросов по API-ключу текущего воркспейса (всего, сегодня, текущий и прошлый месяц по московским датам), дневной лимит и остаток. Нужно право apiKey:view. Доступно без оплаченного тарифа.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются счётчики и лимит","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Включён ли доступ по API-ключу для воркспейса (false — администратор сервиса отключил доступ)","example":true},"limit":{"type":"number","description":"Дневной лимит запросов (свой лимит воркспейса, иначе значение настройки apikey.dailyLimit)","example":1000},"total":{"type":"number","description":"Всего запросов по ключу за всё время","example":15230},"today":{"type":"number","description":"Принято запросов за сегодня (по московскому времени)","example":42},"remaining":{"type":"number","description":"Сколько запросов осталось на сегодня (лимит минус сегодняшние, не меньше 0)","example":958},"currentMonth":{"type":"number","description":"Запросов за текущий календарный месяц (по московским датам)","example":820},"previousMonth":{"type":"number","description":"Запросов за прошлый календарный месяц (по московским датам)","example":1310},"resetAt":{"type":"string","format":"date-time","description":"Момент следующего сброса дневного счётчика (ближайшие 00:00 по Москве)","example":"2026-11-07T21:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права apiKey:view"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/apikey/log":{"get":{"tags":["API-ключ"],"summary":"Журнал запросов по API-ключу","description":"Последние запросы по API-ключу (до 1000, новые сначала) — метод, URL (секретные параметры запроса скрыты как ***), IP и время; тело и заголовки не сохраняются. По умолчанию — запросы текущего пользователя; пользователь с правом users:view может передать uid другого пользователя воркспейса. Нужно право apiKey:view. Доступно без оплаченного тарифа.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"uid","description":"id пользователя воркспейса, чей журнал нужен. Учитывается только при праве users:view, иначе возвращается журнал текущего пользователя","required":false,"schema":{"type":"string","example":"62bb25949213f16bcd934422"}}],"responses":{"200":{"description":"Возвращается список записей журнала","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"wid":{"type":"string","description":"id воркспейса","example":"62bb25949213f16bcd934422"},"uid":{"type":"string","description":"id пользователя, чьим ключом выполнен запрос","example":"62bb25949213f16bcd934422"},"method":{"type":"string","description":"HTTP-метод запроса","example":"GET"},"url":{"type":"string","description":"URL запроса; значения секретных параметров (key, token, secret, pass, sign и т.п.) заменены на ***","example":"/templates?limit=10&apikey=***"},"ip":{"type":"string","description":"IP-адрес клиента (может отсутствовать)","example":"192.0.2.10"},"createdAt":{"type":"string","format":"date-time","description":"Время запроса","example":"2026-11-07T10:15:30.000Z"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Нет права apiKey:view"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics":{"get":{"tags":["Аналитика"],"summary":"Получить общую аналитику для дашборда","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается общая аналитика по всему сервису","content":{"application/json":{"schema":{"type":"object","properties":{"registers":{"description":"Регистрации рабочих пространств с начала дня, недели (ISO, с понедельника) и месяца (UTC)","allOf":[{"$ref":"#/components/schemas/DayCount"},{"$ref":"#/components/schemas/WeekCount"},{"$ref":"#/components/schemas/MonthCount"}]},"payments":{"type":"object","description":"Оплаты (карта и счета вместе) с начала дня, недели и месяца — количество и сумма","properties":{"day":{"description":"С начала дня","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"week":{"description":"С начала недели","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"month":{"description":"С начала месяца","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}},"conversion":{"type":"object","description":"Конверсия регистраций в оплаты за период, % (число оплат / число регистраций × 100)","properties":{"day":{"type":"number","description":"Конверсия за день, %","example":0},"week":{"type":"number","description":"Конверсия за неделю, %","example":1.5},"month":{"type":"number","description":"Конверсия за месяц, %","example":2.25}}},"averageScore":{"type":"object","description":"Средний балл пользователей за период","properties":{"day":{"type":"number","description":"Средний балл за день","example":12.5},"week":{"type":"number","description":"Средний балл за неделю","example":14.25},"month":{"type":"number","description":"Средний балл за месяц","example":13.8}}},"averagePayment":{"type":"object","description":"Средний чек за период (сумма оплат / число оплат)","properties":{"day":{"type":"number","description":"Средний чек за день","example":0},"week":{"type":"number","description":"Средний чек за неделю","example":2900.5},"month":{"type":"number","description":"Средний чек за месяц","example":20080}}},"tcRequests":{"description":"Заявки на создание шаблона — с начала дня, недели и ожидающие","allOf":[{"$ref":"#/components/schemas/DayCount"},{"$ref":"#/components/schemas/WeekCount"},{"type":"object","properties":{"pending":{"type":"integer","description":"Ожидают заполнения","example":2}}}]},"templatesCreated":{"description":"Создано шаблонов с начала дня, недели, месяца и года","allOf":[{"$ref":"#/components/schemas/DayCount"},{"$ref":"#/components/schemas/WeekCount"},{"$ref":"#/components/schemas/MonthCount"},{"$ref":"#/components/schemas/YearCount"}]},"rendersCreated":{"description":"Создано документов по шаблонам с начала дня, недели, месяца и года","allOf":[{"$ref":"#/components/schemas/DayCount"},{"$ref":"#/components/schemas/WeekCount"},{"$ref":"#/components/schemas/MonthCount"},{"$ref":"#/components/schemas/YearCount"}]},"ltv":{"type":"object","description":"LTV — пожизненная ценность клиента (сумма и длительность)","properties":{"amount":{"type":"number","description":"Цена","example":39130},"duration":{"type":"number","description":"Длина (в днях)","example":30}}},"leadDuration":{"type":"number","description":"Длина сделки (в днях)","example":12},"topTariff":{"type":"object","description":"Самый популярный платный тариф","properties":{"count":{"type":"integer","description":"Количество экземпляров тарифа","example":1543},"tariffId":{"type":"string","description":"ID тарифа","example":"tariff_team"},"name":{"type":"string","description":"Название тарифа","example":"Тариф Команда"},"duration":{"type":"number","description":"Длина тарифа (в днях)","example":30},"percent":{"type":"number","description":"Процент от всех остальных платных тарифов","example":37.5}}},"crm":{"type":"array","description":"Статусы основной воронки amoCRM с количеством лидов","items":{"type":"object","properties":{"id":{"type":"integer","description":"ID статуса воронки","example":57370942},"name":{"type":"string","description":"Название статуса воронки","example":"Новый лид"},"color":{"type":"string","description":"Цвет статуса воронки","example":"#99ccff"},"link":{"type":"string","description":"Ссылка на статус воронки","example":"https://formasales.amocrm.ru/api/v4/leads/pipelines/6792954/statuses/57370942"},"count":{"type":"integer","description":"Количество лидов в статусе воронки","example":34}}}},"topOs":{"type":"array","description":"Самые частые операционные системы пользователей","items":{"type":"object","properties":{"count":{"type":"integer","description":"Количество","example":54231},"name":{"type":"string","description":"Название","example":"Windows"},"percent":{"type":"number","description":"Процент от общего числа","example":88.70967741935483}}}},"topResolution":{"type":"array","description":"Самые частые разрешения экрана пользователей","items":{"type":"object","properties":{"count":{"type":"integer","description":"Количество","example":54231},"name":{"type":"string","description":"Название","example":"1000x1000"},"percent":{"type":"number","description":"Процент от общего числа","example":88.70967741935483}}}},"topBrowsers":{"type":"array","description":"Самые частые браузеры пользователей","items":{"type":"object","properties":{"count":{"type":"integer","description":"Количество","example":54231},"name":{"type":"string","description":"Название","example":"Opera"},"percent":{"type":"number","description":"Процент от общего числа","example":88.70967741935483}}}},"dau":{"type":"integer","description":"Количество активных пользователей (за последние 24 часа)","example":99578},"sharedTemplates":{"type":"object","description":"Общие шаблоны — всего и созданные за 7 дней","properties":{"total":{"type":"integer","description":"Общее количество","example":3058},"lastWeek":{"type":"integer","description":"Создано за последние 7 дней","example":25}}},"lastUpdate":{"type":"string","description":"Последнее обновление аналитики","example":"2024-01-24T17:15:11.924Z"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/registers":{"get":{"tags":["Аналитика"],"summary":"Получить аналитику по регистрациям для дашборда","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"dateAt","description":"Дата (от)","example":"2024-01-31T21:00:00.000Z","schema":{"type":"string"}},{"in":"query","name":"dateTo","description":"Дата (до)","example":"2024-01-31T21:00:00.000Z","schema":{"type":"string"}},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Возвращаются регистрации по дням для дашборда","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","description":"Регистрации рабочих пространств по дням (от нового к старому, диапазон from–to)","items":{"type":"object","properties":{"date":{"type":"string","description":"Дата","example":"2024-01-31T21:00:00.000Z"},"count":{"type":"integer","description":"Количество регистраций","example":14024},"averageScore":{"type":"number","nullable":true,"description":"Средний балл пользователей за этот день","example":50},"lastDayDiff":{"type":"integer","description":"Разница в количестве регистраций с предыдущим днём","example":593}}}},"users":{"type":"array","description":"Регистрации пользователей по дням (от нового к старому, диапазон from–to)","items":{"type":"object","properties":{"date":{"type":"string","description":"Дата","example":"2024-01-31T21:00:00.000Z"},"count":{"type":"integer","description":"Количество регистраций","example":14024},"lastDayDiff":{"type":"integer","description":"Разница в количестве регистраций с предыдущим днём","example":593}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/payments":{"get":{"tags":["Аналитика"],"summary":"Получить аналитику по оплатам для дашборда","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается аналитика по оплатам для дашборда","content":{"application/json":{"schema":{"type":"object","properties":{"payments":{"type":"object","description":"Оплаты с начала дня, недели (ISO) и месяца (UTC) — всего и отдельно картой и по счетам","properties":{"day":{"description":"С начала дня","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"},{"type":"object","properties":{"card":{"description":"Оплаты картой (подписки эквайринга)","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"invoices":{"description":"Оплаты по счетам","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}}]},"week":{"description":"С начала недели","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"},{"type":"object","properties":{"card":{"description":"Оплаты картой (подписки эквайринга)","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"invoices":{"description":"Оплаты по счетам","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}}]},"month":{"description":"С начала месяца","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"},{"type":"object","properties":{"card":{"description":"Оплаты картой (подписки эквайринга)","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"invoices":{"description":"Оплаты по счетам","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}}]}}},"conversion":{"type":"object","description":"Конверсия регистраций в оплаты за период, % (число оплат / число регистраций × 100)","properties":{"day":{"type":"number","description":"Конверсия за день, %","example":0},"week":{"type":"number","description":"Конверсия за неделю, %","example":1.5},"month":{"type":"number","description":"Конверсия за месяц, %","example":2.25}}},"prolongations":{"type":"object","description":"Продления тарифов с начала дня, недели и месяца — всего и отдельно картой и по счетам","properties":{"day":{"description":"С начала дня","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"},{"type":"object","properties":{"card":{"description":"Продления картой (подписки эквайринга)","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"invoices":{"description":"Продления по счетам","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}}]},"week":{"description":"С начала недели","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"},{"type":"object","properties":{"card":{"description":"Продления картой (подписки эквайринга)","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"invoices":{"description":"Продления по счетам","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}}]},"month":{"description":"С начала месяца","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"},{"type":"object","properties":{"card":{"description":"Продления картой (подписки эквайринга)","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]},"invoices":{"description":"Продления по счетам","allOf":[{"$ref":"#/components/schemas/PaymentCountItem"}]}}}]}}},"paymentsDates":{"type":"object","description":"Отдельные оплаты (картой и по счетам) с датами и суммами — с начала дня, недели, месяца и года","properties":{"day":{"type":"array","description":"Оплаты с начала дня","items":{"$ref":"#/components/schemas/PaymentDateItem"}},"week":{"type":"array","description":"Оплаты с начала недели","items":{"$ref":"#/components/schemas/PaymentDateItem"}},"month":{"type":"array","description":"Оплаты с начала месяца","items":{"$ref":"#/components/schemas/PaymentDateItem"}},"year":{"type":"array","description":"Оплаты с начала года","items":{"$ref":"#/components/schemas/PaymentDateItem"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/{wid}":{"get":{"tags":["Аналитика"],"summary":"Получить аналитику по рабочему пространству","parameters":[{"$ref":"#/components/parameters/wid"},{"$ref":"#/components/parameters/uid"}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается аналитика по рабочему пространству","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsElement"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/{wid}/graph":{"get":{"tags":["Аналитика"],"summary":"Получить значения для графика","parameters":[{"$ref":"#/components/parameters/wid"},{"$ref":"#/components/parameters/uid"},{"in":"query","name":"type","description":"Тип данных (templates, renders, packs, render_packs)","example":"templates","schema":{"type":"string"}},{"in":"query","name":"year","description":"Год для показа данных","example":2022,"schema":{"type":"string"}},{"in":"query","name":"month","description":"Дата месяца для показа данных","example":"2023-11-01T00:00:00","schema":{"type":"string"}}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается данные для графика аналитики по рабочему пространству","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsWorkspaceGraph"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/{wid}/activity":{"get":{"tags":["Аналитика"],"summary":"Получить запросы поиска шаблонов по рабочему пространству","parameters":[{"$ref":"#/components/parameters/wid"},{"$ref":"#/components/parameters/uid"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"in":"query","name":"createdAt","description":"Фильтр по дате (от)","example":"2023-11-01T00:00:00","schema":{"type":"string"}},{"in":"query","name":"createdTo","description":"Фильтр по дате (до)","example":"2023-12-01T00:00:00","schema":{"type":"string"}}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список поисковых запросов по рабочему пространству","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"data":{"type":"string","description":"Данные поиска пользователя","example":"Какие-то данные"},"createdAt":{"type":"string","description":"Дата трекинга действия","example":"2023-11-22T10:17:33.622Z"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/{wid}/crm":{"get":{"tags":["Аналитика"],"summary":"Получить данные из CRM по рабочему пространству","parameters":[{"$ref":"#/components/parameters/wid"}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются данные из CRM по рабочему пространству","content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"array","description":"Примечания лида воркспейса в amoCRM","items":{"type":"object","properties":{"createdAt":{"type":"string","description":"Дата создания","example":"2023-11-24T06:49:59.000Z"},"params":{"type":"object","description":"Параметры примечания amoCRM как есть","properties":{"text":{"type":"string","description":"Текст примечания","example":"Какое-то примечание"}}}}}},"status":{"type":"string","description":"Статус лида в crm","example":"Новый лид"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/{wid}/devices/{uid}":{"get":{"tags":["Аналитика"],"summary":"Получить все устройства пользователя рабочего пространства","parameters":[{"$ref":"#/components/parameters/wid"},{"in":"path","name":"uid","required":true,"description":"ID пользователя","example":"65576f45c1433e2251e97a45","schema":{"type":"string"}}],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается данные об активных устройствах пользователя рабочего пространства","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDevicesElement"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/analytics/featured":{"post":{"tags":["Аналитика"],"summary":"Сделать рабочее пространство избранным","security":[{"BearerAuth":[]}],"requestBody":{"description":"ID рабочего пространства","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"wid":{"type":"string","description":"ID рабочего пространства","example":"65576f45c1433e2251e97a45"}}}}}},"responses":{"201":{"description":"Возвращается сущность избранного рабочего пространства","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeaturedWorkspace"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Аналитика"],"summary":"Удалить рабочее пространство из избранного","security":[{"BearerAuth":[]}],"requestBody":{"description":"ID рабочего пространства","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"wid":{"type":"string","description":"ID рабочего пространства","example":"65576f45c1433e2251e97a45"}}}}}},"responses":{"200":{"description":"Возвращается сущность удалённого рабочего пространства","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeaturedWorkspace"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/amopublic/leadcreated":{"post":{"tags":["amoCRM (публичные методы)"],"summary":"Вебхук amoCRM о создании сделки","description":"Вызывает amoCRM при добавлении сделки. Метод публичный; подлинность запроса в коде не проверяется — сделка запрашивается из amoCRM по id, из её поля «ссылка на воркспейс» берётся id рабочего пространства (24 символа в конце ссылки, иначе 400). Если у рабочего пространства другая сделка, сохраняется новая, а статус сделки сбрасывается. Каждый вызов пишется в журнал amoWebhook.log. Тело — JSON или application/x-www-form-urlencoded (формат вебхуков amoCRM).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmoLeadCreatedNotification"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/AmoLeadCreatedNotification"}}}},"responses":{"201":{"description":"Сделка привязана к рабочему пространству","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Всегда true при успешной обработке","example":true}}}}}},"400":{"$ref":"#/components/responses/InvalidData"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/adminusers":{"get":{"tags":["Работа с администраторами (админка)"],"summary":"Получить список всех администраторов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список всех администраторов","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/AdminUser"},{"type":"object","properties":{"userid":{"type":"string","description":"id пользователя","example":"64ede96ae26c74bc89ff61b6"},"name":{"type":"string","description":"Имя пользователя","example":"Имя пользователя"}}}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Работа с администраторами (админка)"],"summary":"Создать нового администратора","security":[{"BearerAuth":[]}],"requestBody":{"description":"Администратор","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}},"responses":{"200":{"description":"Возвращается сущность администратора","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/adminusers/current":{"get":{"tags":["Работа с администраторами (админка)"],"summary":"Получить сущность текущего администратора","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается сущность администратора","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/adminusers/{id}":{"get":{"tags":["Работа с администраторами (админка)"],"summary":"Получить сущность администратора по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается сущность администратора","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Работа с администраторами (админка)"],"summary":"Удалить сущность администратора по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной сущности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/adminusers/{id}/role":{"put":{"tags":["Работа с администраторами (админка)"],"summary":"Сменить роль администратора","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"description":"Роль администратора","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/AdminUserRole"}}}}}},"responses":{"200":{"description":"Возвращается сущность администратора","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiringpublic/cloudpayments/check":{"post":{"tags":["Эквайринг (публичные методы)"],"summary":"Уведомление CloudPayments Check (проверка платежа)","description":"Вызывает CloudPayments до списания. Метод публичный; подпись уведомления (Content-HMAC) в коде не проверяется — соответствие проверяется по данным: для обычного платежа транзакция ищется по InvoiceId и сверяются рабочее пространство (AccountId), сумма и то, что она ещё не оплачена; для платежа по подписке — подписка, сумма и возможность продления текущего тарифа. Тело — JSON или application/x-www-form-urlencoded. Ошибка обработки — code 13.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsCheckNotification"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CloudPaymentsCheckNotification"}}}},"responses":{"201":{"description":"Возвращается код результата для CloudPayments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsNotificationResponse"}}}}}}},"/acquiringpublic/cloudpayments/pay":{"post":{"tags":["Эквайринг (публичные методы)"],"summary":"Уведомление CloudPayments Pay (успешная оплата)","description":"Вызывает CloudPayments после успешной оплаты. Метод публичный; подпись уведомления в коде не проверяется. Обычный платёж (есть InvoiceId и Token) сохраняет в транзакции номер и дату оплаты, добавляет сумму к оплате экземпляра тарифа, сохраняет карту и подписку; платёж по подписке (без InvoiceId, с SubscriptionId и Token) продлевает тариф (если продление включено) с новой транзакцией или доплачивает текущий, сохраняет карту. Данные об оплате отправляются в amoCRM и YCLIENTS. Всегда отвечает code 0 (ошибки только логируются). Тело — JSON или application/x-www-form-urlencoded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsPayNotification"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CloudPaymentsPayNotification"}}}},"responses":{"201":{"description":"Возвращается код результата для CloudPayments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsNotificationResponse"}}}}}}},"/acquiringpublic/cloudpayments/recurrent":{"post":{"tags":["Эквайринг (публичные методы)"],"summary":"Уведомление CloudPayments Recurrent (изменение подписки)","description":"Вызывает CloudPayments при изменении подписки. Метод публичный; подпись уведомления в коде не проверяется. Подписка рабочего пространства (AccountId) обновляется или создаётся по Id. Всегда отвечает code 0. Тело — JSON или application/x-www-form-urlencoded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsRecurrentNotification"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CloudPaymentsRecurrentNotification"}}}},"responses":{"201":{"description":"Возвращается код результата для CloudPayments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsNotificationResponse"}}}}}}},"/acquiringpublic/cloudpayments/refund":{"post":{"tags":["Эквайринг (публичные методы)"],"summary":"Уведомление CloudPayments Refund (возврат)","description":"Вызывает CloudPayments после возврата. Метод публичный; подпись уведомления в коде не проверяется. Исходная транзакция ищется по PaymentTransactionId (и сверяется AccountId, если передан); сумма возврата прибавляется к возвращённой сумме транзакции, повторное уведомление с тем же TransactionId не учитывается. Всегда отвечает code 0. Тело — JSON или application/x-www-form-urlencoded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsRefundNotification"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CloudPaymentsRefundNotification"}}}},"responses":{"201":{"description":"Возвращается код результата для CloudPayments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsNotificationResponse"}}}}}}},"/acquiringpublic/cloudpayments/receipt":{"post":{"tags":["Эквайринг (публичные методы)"],"summary":"Уведомление CloudKassir Receipt (сформирован чек)","description":"Вызывает CloudPayments (CloudKassir) после формирования онлайн-чека. Метод публичный; подпись уведомления в коде не проверяется. Если транзакция с TransactionId принадлежит рабочему пространству AccountId, в ней сохраняется ссылка на чек (адрес чеков + Id). Всегда отвечает code 0. Тело — JSON или application/x-www-form-urlencoded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsReceiptNotification"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CloudPaymentsReceiptNotification"}}}},"responses":{"201":{"description":"Возвращается код результата для CloudPayments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudPaymentsNotificationResponse"}}}}}}},"/acquiring":{"get":{"tags":["Эквайринг"],"summary":"Получить транзакции эквайринга","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются транзакции","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AcquiringTransaction"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Эквайринг"],"summary":"Создать транзакцию","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"source":{"type":"string","description":"Источник данных — tariffInstance (тариф) или storagePack (пакет Хранилища, разовый платёж без подписки)","enum":["tariffInstance","storagePack"],"example":"tariffInstance"}}}]}}}},"responses":{"201":{"description":"Возвращаются данные для платежа","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcquiringPayData"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiring/detailed":{"get":{"tags":["Эквайринг"],"summary":"Получить оплаченные транзакции эквайринга всех воркспейсов (для отчётов)","description":"Служебный метод без авторизации пользователя: доступ по заголовку token, который должен совпадать с секретом сервиса acquiringDetailsToken (в тестовом окружении env=test проверка не выполняется). Неверный или пустой токен — 403. Возвращаются только транзакции с датой оплаты, по каждой — данные воркспейса, владельца, реквизитов и код услуги 1С тарифа.","parameters":[{"in":"header","name":"token","description":"Служебный токен доступа (секрет acquiringDetailsToken настроек сервиса)","required":true,"schema":{"type":"string"}},{"in":"query","name":"fromDtPay","description":"Начало периода по дате оплаты включительно (дата или дата-время ISO 8601)","schema":{"type":"string","example":"2026-10-01"}},{"in":"query","name":"toDtPay","description":"Конец периода по дате оплаты включительно (дата или дата-время ISO 8601; дата без времени — начало суток)","schema":{"type":"string","example":"2026-10-31T23:59:59.999Z"}}],"responses":{"200":{"description":"Возвращаются оплаченные транзакции","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AcquiringDetailedTransaction"}}}}},"403":{"description":"Неверный или отсутствующий служебный токен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiring/cards":{"get":{"tags":["Эквайринг"],"summary":"Получить привязанные карты","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются карты","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AcquiringCard"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiring/cards/{id}":{"delete":{"tags":["Эквайринг"],"summary":"Удалить карту по id","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id удаленной карты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiring/subscriptions":{"get":{"tags":["Эквайринг"],"summary":"Получить подписки","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются подписки","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AcquiringSubscription"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiring/subscriptions/active":{"get":{"tags":["Эквайринг"],"summary":"Получить активную подписку","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается активная подписка; если активной подписки нет — пустой объект {}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcquiringSubscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Эквайринг"],"summary":"Отменить активную подписку","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается id отмененной подписки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/acquiring/subscriptions/{id}":{"delete":{"tags":["Эквайринг"],"summary":"Отменить подписку","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается id отмененной подписки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdObject"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/details":{"get":{"tags":["Бухгалтерские документы"],"summary":"Получить реквизиты рабочего пространства","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются реквизиты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingDetails"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Бухгалтерские документы"],"summary":"Изменить реквизиты рабочего пространства","security":[{"BearerAuth":[]}],"requestBody":{"description":"Реквизиты","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingDetails"}}}},"responses":{"200":{"description":"Возвращаются реквизиты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingDetails"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/documents":{"get":{"tags":["Бухгалтерские документы"],"summary":"Получить документы","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются документы","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountingDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/documents/types":{"get":{"tags":["Бухгалтерские документы"],"summary":"Получить типы документов","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращаются типы документов","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountingDocumentType"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/documents/invoice":{"post":{"tags":["Бухгалтерские документы"],"summary":"Создать счет","security":[{"BearerAuth":[]}],"requestBody":{"description":"Данные для создания","required":true,"content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"source":{"type":"string","description":"Тип источника данных","enum":["tariffInstance","externalInfillEntity","signatureRequest","signDrawRequest","signMaxRequest","storagePack","ocrRequest"],"example":"tariffInstance"},"details":{"description":"Реквизиты плательщика; сохраняются как реквизиты рабочего пространства, а при корректных реквизитах ещё и как организация внешнего заполнения","allOf":[{"$ref":"#/components/schemas/AccountingDetails"}]}}}]},{"type":"object","properties":{"price":{"type":"number","description":"Цена","example":1000},"source":{"type":"string","description":"Тип источника данных","enum":["templateRequest"],"example":"templateRequest"},"details":{"description":"Реквизиты плательщика; сохраняются как реквизиты рабочего пространства, а при корректных реквизитах ещё и как организация внешнего заполнения","allOf":[{"$ref":"#/components/schemas/AccountingDetails"}]}}}]},"examples":{"С указанием id":{"value":{"id":"62bb25949213f16bcd934422","source":"tariffInstance","details":{"companyname":"ООО \"Вектор\"","inn":"7837805668","kpp":"781101001","ogrn":"19812721921","address":"101001, г.Москва, ул.Рябиновая, д.1","phone":"+7-999-123-45-67"}}},"С указанием price":{"value":{"price":1000,"source":"templateRequest","details":{"companyname":"ООО \"Вектор\"","inn":"7837805668","kpp":"781101001","ogrn":"19812721921","address":"101001, г.Москва, ул.Рябиновая, д.1","phone":"+7-999-123-45-67"}}}}}}},"responses":{"200":{"description":"Возвращается счет","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/documents/invoice/onboarding/send":{"post":{"tags":["Бухгалтерские документы"],"summary":"Отправить счета онбординга","security":[{"BearerAuth":[]}],"requestBody":{"description":"Адрес электронной почты","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email","example":"example@example.com"}}}}}},"responses":{"200":{"description":"Возвращаются id отправленных счетов","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","description":"id счета","example":"64d11ded43a7f1cf81a2c8b0"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/documents/invoice/paymentqr":{"get":{"tags":["Бухгалтерские документы"],"summary":"Получить QR-код для оплаты","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"amount","description":"Сумма в копейках","schema":{"type":"number"}},{"in":"query","name":"purpose","description":"Назначение платежа","schema":{"type":"string"}}],"responses":{"200":{"description":"Возвращается изображение QR","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/onec/services":{"get":{"tags":["Бухгалтерские документы"],"summary":"Получить список услуг 1С","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Возвращается список услуг 1С","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"id услуги","example":"tariff_team"},"skuCode":{"type":"string","description":"SKU-код услуги","example":"00-00000828"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/onec/upd/{id}":{"get":{"tags":["Бухгалтерские документы"],"summary":"Скачать УПД по id счета в 1С","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Возвращается УПД","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"schemas":{"YClientsMapping":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","maxItems":1000,"description":"Сопоставление строгих переменных DataDoc полям карточки записи YClients (каждая переменная и каждое поле — не больше одного раза)","items":{"type":"object","required":["strictattrId","fieldId"],"properties":{"strictattrId":{"type":"string","pattern":"^\\d+$","description":"id строгой переменной (только цифры; переменная должна существовать)","example":"1024"},"fieldId":{"type":"string","description":"id поля YClients: comment — комментарий записи; custom_fields.<код> — дополнительное поле записи; client.custom_fields.<код> — дополнительное поле клиента; client.surname | client.name | client.patronymic | client.phone | client.email | client.birth_date — стандартные поля клиента","example":"client.phone"}}}}}},"YClientsField":{"type":"object","properties":{"id":{"type":"string","description":"id поля для сопоставления (comment, client.<ключ>, custom_fields.<код>, client.custom_fields.<код>)","example":"custom_fields.passport"},"name":{"type":"string","description":"Название поля (для стандартных — из ресурсов, для дополнительных — из YClients)","example":"Паспорт"},"group":{"type":"string","enum":["record","client"],"description":"Чьё поле: record — записи, client — клиента","example":"record"},"type":{"type":"string","description":"Тип поля (text, phone, email, date или код типа дополнительного поля YClients)","example":"text"},"salonIds":{"type":"array","description":"Филиалы рабочего пространства, в которых есть это поле","items":{"type":"integer","description":"Номер филиала YClients"},"example":[1312083]},"value":{"type":"string","description":"Текущее значение поля в записи виджета (только если переданы salonId и leadId и значение не пустое)","example":"4510 123456"}}},"YClientsWrittenVariable":{"type":"object","properties":{"variableId":{"type":"string","description":"id переменной в шаблоне (у строгой переменной — id строгой переменной)","example":"1024"},"name":{"type":"string","description":"Название переменной","example":"Телефон клиента"},"fieldId":{"type":"string","description":"id поля YClients, в которое записано или должно было записаться значение","example":"client.phone"},"fieldName":{"type":"string","description":"Название поля YClients (нет названия — id поля)","example":"Телефон"},"value":{"type":"string","description":"Значение переменной в документе","example":"+79991050107"}}},"YClientsNotWrittenVariable":{"allOf":[{"$ref":"#/components/schemas/YClientsWrittenVariable"},{"type":"object","properties":{"reason":{"type":"string","enum":["notstrict","notmapped","empty","nofield","invalid","noclient","rejected","apierror"],"description":"Почему не записано: notstrict — переменная не строгая; notmapped — нет сопоставления; empty — значение пустое; nofield — поля нет в филиале; invalid — значение не подходит к типу поля; noclient — у записи нет клиента; rejected — YClients принял запрос, но значение не сохранилось; apierror — ошибка API YClients","example":"notmapped"},"message":{"type":"string","description":"Текст причины для пользователя (для apierror — текст ошибки YClients)","example":"Переменная не сопоставлена с полем YClients"}}}]},"YClientsSyncResult":{"type":"object","properties":{"status":{"type":"string","enum":["pending","ok","partial","error"],"description":"pending — запись ещё идёт; ok — записано; partial — часть значений не сохранилась; error — ничего не записано или ошибка","example":"ok"},"written":{"type":"integer","description":"Сколько полей записано","example":3},"skipped":{"type":"array","description":"id полей, пропущенных (поля нет в филиале или у записи нет клиента)","items":{"type":"string","description":"id поля YClients"},"example":["custom_fields.passport"]},"rejected":{"type":"array","description":"id полей, значения которых YClients не сохранил или которые не подходят к типу поля","items":{"type":"string","description":"id поля YClients"},"example":["client.birth_date"]},"error":{"type":"string","description":"Текст ошибки (при partial и error)","example":"record: Нет доступа"},"yclients":{"type":"object","description":"Ответ YClients при ошибке API (статус и тело)","properties":{"status":{"type":"integer","description":"HTTP-статус ответа YClients","example":403},"body":{"description":"Тело ответа YClients как есть"}}}}},"YClientsRecordElement":{"type":"object","properties":{"id":{"type":"string","description":"id поля","example":"entity.name"},"name":{"type":"string","description":"Название поля","example":"Имя"},"type":{"type":"string","enum":["text","date_time"],"description":"Тип поля","example":"text"},"value":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Значение поля","example":"Анастасия"}}},"YClientsSalons":{"type":"object","properties":{"salons":{"type":"array","description":"Номера филиалов YClients, добавленные в рабочее пространство","items":{"type":"object","properties":{"salonId":{"type":"integer","description":"Номер филиала в YClients","example":1312083},"title":{"type":"string","nullable":true,"description":"Название филиала из YClients (null, если YClients не ответил)","example":"Салон на Тверской"}}}},"limit":{"type":"integer","description":"Сколько филиалов можно добавить (настройка сервиса yclients.maxSalonsPerWorkspace)","example":50}}},"ProductSyncCounts":{"type":"object","properties":{"createdCount":{"type":"integer","description":"Количество добавленных в воркспейс товаров или услуг","example":22},"updatedCount":{"type":"integer","description":"Количество обновленных в воркспейсе товаров или услуг","example":0},"deletedCount":{"type":"integer","description":"Количество удаленных в воркспейсе товаров или услуг","example":0}}},"YClientsProduct":{"type":"object","description":"Таблица товаров или услуг записи (нет ни одной известной колонки — поле не возвращается)","properties":{"columns":{"type":"array","description":"Колонки таблицы (только поля с названием в ресурсе yclients.productfieldnames)","items":{"type":"object","properties":{"id":{"type":"string","description":"id колонки","example":"goods.title"},"name":{"type":"string","description":"Название колонки","example":"Название товара"}}}},"rows":{"type":"array","description":"Строки таблицы — по одной на товар или услугу; ключ — id колонки, значение — значение поля (количество товара — по модулю, длительность услуги — в минутах)","items":{"type":"object","additionalProperties":{}}}}},"YaDiskSettings":{"type":"object","description":"Настройки копий подписанных документов ПЭП на Яндекс Диске воркспейса (секреты не возвращаются)","properties":{"available":{"type":"boolean","description":"Функция доступна воркспейсу (свойство воркспейса, заданное администратором сервиса, или общая настройка сервиса signature.yadisk.enabled)","example":true},"editable":{"type":"boolean","description":"Текущий пользователь может менять настройки (функция доступна и он администратор воркспейса)","example":true},"clientId":{"type":"string","description":"ClientID приложения Яндекс OAuth воркспейса; пустая строка — не задан","example":"0a1b2c3d4e5f60718293a4b5c6d7e8f9"},"hasClientSecret":{"type":"boolean","description":"Client secret приложения сохранён (само значение не возвращается)","example":true},"folder":{"type":"string","description":"Папка на Яндекс Диске, куда кладутся копии; пустая строка — не задана","example":"/DataDoc/ПЭП"},"enabled":{"type":"boolean","description":"Выгрузка копий включена","example":true},"connected":{"type":"boolean","description":"Диск подключён (получены токены доступа)","example":true},"login":{"type":"string","description":"Логин аккаунта Яндекса, к которому подключён диск; нет поля — неизвестен или не подключён","example":"datadoc.test"},"connectedAt":{"type":"string","format":"date-time","description":"Когда диск подключён; нет поля — не подключён","example":"2026-11-01T10:00:00.000Z"},"authorizeUrl":{"type":"string","description":"Ссылка на страницу Яндекса для получения кода подтверждения; нет поля — ClientID не задан","example":"https://oauth.yandex.ru/authorize?response_type=code&client_id=0a1b2c3d4e5f60718293a4b5c6d7e8f9"}}},"SignatureLimits":{"properties":{"signature_used":{"type":"integer","description":"Количество созданных документов с ПЭП и УКЭП","example":0},"signature_available":{"type":"integer","description":"Новый лимит документов с ПЭП и УКЭП","example":50}}},"AttachmentLimits":{"properties":{"attachments_used":{"type":"number","description":"Суммарный размер файлов в ГБ","example":1},"attachments_available":{"type":"number","description":"Лимит суммарного размера файлов в ГБ","example":2}}},"OcrLimits":{"properties":{"ocrUsed":{"type":"integer","description":"Количество распознанных документов","example":0},"ocrAvailable":{"type":"integer","description":"Новый лимит распознаваний документов","example":50}}},"DocsLimits":{"properties":{"docsUsed":{"type":"integer","description":"Количество использованных доксов","example":0},"docsAvailable":{"type":"integer","description":"Новый лимит доксов","example":50}}},"RecruiterPromocode":{"type":"object","description":"Партнёрский промокод рекрутера","properties":{"id":{"type":"string","description":"Код промокода (PRT + последние 6 символов id рабочего пространства, при занятости — с номером)","example":"PRT934422"},"type":{"type":"string","description":"Тип промокода (для партнёрского — discountPercent, скидка в процентах)","example":"discountPercent"},"discountPercent":{"type":"integer","description":"Скидка, %","example":10},"recruiterWid":{"type":"string","description":"id рабочего пространства рекрутера","example":"62bb25949213f16bcd934422"}}},"ApiKeyUsage":{"type":"object","description":"Счётчики запросов по API-ключу и настройки рабочего пространства (сутки — по московскому времени)","properties":{"enabled":{"type":"boolean","description":"Доступ по API-ключу разрешён","example":true},"limit":{"type":"integer","description":"Суточный лимит запросов (свой у рабочего пространства или из настройки сервиса apikey.dailyLimit)","example":10000},"total":{"type":"integer","description":"Всего принятых запросов за всё время","example":15230},"today":{"type":"integer","description":"Принятых запросов за текущие сутки","example":120},"remaining":{"type":"integer","description":"Осталось запросов до лимита на сегодня","example":9880},"currentMonth":{"type":"integer","description":"Запросов за текущий месяц","example":3400},"previousMonth":{"type":"integer","description":"Запросов за прошлый месяц","example":5100},"resetAt":{"type":"string","format":"date-time","description":"Момент следующего сброса суточного счётчика (00:00 МСК)","example":"2026-11-07T21:00:00.000Z"}}},"ApiKeyLogRecord":{"type":"object","description":"Запись журнала запросов по API-ключу","properties":{"wid":{"type":"string","description":"id рабочего пространства","example":"62bb25949213f16bcd934422"},"uid":{"type":"string","description":"id пользователя, чей ключ использован","example":"62bb25949213f16bcd934423"},"method":{"type":"string","description":"HTTP-метод запроса","example":"GET"},"url":{"type":"string","description":"Адрес запроса (секретные параметры заменены на ***)","example":"/api/v1/templates?token=***"},"ip":{"type":"string","description":"IP-адрес клиента","example":"192.0.2.10"},"createdAt":{"type":"string","format":"date-time","description":"Время запроса","example":"2026-11-06T10:15:00.000Z"}}},"StoragePackOption":{"type":"object","properties":{"period":{"type":"string","enum":["months","tariffend"]},"duration":{"type":"integer","description":"Срок, дней (месяц — 30 дней); для tariffend — оставшиеся дни тарифа","example":90},"discount":{"type":"number","description":"Скидка срока, % (как у варианта тарифа)","example":10},"dtTo":{"type":"string","format":"date-time","description":"Конец текущего периода тарифа (только tariffend)"},"price":{"type":"number","description":"Цена пакета, руб.","example":540}}},"StoragePack":{"type":"object","properties":{"id":{"type":"string","example":"6addef67da131f326644eca4"},"gb":{"type":"integer","example":2},"period":{"type":"string","enum":["months","tariffend"]},"duration":{"type":"integer","example":90},"discount":{"type":"number","example":10},"dtFrom":{"type":"string","format":"date-time"},"dtTo":{"type":"string","format":"date-time"},"price":{"type":"number","example":540},"priceForGb":{"type":"number","description":"Цена 1 ГБ на 30 дней на момент заявки, руб.","example":100},"paidAt":{"type":"string","format":"date-time","description":"Дата оплаты; нет — не оплачен"},"paymentSource":{"type":"string","enum":["invoice","card","admin"],"description":"Чем оплачен — счёт 1С, карта, отметка администратора"},"expiredAt":{"type":"string","format":"date-time","description":"Ночная задача вывела истёкший пакет из лимита"},"active":{"type":"boolean","description":"Оплачен и действует сейчас"},"createdAt":{"type":"string","format":"date-time"}}},"RegisterQuery":{"type":"array","description":"Параметры query-строки страницы регистрации (метки рекламы и т.п.), сохраняются у рабочего пространства как пары ключ-значение","example":[{"key":"utm_source","value":"yandex"}],"items":{"type":"object","properties":{"key":{"type":"string","description":"Ключ из query-запроса","example":"instagram"},"value":{"type":"string","description":"Значение из query-запроса","example":"somevalue"}}}},"Workspace":{"properties":{"createdAt":{"type":"string","description":"Дата создания рабочего пространства","example":"2022-07-24T09:35:53.057+00:00"},"createCounteragentsAtRender":{"type":"boolean","description":"Создавать контрагентов при рендере","example":true},"goals":{"type":"string","description":"Цели","example":"У самурая нет цели"},"areaOfActivity":{"description":"Сфера деятельности рабочего пространства","allOf":[{"$ref":"#/components/schemas/AreaOfActivityBase"}]}}},"SignatureRequest":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"limit":{"type":"integer","description":"Лимит документов с ПЭП и УКЭП","example":30},"price":{"type":"number","description":"Цена лимита","example":300},"paidAt":{"type":"string","description":"Дата оплаты запроса","example":"2023-11-22T10:17:33.622Z"},"createdAt":{"type":"string","description":"Дата создания запроса","example":"2023-11-22T10:17:33.622Z"}}}]},"OcrRequest":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"limit":{"type":"integer","description":"Лимит распознаваний документов","example":30},"price":{"type":"number","description":"Цена лимита","example":300},"paidAt":{"type":"string","description":"Дата оплаты запроса","example":"2023-11-22T10:17:33.622Z"},"createdAt":{"type":"string","description":"Дата создания запроса","example":"2023-11-22T10:17:33.622Z"}}}]},"DocsRequest":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"limit":{"type":"integer","description":"Лимит доксов","example":30},"price":{"type":"number","description":"Цена лимита","example":300},"paidAt":{"type":"string","description":"Дата оплаты запроса","example":"2023-11-22T10:17:33.622Z"},"createdAt":{"type":"string","description":"Дата создания запроса","example":"2023-11-22T10:17:33.622Z"}}}]},"RecruiterReferralTariff":{"type":"object","description":"Тариф в счёте или попытке оплаты","properties":{"name":{"type":"string","description":"Название тарифа","example":"Корпоративный"},"duration":{"type":"integer","description":"Длительность тарифа (как в экземпляре тарифа)","example":360}}},"RecruiterReferral":{"type":"object","description":"Реферал — рабочее пространство, применившее партнёрский промокод рекрутера","properties":{"wid":{"type":"string","description":"id рабочего пространства реферала","example":"62bb25949213f16bcd934424"},"registeredAt":{"type":"string","format":"date-time","description":"Дата регистрации рабочего пространства","example":"2026-10-05T08:00:00.000Z"},"promoAppliedAt":{"type":"string","format":"date-time","description":"Дата первого применения промокода","example":"2026-10-05T08:05:00.000Z"},"promoUsed":{"type":"boolean","description":"Промокод был использован при оплате","example":true},"companyName":{"type":"string","nullable":true,"description":"Название организации из реквизитов (null — реквизиты не заполнены)","example":"ООО Ромашка"},"inn":{"type":"string","nullable":true,"description":"ИНН из реквизитов (null — не заполнен)","example":"7700000000"},"ownerEmailMasked":{"type":"string","nullable":true,"description":"Почта владельца с маской (первая буква и домен)","example":"v***@datadoc.ru"},"emailConfirmed":{"type":"boolean","description":"Владелец подтвердил почту","example":true},"demo":{"type":"object","description":"Запись на демонстрацию","properties":{"booked":{"type":"boolean","description":"Владелец записывался на демо","example":true},"at":{"type":"string","format":"date-time","nullable":true,"description":"Время последней записи на демо (null — не записывался)","example":"2026-10-07T10:30:00.000Z"}}},"tariff":{"type":"object","nullable":true,"description":"Текущий тариф (null — нет действующего)","properties":{"id":{"type":"string","description":"id тарифа","example":"tariff_enterprise"},"name":{"type":"string","description":"Название тарифа","example":"Корпоративный"},"duration":{"type":"integer","description":"Длительность тарифа (как в экземпляре тарифа)","example":360},"dtFrom":{"type":"string","format":"date-time","description":"Начало действия","example":"2026-10-05T00:00:00.000Z"},"dtTo":{"type":"string","format":"date-time","description":"Окончание действия","example":"2027-09-30T00:00:00.000Z"},"isPaid":{"type":"boolean","description":"Тариф оплачен полностью (пробный не считается оплаченным)","example":true},"isTrial":{"type":"boolean","description":"Пробный тариф","example":false}}},"firstPaymentAt":{"type":"string","format":"date-time","nullable":true,"description":"Дата первой оплаты картой или по счёту (null — оплат не было)","example":"2026-10-10T12:00:00.000Z"},"paidTotal":{"type":"number","description":"Сумма оплат картой и по счетам, руб.","example":12000},"lastActivityAt":{"type":"string","format":"date-time","nullable":true,"description":"Время последнего действия пользователей рабочего пространства","example":"2026-11-05T15:20:00.000Z"}}},"RecruiterReferralDetails":{"type":"object","description":"Подробности карточки реферала","properties":{"invoices":{"type":"array","description":"Счета (бухгалтерские документы), новые первыми","items":{"type":"object","properties":{"id":{"type":"string","description":"id счёта","example":"62bb25949213f16bcd934425"},"date":{"type":"string","format":"date-time","description":"Дата счёта","example":"2026-10-09T00:00:00.000Z"},"amount":{"type":"number","description":"Сумма, руб.","example":12000},"onecStatus":{"type":"string","nullable":true,"description":"Статус в 1С (PAID — оплачен)","example":"PAID"},"sourceType":{"type":"string","description":"За что выставлен счёт (tariffInstance — тариф, signatureRequest, ocrRequest, docsRequest и др.)","example":"tariffInstance"},"tariff":{"description":"Тариф (только для sourceType = tariffInstance)","allOf":[{"$ref":"#/components/schemas/RecruiterReferralTariff"}]}}}},"cardAttempts":{"type":"array","description":"Попытки оплаты картой","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"Дата оплаты или создания попытки","example":"2026-10-10T12:00:00.000Z"},"amount":{"type":"number","description":"Сумма, руб.","example":12000},"status":{"type":"string","enum":["paid","pending"],"description":"paid — оплачено, pending — не оплачено","example":"paid"},"tariff":{"description":"Оплачиваемый тариф (если попытка привязана к тарифу)","allOf":[{"$ref":"#/components/schemas/RecruiterReferralTariff"}]}}}},"payments":{"type":"array","description":"Оплаты (картой и по счетам) в порядке даты","items":{"type":"object","properties":{"id":{"type":"string","description":"id транзакции или счёта","example":"62bb25949213f16bcd934426"},"source":{"type":"string","enum":["card","invoice"],"description":"card — оплата картой, invoice — оплата по счёту","example":"card"},"date":{"type":"string","format":"date-time","description":"Дата оплаты","example":"2026-10-10T12:00:00.000Z"},"amount":{"type":"number","description":"Сумма, руб.","example":12000},"refundedAmount":{"type":"number","description":"Возвращённая сумма, руб. (для счетов всегда 0)","example":0},"refunded":{"type":"boolean","description":"Возвращена полностью (частичный возврат — refundedAmount меньше amount)","example":false},"skuCode":{"type":"string","nullable":true,"description":"Код услуги 1С","example":"00-00001002"},"skuName":{"type":"string","nullable":true,"description":"Название услуги 1С","example":"Доступ к аккаунту по тарифу"},"isTariff":{"type":"boolean","description":"Оплата тарифа","example":true},"amountNoVat":{"type":"number","description":"Сумма без НДС (НДС платежа не хранится, поэтому равна amount)","example":12000},"vatAmount":{"type":"number","nullable":true,"description":"Сумма НДС (всегда null — не хранится)","example":null},"isFirstPayment":{"type":"boolean","description":"Первая оплата реферала","example":true}}}},"usersCount":{"type":"integer","description":"Пользователей в рабочем пространстве","example":3},"invitedAnyone":{"type":"boolean","description":"Владелец пригласил хотя бы одного пользователя","example":true},"templatesActive":{"type":"integer","description":"Шаблонов (не удалённых)","example":15},"templatesRequestedSetup":{"type":"object","description":"Заявки на создание шаблона","properties":{"requested":{"type":"boolean","description":"Была хотя бы одна заявка","example":true},"count":{"type":"integer","description":"Количество заявок","example":2}}},"documentsCreated":{"type":"integer","description":"Создано документов","example":120},"signatureRequestsCount":{"type":"integer","description":"Запросов на покупку подписей","example":1},"ocrRequestsCount":{"type":"integer","description":"Запросов на покупку распознаваний","example":0}}},"WhiteLabelTheme":{"type":"object","description":"Оформление рабочего пространства (применяется, пока режим White Label включён)","properties":{"enabled":{"type":"boolean","description":"Режим White Label включён у рабочего пространства. При false остальных полей нет — действует стандартное оформление DataDoc","example":true},"colors":{"type":"object","description":"Основные цвета (hex), остальные оттенки считаются от них. Ключи primary, accent, background, text, success, attention, warning, error","example":{"primary":"#aa3300"}},"productName":{"type":"string","description":"Название продукта вместо DataDoc (письма, заголовки, тексты)"},"logos":{"type":"object","description":"Адреса логотипов. Ключи logo, logoSmall, logoWhite, favicon","example":{"logo":"https://static.forma.today/whitelabel/65031e7477123beeda27f1e8/logo-1761230000000.png"}}}},"SmtpPortCheckResult":{"type":"object","description":"Результат проверки одного SMTP-сервера и порта","properties":{"host":{"type":"string","description":"SMTP-сервер","example":"smtp.yandex.ru"},"port":{"type":"integer","description":"Порт (465 или 587)","example":465},"ok":{"type":"boolean","description":"Соединение установлено","example":true},"ms":{"type":"integer","description":"Время до подключения или ошибки, мс (таймаут 5000)","example":42},"error":{"type":"string","description":"Код ошибки подключения (ETIMEDOUT, ECONNREFUSED, ENOTFOUND и т.п.); только при ok = false","example":"ETIMEDOUT"}}},"UserPointsResourceId":{"properties":{"id":{"type":"string","description":"ID ресурса","example":"user.email.bind"}}},"UserPointsResource":{"allOf":[{"$ref":"#/components/schemas/UserPointsResourceId"},{"type":"object","properties":{"description":{"type":"string","description":"Описание ресурса","example":"Привязка почты к аккаунту"},"cost":{"type":"integer","description":"Цена ресурса (в баллах)","example":4}}}]},"NewUsergroup":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Бухгалтерия"},"permissions":{"type":"array","description":"Список разрешений","example":["templatesFolders:view","counteragents:view"],"items":{"type":"string"}},"isWorkspaceAdmin":{"type":"boolean","description":"Являются ли члены группы администраторами воркспейса","example":false}}},"Usergroup":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewUsergroup"}]},"CreateFirebase":{"type":"object","properties":{"token":{"type":"string","description":"Токен Firebase","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVpZCI6IjY2ZDlkMmNlNWQ1YjExYTBkZGEyNTE0YSIsIndpZCI6IjY2ZDlkMmNlNWQ1YjExYTBkZGEyNTEzNyJ9LCJleHAiOjE3NTcwODczMTEsImlhdCI6MTcyNTU1MTMxMX0.SNMTut92V2LB0dmB2YRpK-hf_7HP3rs7JKLF6UBI3os"}}},"NewFirebase":{"type":"object","properties":{"id":{"type":"string","description":"ID токена","example":"62bb25949213f16bcd934422"},"token":{"type":"string","description":"Токен Firebase","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVpZCI6IjY2ZDlkMmNlNWQ1YjExYTBkZGEyNTE0YSIsIndpZCI6IjY2ZDlkMmNlNWQ1YjExYTBkZGEyNTEzNyJ9LCJleHAiOjE3NTcwODczMTEsImlhdCI6MTcyNTU1MTMxMX0.SNMTut92V2LB0dmB2YRpK-hf_7HP3rs7JKLF6UBI3os"},"beginsAt":{"type":"string","description":"Дата и время начала действия токена","example":"2023-06-17T00:01:01.530Z"}}},"Firebase":{"type":"object","properties":{"id":{"type":"string","description":"ID токена","example":"62bb25949213f16bcd934422"},"token":{"type":"string","description":"Токен Firebase","example":"*************************************************************************************************************************************************************************************************************************JKLF6UBI3os"},"beginsAt":{"type":"string","description":"Дата и время начала действия токена","example":"2023-06-17T00:01:01.530Z"}}},"NewUser":{"properties":{"name":{"type":"string","description":"ФИО","example":"Иванов Иван Иванович"},"title":{"type":"string","description":"Должность","example":"Директор"},"phone":{"type":"string","description":"Телефон","example":79121324567},"phoneConfirmed":{"type":"boolean","description":"Признак подтверждения номера телефона","example":true},"lang":{"type":"string","description":"Язык","example":"ru"}}},"User":{"allOf":[{"$ref":"#/components/schemas/NewUser"},{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"Логин","example":"test@mail.ru"},"primary":{"type":"boolean","description":"Признак аккаунта партнера","example":true}}}]},"UserOnboardingStatus":{"type":"object","description":"Флаги онбординга пользователя, которые сохраняет интерфейс ЛК (true — окно/подсказка уже показаны или шаг пройден, false — ещё нет; по умолчанию false)","properties":{"special_templates_modal":{"type":"boolean","description":"Модальное окно «Специальные шаблоны»","example":false},"fill_template_modal":{"type":"boolean","description":"Модальное окно заполнения шаблона","example":false},"fill_template_tooltip":{"type":"boolean","description":"Подсказка заполнения шаблона","example":true},"select_external_filling_modal":{"type":"boolean","description":"Модальное окно выбора внешнего заполнения","example":false},"select_external_filling_tooltip":{"type":"boolean","description":"Подсказка выбора внешнего заполнения","example":false},"send_external_filling_modal":{"type":"boolean","description":"Модальное окно отправки внешнего заполнения","example":true},"edit_template_modal":{"type":"boolean","description":"Модальное окно редактирования шаблона","example":false},"edit_template_tooltip":{"type":"boolean","description":"Подсказка редактирования шаблона","example":false},"add_variables_modal":{"type":"boolean","description":"Модальное окно добавления переменных","example":false},"templates_list_tooltip":{"type":"boolean","description":"Подсказка списка шаблонов","example":true},"products_list_tooltip":{"type":"boolean","description":"Подсказка списка продуктов","example":false},"pack_list_tooltip":{"type":"boolean","description":"Подсказка списка пакетов шаблонов","example":false},"edit_template_uploaded_tooltip":{"type":"boolean","description":"Подсказка редактирования загруженного шаблона","example":false},"create_variations_modal":{"type":"boolean","description":"Модальное окно создания вариаций","example":false},"create_table_modal":{"type":"boolean","description":"Модальное окно создания таблицы","example":false},"setting_templates_notification":{"type":"boolean","description":"Уведомление о настройке шаблонов","example":false},"templates_sent":{"type":"boolean","description":"Шаблоны (стартовый набор) отправлены пользователю","example":false},"first_templates_open":{"type":"boolean","description":"Первое открытие раздела шаблонов","example":false}}},"PhoneConfirmation":{"type":"object","properties":{"phone":{"type":"string","description":"Телефон","example":79121324567},"phoneConfirmed":{"type":"boolean","description":"Признак подтверждения номера телефона","example":true}}},"UrlToken":{"properties":{"urlToken":{"type":"string","description":"URL-токен","example":"04d125b0c994432dbf09a6fe3b503c8e"}}},"UploadPlace":{"type":"object","description":"Что принимает сервис в месте загрузки файла","properties":{"extensions":{"type":"array","description":"Расширения, которые предлагаются пользователю и принимаются сервером (нижний регистр, с точкой); пустой массив — любой файл","items":{"type":"string"},"example":[".png",".jpg",".webp"]},"connected":{"type":"boolean","description":"true — место уже подключено к реестру (сервер проверяет загрузку по нему, клиенты берут форматы отсюда)","example":true},"maxSizeSetting":{"type":"string","description":"Ключ публичной настройки сервиса с лимитом размера одного файла (единица — mb или kb по определению настройки); нет поля — лимит не настраивается или настройка не публичная","example":"facsimile.maxSizeMb"}}},"UpdaterTaskId":{"type":"string","description":"Имя задачи планировщика (метод UpdaterService с расписанием cron), например processMailings, executeScheduledJobs, purgeStorageTrash, updateAttachmentSize, updateAmocrmStatus, updateWorkspaceStatisticsInAmocrm, reportOverdueAiTcRequests, rejectExpiredSignatures, sendSignerRetentionNotices, sendTariffEndsEmails, deleteExpiredUserActionsLogs, updateEdoSignatureStatus, deleteUnusedWorkspaces, deleteTestWorkspaces, deleteOrphanedWorkspaceData, activateOnecPayments, retryOnecPayments","example":"executeScheduledJobs"},"Timeslot":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"date":{"type":"string","description":"Время таймслота","example":"2025-09-01T09:30:00.000Z"},"available":{"type":"boolean","description":"Флаг доступности таймслота","example":true}}}]},"TimeslotElementBase":{"type":"object","properties":{"timeslotId":{"type":"string","description":"id таймслота","example":"64d12317bfd535ac3ad7ab92"},"managerId":{"type":"string","description":"id менеджера","example":"64d0e03512ddeea1afc0147b"},"clientEmail":{"type":"string","nullable":true,"description":"Email клиента","example":"some@mail.ru"},"clientPhone":{"type":"string","description":"Телефон клиента","example":79999999999},"clientComment":{"type":"string","nullable":true,"description":"Комментарий клиента","example":"Какой-то комментарий клиента"},"companyName":{"type":"string","description":"Название компании","example":"ООО Рога и Копыта"},"companySize":{"type":"string","description":"Размер компании","example":100},"clientFullName":{"type":"string","description":"ФИО клиента","example":"Александр Александрович Александров"},"gmt":{"type":"string","description":"Часовой пояс клиента","example":"+12:00"},"channel":{"type":"string","description":"Канал связи клиента","example":"Телефон"}}},"NewTimeslotElement":{"allOf":[{"$ref":"#/components/schemas/TimeslotElementBase"},{"type":"object","properties":{"areaOfActivityId":{"type":"string","description":"id сферы деятельности","example":"64d12317bfd535ac3ad7ab92"}}}]},"TimeslotElement":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/TimeslotElementBase"},{"type":"object","properties":{"date":{"type":"string","description":"Время таймслота","example":"2023-08-21T10:30:00.000Z"},"areaofactivity":{"description":"Сфера деятельности клиента","allOf":[{"$ref":"#/components/schemas/AreaOfActivityBase"}]},"leadId":{"type":"integer","description":"id лида","example":27255161},"leadUrl":{"type":"string","description":"URL лида","example":"https://formasales.amocrm.ru/leads/detail/27255161"}}}]},"Tattr":{"allOf":[{"type":"object","properties":{"id":{"type":"string","description":"id","example":101},"from":{"type":"string","enum":["strictattr","cattr"],"description":"Тип","example":"strictattr"},"countBody":{"type":"integer","description":"Количество в теле","example":1},"countVariative":{"type":"integer","description":"Количество в вариативности","example":2},"required":{"type":"boolean","description":"Обязательность переменной","example":true},"currentDate":{"type":"boolean","description":"Только для переменных типа date. На экране рендера поле заполняется текущей датой","example":true}}},{"$ref":"#/components/schemas/CrmFields"},{"$ref":"#/components/schemas/OcrFields"}]},"TattrFull":{"allOf":[{"$ref":"#/components/schemas/Tattr"},{"$ref":"#/components/schemas/Strictattr"}]},"TattrFolder":{"type":"object","properties":{"id":{"type":"string","description":"id группы","example":"person.user.id"},"name":{"type":"string","description":"Имя группы","example":"Группа крови"},"tattrs":{"description":"Переменные группы","type":"array","items":{"$ref":"#/components/schemas/Tattr"}}}},"TemplateColumn":{"allOf":[{"type":"object","properties":{"id":{"type":"string","description":"id колонки таблицы","example":"name"},"name":{"type":"string","description":"Название колонки","example":"Название"},"width":{"type":"string","description":"Ширина колонки","example":"10.63%"},"canEdit":{"type":"boolean","description":"Флаг редактируемой колонки","example":true},"type":{"type":"string","description":"Тип данных в колонке","example":"price"}}},{"$ref":"#/components/schemas/CrmTableFields"}]},"TemplateTableTotal":{"type":"object","properties":{"id":{"type":"string","description":"id глобального поля таблицы","example":"totalPrice"},"name":{"type":"string","description":"Название глобального поля таблицы","example":"Итого"}}},"TemplateBlocksTree":{"type":"object","description":"Дерево вариативных блоков"},"TemplateTable":{"type":"object","properties":{"id":{"type":"string","description":"id таблицы","example":"a68785f5-e6e2-4f30-b0a5-3776bdd34596"},"name":{"type":"string","description":"Название таблицы","example":"Таблица 1"},"columns":{"description":"Колонки таблицы","type":"array","items":{"$ref":"#/components/schemas/TemplateColumn"}},"total":{"description":"Глобальные (итоговые) поля таблицы","type":"array","items":{"$ref":"#/components/schemas/TemplateTableTotal"}},"resized":{"type":"boolean","description":"Флаг \"можно ли заменять размер\"","example":true},"showTotalRow":{"type":"boolean","description":"Флаг \"показывать ли строку итогов\"","example":true}}},"TemplateCarticleVariant":{"type":"object","properties":{"id":{"type":"string","description":"id","example":"00EBBO0X"},"key":{"type":"string","description":"Ключ блока","example":"яяя"},"value":{"type":"string","description":"Значение блока","example":"Да, я"},"default":{"type":"boolean","description":"Флаг \"вариант по умолчанию\"","example":true},"tattrs":{"description":"id переменных, которые выводятся при выборе этого варианта","type":"array","items":{"type":"string","example":101}},"tables":{"description":"id таблиц, которые выводятся при выборе этого варианта","type":"array","items":{"type":"string","example":"sometableid"}}}},"TemplateCarticle":{"type":"object","properties":{"id":{"type":"string","description":"id вариативного блока","example":"zrQ6R25b"},"title":{"type":"string","description":"Заголовок","example":"Кто исполнитель?"},"variants":{"type":"array","description":"Массив вариантов блока","items":{"$ref":"#/components/schemas/TemplateCarticleVariant"}},"multiple":{"type":"boolean","description":"Флаг множественного выбора","example":false},"parents":{"type":"array","description":"Массив родительских блоков","items":{"type":"string"}},"countBody":{"type":"integer","description":"Количество в теле","example":2},"countVariative":{"type":"integer","description":"Количество в вариативности","example":1}}},"TemplateFormula":{"type":"object","properties":{"id":{"type":"string","description":"id формулы","example":12345},"name":{"type":"string","description":"Название","example":"Формула"},"value":{"type":"string","description":"Значение","example":"1+1"},"type":{"type":"string","description":"Тип данных","example":"money"}}},"TemplateSide":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Заказчик"},"id":{"type":"string","description":"Id","example":"zakazchik"},"tattrFolders":{"description":"Группы переменных стороны","type":"array","items":{"$ref":"#/components/schemas/TattrFolder"}},"tables":{"description":"Таблицы стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateTable"}},"carticles":{"description":"Вариативные блоки стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateCarticle"}},"formulas":{"description":"Формулы стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateFormula"}}}},"NewTemplate":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Договор подряда"},"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"}}},"Template":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewTemplate"},{"type":"object","properties":{"translatedName":{"type":"string","description":"Название транслитерацией для ЧПУ","example":"Shablon"},"ai":{"type":"boolean","description":"Флаг генерации с помощью ИИ","example":true}}}]},"TemplateWithPath":{"allOf":[{"$ref":"#/components/schemas/Template"},{"type":"object","properties":{"path":{"type":"array","description":"Путь к данному шаблону","items":{"$ref":"#/components/schemas/RootPath"}}}}]},"TemplateBorder":{"type":"object","description":"Поля страницы документа (CSS-размеры)","properties":{"top":{"type":"string","description":"Отступ вверху","example":"2cm"},"bottom":{"type":"string","description":"Отступ внизу","example":"2cm"},"left":{"type":"string","description":"Отступ слева","example":"2cm"},"right":{"type":"string","description":"Отступ справа","example":"2cm"}}},"TemplateRunningTitle":{"type":"object","properties":{"position":{"type":"string","description":"Позиция","example":"top-left","enum":["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]},"data":{"description":"Содержимое колонтитула","type":"object","properties":{"type":{"type":"string","description":"Тип","example":"text","enum":["text","image"]},"text":{"type":"string","description":"Текст","example":"<p>test</p>"},"link":{"type":"string","description":"Картинка","example":"data:image/jpeg;base64,..."},"startPage":{"type":"integer","description":"С какой страницы отображать","example":1},"displayOnFirstPage":{"type":"boolean","description":"Флаг \"показывать на первой странице\"","example":true},"hideOnPages":{"type":"array","description":"Список номеров страниц, на которых не показывать","example":[1,3,5],"items":{"type":"integer"}}}}}},"TemplateContentBase":{"type":"object","properties":{"content":{"type":"string","description":"Контент шаблона","example":"<p>Очень большой текст с вставленной переменной <span class=\"variable\" id=\"1.101\"/></p>"},"landscape":{"type":"boolean","description":"Альбомная ориентация документа","example":false},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"},"border":{"$ref":"#/components/schemas/TemplateBorder"},"runningTitles":{"description":"Колонтитулы документа","type":"array","items":{"$ref":"#/components/schemas/TemplateRunningTitle"}}}},"NewTemplateContent":{"allOf":[{"$ref":"#/components/schemas/TemplateContentBase"},{"type":"object","properties":{"sides":{"description":"Стороны шаблона с переменными, таблицами, вариативными блоками и формулами","type":"array","items":{"$ref":"#/components/schemas/TemplateSide"}}}}]},"TemplateContent":{"allOf":[{"$ref":"#/components/schemas/TemplateContentBase"},{"type":"object","properties":{"sides":{"description":"Стороны шаблона с полными данными переменных","type":"array","items":{"$ref":"#/components/schemas/TemplateSideWithFilledTattrs"}}}}]},"TemplateTattrValues":{"type":"object","description":"Значения переменных шаблона","additionalProperties":{"type":"string","description":"id переменной шаблона","example":"Значение"},"example":{"101":"Значение"}},"TemplateTableValues":{"type":"array","description":"Значения таблиц стороны","items":{"type":"object","properties":{"tableId":{"type":"string","description":"id таблицы","example":"a68785f5-e6e2-4f30-b0a5-3776bdd34596"},"products":{"description":"Строки таблицы: объект «id колонки — значение ячейки» на каждую строку","type":"array","items":{"type":"object","additionalProperties":{"type":"string","description":"Значение ячейки таблицы","example":"Значение"},"example":{"name":"Название","unit":"шт"}}},"total":{"description":"Значения глобальных полей таблицы: «id поля — значение»","type":"object","additionalProperties":{"type":"string","description":"Значение глобального поля таблицы","example":"Значение"},"example":{"totalDiscountPercent":100}}}}},"TemplateArticleValues":{"type":"array","description":"Значения переменных-предложений стороны","items":{"type":"object","properties":{"id":{"type":"string","description":"id переменной-предложения в контенте документа","example":"6579b10a41278b02b8c3a3df"},"value":{"description":"Предложения для вставки в документ","type":"array","items":{"type":"string","description":"Значение переменной-предложения для вставки в документ","example":"Какое-то предложение"}}}}},"TemplateFormulaValues":{"type":"object","description":"Значения формул шаблона","additionalProperties":{"type":"string","description":"id формулы шаблона","example":"Значение"},"example":{"12345":"Значение"}},"TemplateSideValue":{"type":"object","properties":{"counteragentid":{"type":"string","description":"id контрагента","example":"62bb25949213f16bcd934422"},"updateCounteragent":{"type":"boolean","description":"Флаг обновления данных контрагента","example":false},"tattrValues":{"$ref":"#/components/schemas/TemplateTattrValues"},"tableValues":{"$ref":"#/components/schemas/TemplateTableValues"},"articleValues":{"$ref":"#/components/schemas/TemplateArticleValues"},"formulaValues":{"$ref":"#/components/schemas/TemplateFormulaValues"}}},"TemplateSideValues":{"type":"array","description":"Значения сторон документа — по одному объекту на каждую сторону шаблона, в том же порядке","items":{"$ref":"#/components/schemas/TemplateSideValue"}},"TemplateRenderListSideSignature":{"type":"object","description":"Подпись стороны документа","properties":{"type":{"$ref":"#/components/schemas/TemplateRenderSignatureType"},"signerName":{"type":"string","description":"ФИО подписанта","example":"Иванов Иван Иванович"},"companyName":{"type":"string","description":"Наименование организации","example":"ООО Умные документы"},"signedAt":{"type":"string","description":"Дата подписи","example":"2022-07-16T13:10:43.284+00:00"}}},"TemplateRender":{"type":"object","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 203"},"createdAt":{"type":"string","description":"Дата и время создания документа","example":"2022-07-16T13:10:43.284+00:00"},"confirmed":{"type":"boolean","description":"Флаг подписи","example":true},"confirmedAt":{"type":"string","description":"Дата и время подписи","example":"2022-07-16T13:10:43.284+00:00"},"signature":{"description":"Подпись документа; нет поля — документ не отправлялся на подпись","type":"object","properties":{"status":{"$ref":"#/components/schemas/TemplateRenderSignatureStatus"},"primary":{"description":"Подпись первой стороны (отправителя документа)","allOf":[{"$ref":"#/components/schemas/TemplateRenderListSideSignature"}]},"counter":{"description":"Подпись второй стороны (контрагента)","allOf":[{"$ref":"#/components/schemas/TemplateRenderListSideSignature"}]}}}}}]},"TemplateComboattr":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Поиск организации"},"path":{"type":"string","description":"Путь к методу API","example":"/dadata/suggestparty"},"paramname":{"type":"string","description":"Наименование query-параметра, который нужно передать методу","example":"query"},"displayname":{"type":"string","description":"Наименование свойства возвращаемого объекта, который нужно показать","example":"value"},"substitute":{"type":"array","description":"Массив подстановок","items":{"type":"object","properties":{"tattrid":{"type":"string","description":"id переменной","example":301},"value":{"type":"string","description":"Наименование свойства возвращаемого объекта, который нужно подставить","example":"data.inn"}}}}}},"TattrFolderWithFilledTattrs":{"type":"object","properties":{"id":{"type":"string","description":"id группы","example":"person.user.id"},"name":{"type":"string","description":"Имя группы","example":"Группа крови"},"tattrs":{"description":"Переменные группы с полными данными (тип, формат, справочник)","type":"array","items":{"$ref":"#/components/schemas/TattrFull"}}}},"TemplateSideWithFilledTattrs":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Заказчик"},"id":{"type":"string","description":"Id","example":"zakazchik"},"tattrFolders":{"description":"Группы переменных стороны","type":"array","items":{"$ref":"#/components/schemas/TattrFolderWithFilledTattrs"}},"tables":{"description":"Таблицы стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateTable"}},"carticles":{"description":"Вариативные блоки стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateCarticle"}}}},"TemplateSideWithComboattrs":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Заказчик"},"id":{"type":"string","description":"Id","example":"zakazchik"},"tattrFolders":{"description":"Группы переменных стороны","type":"array","items":{"allOf":[{"$ref":"#/components/schemas/TattrFolderWithFilledTattrs"},{"type":"object","properties":{"comboattrs":{"description":"Комбо-поля группы: поиск по внешнему API с подстановкой найденного в переменные","type":"array","items":{"$ref":"#/components/schemas/TemplateComboattr"}}}}]}},"tables":{"description":"Таблицы стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateTable"}},"carticles":{"description":"Вариативные блоки стороны","type":"array","items":{"$ref":"#/components/schemas/TemplateCarticle"}}}},"TemplateStatic":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"templateid":{"type":"string","description":"id шаблона","example":"62b3259f9211f16dcd932342"},"name":{"type":"string","description":"Имя файла","example":"image.png"},"url":{"type":"string","description":"URL файла","example":"http://safe.forma.today/6404b3b3f86fb949b5a7d376/6404b4e3549c571e1faddcd6/640859abe70b1210d8088406.png"}}}]},"CrmFields":{"type":"object","properties":{"crmId":{"type":"string","description":"id переменной CRM","example":636053},"crmName":{"type":"string","description":"Название переменной CRM","example":"Должность"},"crmCode":{"type":"string","description":"Код переменной CRM","example":"WORK"},"crmType":{"type":"string","description":"Тип переменной CRM","example":"text"}}},"CrmTableFields":{"type":"object","properties":{"crmIds":{"type":"array","description":"id колонок CRM","items":{"type":"string","example":"goods.title"}},"crmNames":{"type":"array","description":"Названия колонок CRM","items":{"type":"string","example":"Название товара"}},"crmType":{"type":"string","description":"Тип колонки CRM","example":"string"}}},"OcrFields":{"type":"object","properties":{"ocrIds":{"type":"array","description":"id полей сервиса OCR","items":{"type":"string","example":"First_name_ru"}}}},"QualifiedSignatureWithoutMchdGuid":{"type":"object","properties":{"companyName":{"type":"string","description":"Наименование организации","example":"ООО Умные документы"},"companyInn":{"type":"string","description":"ИНН организации","example":1234567890},"companyKpp":{"type":"string","description":"КПП организации","example":123456789},"signerName":{"type":"string","description":"ФИО подписанта","example":"Иванов Иван Иванович"},"certCode":{"type":"string","description":"Код сертификата","example":1234567890},"signerType":{"type":"string","description":"Тип подписанта","example":"entity"}}},"QualifiedSignature":{"description":"Данные УКЭП подписанта (из сертификата)","allOf":[{"$ref":"#/components/schemas/QualifiedSignatureWithoutMchdGuid"},{"type":"object","properties":{"mchdGuid":{"type":"string","description":"GUID МЧД","example":"3ce9a615-d7cc-4c9c-867e-d3baa5e3eb68"}}}]},"RenderResponse":{"type":"object","properties":{"renderId":{"type":"string","description":"id объекта","example":"62bb25949213f16bcd934422"},"renderName":{"type":"string","description":"Название с заполненными переменными","example":"Договор Иванов Иван Иванович\\"},"renderNumber":{"type":"integer","description":"Номер документа по порядку","example":1}}},"RenderRequest":{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 154"},"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"},"toSign":{"type":"boolean","description":"Флаг необходимости первичного подписания документа","example":true},"editedHtml":{"type":"string","description":"HTML документа, изменённый пользователем в предпросмотре (необязательно). Если передан, документ строится из него (значения уже подставлены), а не из шаблона; шаблон не меняется. HTML очищается (script, iframe, формы, on*-атрибуты, внешние картинки удаляются), размер не больше ~5 МБ. Если у группы пользователя включён запрет редактирования (право previewEditing:denied), ответ 403 (permission.previewediting). Сохраняется вместе с документом: признак edited в ответе, сам HTML — GET /renders/{id}/editeddocument","example":"<p style=\"text-align:center\"><b>Договор</b></p><p>Текст, изменённый пользователем</p>"}}},"SignedRenderRequest":{"type":"object","properties":{"file":{"description":"Файлы подписанного документа: PDF (.pdf) и откреплённая подпись УКЭП (.sig); при наличии — XML (.xml)","type":"array","items":{"type":"string","description":"Файл","format":"binary"}},"name":{"type":"string","description":"Название","example":"Договор 154"},"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"},"qualifiedSignature":{"$ref":"#/components/schemas/QualifiedSignature"},"editedHtml":{"type":"string","description":"HTML документа, изменённый пользователем в предпросмотре (необязательно). Если передан, документ строится из него (значения уже подставлены), а не из шаблона; шаблон не меняется. HTML очищается (script, iframe, формы, on*-атрибуты, внешние картинки удаляются), размер не больше ~5 МБ. Если у группы пользователя включён запрет редактирования (право previewEditing:denied), ответ 403 (permission.previewediting). Сохраняется вместе с документом: признак edited в ответе, сам HTML — GET /renders/{id}/editeddocument (в multipart — текстовое поле)"}}},"EdoSignedRenderRequest":{"allOf":[{"$ref":"#/components/schemas/SignedRenderRequest"},{"type":"object","properties":{"counteragentInn":{"type":"string","description":"ИНН контрагента (получателя)","example":1234567890},"counteragentName":{"type":"string","description":"Название контрагента (получателя)","example":"ООО Умные документы"}}}]},"AppendixVariableOption":{"type":"object","description":"Переменная шаблона, которую можно выбрать для страниц приложений","properties":{"sideId":{"type":"string","description":"id стороны шаблона","example":"zakazchik"},"sideIndex":{"type":"integer","description":"Номер стороны (с 0)","example":0},"sideName":{"type":"string","description":"Название стороны","example":"Заказчик"},"tattrId":{"type":"string","description":"id переменной","example":"2007"},"name":{"type":"string","description":"Название переменной","example":"Дата договора"}}},"SendRenderRequest":{"type":"object","required":["name","sideValues","email"],"properties":{"name":{"type":"string","description":"Название документа (не пустое)","example":"Договор 154"},"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"},"editedHtml":{"type":"string","description":"HTML документа, изменённый пользователем в предпросмотре (необязательно; правила — как в POST /templates/{id}/render)","example":"<p>Текст, изменённый пользователем</p>"},"email":{"type":"string","format":"email","description":"E-mail получателя письма с PDF документа","example":"vm@datadoc.ru"},"sender":{"type":"object","description":"Отправитель в письме (необязательно)","properties":{"name":{"type":"string","maxLength":200,"description":"Имя отправителя; по умолчанию имя (или логин) текущего пользователя","example":"Иван Петров"},"email":{"type":"string","format":"email","description":"E-mail отправителя (для ответа); по умолчанию логин текущего пользователя","example":"vm@datadoc.ru"}}}}},"SendRenderResponse":{"allOf":[{"$ref":"#/components/schemas/RenderResponse"},{"type":"object","properties":{"sent":{"type":"boolean","description":"Письмо отправлено","example":true}}}]},"TemplateMappingTattr":{"type":"object","properties":{"toId":{"type":"string","description":"Переменная шаблона, в который переносятся значения","example":"64d5e8685186ca28a0567747"},"fromId":{"type":"string","description":"Переменная документа-источника; не указана — значение не переносится","example":"64d5e8685186ca28a0567748"}}},"TemplateMappingSide":{"type":"object","properties":{"toSideId":{"type":"string","description":"Сторона шаблона, в который переносятся значения","example":"side1"},"fromSideId":{"type":"string","description":"Сторона документа-источника; не указана — сторона остаётся пустой","example":"side2"},"tattrs":{"type":"array","description":"Выбор для пользовательских переменных (штатные и переменные с тем же id переносятся сами)","items":{"$ref":"#/components/schemas/TemplateMappingTattr"}}}},"TemplateMappingState":{"type":"object","properties":{"status":{"type":"string","enum":["ready","needsMapping","invalid"],"description":"ready — можно открывать экран заполнения; needsMapping — сопоставления нет, его нужно выбрать; invalid — сохранённое сопоставление устарело (см. errors)"},"saved":{"type":"boolean","description":"Сопоставление сохранено для пары шаблонов"},"template":{"type":"object","description":"Выбранный шаблон"},"source":{"type":"object","description":"Стороны и переменные документа-источника (на момент его создания)"},"target":{"type":"object","description":"Стороны и переменные текущей версии выбранного шаблона"},"mapping":{"type":"array","description":"Действующее или предложенное сопоставление","items":{"$ref":"#/components/schemas/TemplateMappingSide"}},"errors":{"type":"array","description":"Что устарело в сохранённом сопоставлении (reason - sideNotInSource, sideNotInTarget, tattrNotInSource, tattrNotInTarget, sideUnmapped, tattrUnmapped)","items":{"type":"object"}},"warnings":{"type":"array","description":"Значения, которые не перенесены (reason - typeMismatch)","items":{"type":"object"}},"sideValues":{"type":"array","description":"Значения для экрана заполнения выбранного шаблона по порядку его сторон (только при status ready)","items":{"type":"object"}}}},"TcRequestAdmin":{"allOf":[{"$ref":"#/components/schemas/TcRequest"},{"type":"object","properties":{"workspace":{"description":"Воркспейс, к которому относится заявка","allOf":[{"$ref":"#/components/schemas/IdObject"}]}}}]},"NewTcRequest":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"},"description":{"type":"string","description":"Описание","example":"Заявка на создание шаблона"}}},"TcRequest":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"filename":{"type":"string","description":"Имя файла","example":"dogovor.docx"},"mimeType":{"type":"string","description":"Тип файла","example":"image/jpeg"},"description":{"type":"string","description":"Описание файла","example":"Контракт 2023 года"},"size":{"type":"integer","description":"Размер файла","example":23821},"ext":{"type":"string","description":"Расширение файла","example":".jpg"},"createdAt":{"type":"string","description":"Дата загрузки файла","example":"2023-02-01T15:37:51.739Z"},"templateAt":{"type":"string","description":"Дата создания шаблона","example":"2023-02-01T15:37:51.739Z"},"ai":{"type":"boolean","description":"Флаг заявки для ИИ","example":true},"user":{"type":"object","description":"Пользователь, создавший заявку","properties":{"id":{"type":"string","description":"id пользователя","example":"62bb25949213f16bcd934422"},"login":{"type":"string","description":"Логин пользователя","example":"user@mail.ru"},"name":{"type":"string","description":"Имя пользователя","example":"Иванов Иван Иванович"}}}}}]},"TaskType":{"type":"string","description":"Тип задачи","example":"TCREQUEST","enum":["TCREQUEST","SHAREDTEMPLATE"]},"TaskPosition":{"type":"string","nullable":true,"description":"Столбец канбан-доски (null — задача ещё не на доске)","example":"CREATED","enum":["CREATED","IN_WORK","TEST","READY","IMPOSSIBLE"]},"NewTask":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"},"type":{"$ref":"#/components/schemas/TaskType"},"creatorid":{"type":"string","description":"id автора","example":"62bb25949213f16bcd934422"},"creatorlogin":{"type":"string","description":"Логин автора (вместо id)","example":"test@mail.ru"},"managerid":{"type":"string","description":"id менеджера","example":"62bb25949213f16bcd934422"},"managerlogin":{"type":"string","description":"Логин менеджера (вместо id)","example":"test@mail.ru"},"description":{"type":"string","description":"Описание","example":"Заявка на создание шаблона"},"priority":{"type":"integer","description":"Приоритет","example":0}}},"UpdateTask":{"type":"object","properties":{"priority":{"type":"integer","description":"Приоритет","example":0},"managerid":{"type":"string","description":"id менеджера","example":"62bb25949213f16bcd934422"},"managerlogin":{"type":"string","description":"Логин менеджера","example":"test@mail.ru"},"position":{"$ref":"#/components/schemas/TaskPosition"}}},"Task":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/TaskType"},"status":{"type":"string","description":"Статус","example":"CREATED","enum":["CREATED","IN_WORK","TEST","RETURN_TO_WORK","READY","ARCHIVED","IMPOSSIBLE","DELETED"]},"position":{"$ref":"#/components/schemas/TaskPosition"},"description":{"type":"string","description":"Описание","example":"Заявка на создание шаблона"},"priority":{"type":"integer","description":"Приоритет","example":0},"duration":{"type":"string","description":"Продолжительность","example":"10 минут"},"durationInMinutes":{"type":"integer","description":"Продолжительность в минутах","example":10},"durationType":{"type":"string","description":"Тип продолжительности","example":"DURATION_GOOD","enum":["DURATION_GOOD","DURATION_NORMAL","DURATION_BAD","DURATION_OVERDUE"]},"createdAt":{"type":"string","description":"Дата создания","example":"2023-02-01T15:37:51.739Z"},"templateAt":{"type":"string","description":"Дата завершения","example":"2023-02-01T15:37:51.739Z"},"filename":{"type":"string","description":"Имя файла","example":"kjvsfkvsf.docx"},"ai":{"type":"boolean","description":"Флаг задачи для ИИ","example":true},"creator":{"description":"Автор задачи (пользователь, создавший заявку)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"login","example":"test@mail.ru"},"name":{"type":"string","description":"Имя","example":"Иван Иванов"},"workspace":{"description":"Воркспейс автора","allOf":[{"$ref":"#/components/schemas/IdObject"}]}}}]},"manager":{"description":"Менеджер (ответственный за задачу)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"login","example":"test@mail.ru"},"name":{"type":"string","description":"Имя","example":"Иван Иванов"},"initials":{"type":"string","description":"Инициалы","example":"ИИ"},"color":{"type":"string","description":"Цвет","example":"#ff00ff"}}}]}}}]},"TaskLogBase":{"type":"object","properties":{"type":{"type":"string","description":"Тип","example":"LOG","enum":["COMMENT","LOG"]},"message":{"type":"string","description":"Сообщение","example":"Задача создана"},"createdAt":{"type":"string","description":"Дата создания","example":"2023-02-01T15:37:51.739Z"}}},"TaskWithLogs":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","properties":{"logs":{"type":"array","description":"Журнал задачи — комментарии и записи об изменениях","items":{"allOf":[{"$ref":"#/components/schemas/TaskLogBase"},{"type":"object","properties":{"user":{"description":"Пользователь, оставивший запись","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"login","example":"test@mail.ru"},"name":{"type":"string","description":"Имя","example":"Иван Иванов"}}}]}}}]}}}}]},"TariffPaymentType":{"type":"string","description":"Тип оплаты","enum":["mixed","invoice"],"example":"invoice"},"TariffInstanceLastTransaction":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/TariffPaymentType"},"lastTransactionDate":{"type":"string","description":"Дата последней оплаты","example":"2023-08-21T20:59:59.999Z"},"lastTransactionAmount":{"type":"integer","description":"Сумма последней оплаты","example":2700}}}]},"TariffInstanceNeighbour":{"type":"object","description":"Соседний (по датам) экземпляр тарифа того же рабочего пространства","properties":{"id":{"type":"string","description":"id экземпляра тарифа","example":"62bb25949213f16bcd934422"},"name":{"type":"string","description":"Название экземпляра тарифа","example":"Бизнес месяц"},"dtFrom":{"type":"string","format":"date-time","description":"Начало действия","example":"2026-10-01T00:00:00.000Z"},"dtTo":{"type":"string","format":"date-time","description":"Окончание действия","example":"2026-10-31T20:59:59.999Z"}}},"TariffInstanceAdmin":{"allOf":[{"$ref":"#/components/schemas/TariffInstance"},{"type":"object","properties":{"workspace":{"description":"Рабочее пространство экземпляра тарифа","allOf":[{"$ref":"#/components/schemas/IdObject"}]},"user":{"type":"object","description":"Владелец рабочего пространства","properties":{"login":{"type":"string","description":"Логин","example":"user@mail.ru"},"name":{"type":"string","description":"Имя","example":"Сидоров Петр Иванович"}}}}}]},"TariffCurrentInstanceAdmin":{"allOf":[{"$ref":"#/components/schemas/TariffInstance"},{"type":"object","properties":{"currentUsersCount":{"type":"integer","description":"Текущее количество пользователей","example":5},"templatesCount":{"type":"integer","description":"Текущее количество шаблонов","example":3},"rendersCount":{"type":"integer","description":"Текущее количество документов","example":1},"tcrequestsNotProcessedCount":{"type":"integer","description":"Текущее количество открытых заявок на настройку шаблонов","example":1},"accountingdetails":{"description":"Реквизиты организации рабочего пространства","allOf":[{"$ref":"#/components/schemas/AccountingDetails"}]},"featured":{"type":"boolean","description":"Флаг избранного воркспейса","example":false},"payment":{"description":"Последняя оплата экземпляра тарифа","allOf":[{"$ref":"#/components/schemas/TariffInstanceLastTransaction"}]},"workspace":{"description":"Рабочее пространство с лимитами подписей и вложений","allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/SignatureLimits"},{"$ref":"#/components/schemas/AttachmentLimits"},{"type":"object","properties":{"createdAt":{"type":"string","description":"Дата создания","example":"2023-08-07T17:05:35.677Z"},"number":{"type":"string","description":"Номер рабочего пространства","example":40356}}}]},"user":{"type":"object","description":"Владелец рабочего пространства","properties":{"login":{"type":"string","description":"Логин","example":"user@mail.ru"},"name":{"type":"string","description":"Имя","example":"Сидоров Петр Иванович"},"lastValidDate":{"type":"string","description":"Дата последнего посещения сервиса","example":"2023-11-21T13:12:47.354Z"}}}}}]},"TariffPattern":{"type":"object","properties":{"id":{"type":"string","description":"Идентификатор","example":"tariff_team_30"},"name":{"type":"string","description":"Название","example":"Команда месяц"},"duration":{"type":"integer","description":"Продолжительность в днях","example":30},"discount":{"type":"number","description":"Скидка в %","example":0},"basePrice":{"type":"number","description":"Базовая стоимость","example":2900},"price":{"type":"number","description":"Стоимость","example":2900},"canChoose":{"type":"boolean","description":"Доступен к выбору","example":true},"canRenewal":{"type":"boolean","description":"Автопродление","example":true},"userPrice":{"type":"number","description":"Цена добавления одного пользователя","example":500},"attachmentsSizePrice":{"type":"number","description":"Цена добавления одного ГБ Хранилища","example":500}}},"Tariff":{"type":"object","properties":{"id":{"type":"string","description":"Идентификатор","example":"tariff_team"},"level":{"type":"integer","description":"Уровень тарифа","example":10},"name":{"type":"string","description":"Название","example":"Команда"},"usersLimit":{"type":"integer","description":"Количество пользователей","example":3},"attachmentsSizeLimit":{"type":"number","description":"Количество ГБ Хранилища","example":3},"canAddUsers":{"type":"boolean","description":"Можно ли добавлять пользователей","example":false},"canAddAttachmentsSize":{"type":"boolean","description":"Можно ли увеличивать объем Хранилища","example":false},"patterns":{"type":"array","description":"Варианты оплаты тарифа (паттерны по сроку и цене)","items":{"$ref":"#/components/schemas/TariffPattern"}},"advantages":{"type":"array","description":"Список преимуществ тарифа для показа на витрине","items":{"type":"string","example":"До 15 активных пользователей"}},"description":{"type":"string","description":"Описание тарифа","example":"Какой-то тариф"}}},"TariffInstance":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"patternId":{"type":"string","description":"Идентификатор","example":"tariff_team"},"name":{"type":"string","description":"Название","example":"Бизнес месяц"},"duration":{"type":"integer","description":"Продолжительность в днях","example":30},"discount":{"type":"number","description":"Скидка в %","example":0},"basePrice":{"type":"number","description":"Базовая цена","example":0},"discountAmount":{"type":"number","description":"Сумма скидки","example":0},"discountRestAmount":{"type":"number","description":"Сумма скидки за неиспользованную часть предыдущего тарифа","example":0},"addUsersAmount":{"type":"number","description":"Стоимость дополнительных пользователей","example":0},"addAttachmentsSizeAmount":{"type":"number","description":"Стоимость дополнительного объема Хранилища","example":0},"price":{"type":"number","description":"Стоимость","example":2900},"pricePaid":{"type":"number","description":"Стоимость оплачена","example":2900},"userPrice":{"type":"number","nullable":true,"description":"Цена добавления одного пользователя","example":500},"attachmentsSizePrice":{"type":"number","nullable":true,"description":"Цена добавления одного ГБ Хранилища","example":500},"usersCount":{"type":"integer","description":"Количество пользователей","example":3},"attachmentsSize":{"type":"number","description":"Количество ГБ Хранилища","example":5},"dtFrom":{"type":"string","description":"Начало действия","example":"2023-07-23T10:08:55.254Z"},"dtTo":{"type":"string","description":"Окончание действия","example":"2023-08-21T20:59:59.999Z"},"isPaid":{"type":"boolean","description":"Оплачен","example":true},"isActive":{"type":"boolean","description":"Активен","example":true},"amountToPay":{"type":"number","description":"Осталось оплатить","example":2900},"canRenewal":{"type":"boolean","description":"Автопродление","example":true},"paidAt":{"type":"string","description":"Дата оплаты по счету","example":"2023-07-23T10:08:55.254Z"},"promocodeId":{"type":"string","description":"id промокода","example":"62bb25949213f16bcd934422"},"promocodeDiscountAmount":{"type":"number","description":"Скидка по промкоду","example":100},"addAttachmentsSize":{"type":"number","description":"Количество дополнительных ГБ Хранилища","example":1},"dtReadonly":{"type":"string","nullable":true,"description":"Окончание действия пробного периода тарифа","example":"2023-08-21T20:59:59.999Z"},"canceled":{"type":"boolean","description":"Флаг отмены экземпляра тарифа","example":true},"bonusDays":{"type":"integer","description":"Количество бонусных дней","example":10},"tariff":{"type":"object","description":"Краткие данные тарифа, к которому относится экземпляр","properties":{"id":{"type":"string","description":"Идентификатор","example":"tariff_team"},"name":{"type":"string","description":"Название","example":"Команда"},"canAddUsers":{"type":"boolean","description":"Можно ли добавлять пользователей","example":false},"canAddAttachmentsSize":{"type":"boolean","description":"Можно ли увеличивать объем Хранилища","example":false},"usersLimit":{"type":"integer","description":"Количество пользователей","example":3},"attachmentsSizeLimit":{"type":"number","description":"Количество ГБ Хранилища","example":3}}}}}]},"TariffPriceResponse":{"type":"object","properties":{"basePrice":{"type":"number","description":"Базовая стоимость","example":2900},"price":{"type":"number","description":"Стоимость","example":24246},"discountAmount":{"type":"number","description":"Сумма скидки","example":0},"discountRestAmount":{"type":"number","description":"Сумма скидки за неиспользованную часть предыдущего тарифа","example":0},"addUsersAmount":{"type":"number","description":"Стоимость дополнительных пользователей","example":0},"addAttachmentsSizeAmount":{"type":"number","description":"Стоимость дополнительного объема Хранилища","example":0},"shouldCreateCurrentInstance":{"type":"boolean","description":"Станет ли тариф текущим при выборе","example":false},"canChoose":{"type":"boolean","description":"Доступность для выбора","example":true},"renewPrice":{"type":"number","description":"Цена продления","example":1000}}},"NewSystemMessage":{"type":"object","properties":{"name":{"type":"string","description":"Название сообщения","example":"Проблема с внешним сервисом"},"content":{"type":"string","description":"Содержимое сообщения","example":"Внешний сервис недоступен"},"status":{"type":"string","description":"Статус сообщения","enum":["UNPUBLISHED","ACTIVE","CLOSED"],"example":"ACTIVE"},"expiresAt":{"type":"string","description":"Дата и время автоматического закрытия сообщения","example":"2023-05-04T17:34:24.535Z"}}},"SystemMessage":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewSystemMessage"},{"type":"object","properties":{"createdAt":{"type":"string","description":"Дата и время создания","example":"2023-05-04T17:34:24.535Z"}}}]},"NewStrictattr":{"type":"object","properties":{"type":{"type":"string","enum":["string","html","list","integer","decimal","money","date","email","firstname","middlename","familyname","indexnumber","address","phone"],"description":"Тип переменной: string — строка, html — форматированный текст, list — список значений, integer — целое число, decimal — дробное число, money — денежная сумма, date — дата, email — e-mail, firstname/middlename/familyname — имя/отчество/фамилия (склоняются), indexnumber — порядковый номер, address — адрес, phone — телефон","example":"string"},"name":{"type":"string","description":"Название переменной","example":"Имя кота"},"charset":{"type":"string","description":"Набор возможных символов","example":"R"},"minLength":{"type":"integer","description":"Минимальная длина","example":5},"maxLength":{"type":"integer","description":"Максимальная длина","example":10},"length":{"type":"integer","description":"Длина","example":7},"values":{"type":"array","description":"Набор значений","example":["Мужской","Женский"],"items":{"type":"string"}},"multiple":{"type":"boolean","description":"Флаг \"множественный выбор\"","example":true},"regexp":{"type":"string","description":"Регулярное выражение","example":"^\\d{3}-\\d{3}$"},"caseType":{"type":"string","enum":["anyCase","upperFirst","upperCase","lowerCase"],"description":"Регистр","example":"lowerCase"},"mask":{"type":"string","description":"Маска для ввода","example":"XXX-XXX"},"labelLineCount":{"type":"integer","description":"Количество строк в названии","example":1},"labelWidth":{"type":"integer","description":"Ширина названия в px","example":190},"inputWidth":{"type":"integer","description":"Ширина поля ввода в px","example":190},"inputText":{"type":"string","description":"Текст поля ввода","example":"Фамилия"},"inputTooltip":{"type":"string","description":"Подсказка поля ввода","example":"Введите фамилию"},"errorMessage":{"type":"string","description":"Текст ошибки","example":"Фамилия введена неверно"},"ownVariant":{"type":"boolean","description":"Флаг \"возможен ли свой вариант переменной\"","example":true},"description":{"type":"string","description":"Описание переменной (макс. 300 символов)","example":"string"},"priority":{"type":"integer","description":"Приоритет","example":0}}},"StrictattrId":{"type":"object","properties":{"id":{"type":"string","description":"id строгой переменной (номер в виде строки)","example":"101"}}},"Strictattr":{"allOf":[{"type":"object","properties":{"lang":{"type":"string","description":"Язык переменной","example":"ru"}}},{"$ref":"#/components/schemas/StrictattrId"},{"$ref":"#/components/schemas/NewStrictattr"}]},"NewStrictattrSection":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Юридические лица"},"scope":{"type":"string","description":"Принадлежность","example":"P"},"folders":{"type":"array","description":"Список папок","example":[101,102],"items":{"type":"integer"}},"priority":{"type":"integer","description":"Приоритет","example":0}}},"StrictattrSectionId":{"type":"object","properties":{"id":{"type":"integer","description":"id раздела","example":101}}},"StrictattrSection":{"allOf":[{"$ref":"#/components/schemas/StrictattrSectionId"},{"$ref":"#/components/schemas/NewStrictattrSection"}]},"NewStrictattrFolder":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Паспорт"},"attrs":{"type":"array","description":"Список переменных","example":[101,102],"items":{"type":"string"}},"priority":{"type":"integer","description":"Приоритет","example":0}}},"StrictattrFolderId":{"type":"object","properties":{"id":{"type":"integer","description":"id папки","example":101}}},"StrictattrFolder":{"allOf":[{"$ref":"#/components/schemas/StrictattrFolderId"},{"$ref":"#/components/schemas/NewStrictattrFolder"}]},"StrictTemplateWithUploadFlag":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название строгого шаблона","example":"КС-3"},"hasFile":{"type":"boolean","description":"Загружен ли файл для последней версии шаблона","example":true}}}]},"StrictTemplateCells":{"properties":{"cells":{"type":"array","description":"Диапазоны ячеек в файле Excel","items":{"type":"array","items":{"type":"string","description":"Координаты ячейки","example":"C30"}}}}},"StrictTemplateTattr":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateCells"},{"type":"object","properties":{"id":{"type":"string","description":"id переменной","example":101},"from":{"type":"string","enum":["strictattr"],"description":"Тип переменной","example":"strictattr"},"required":{"type":"boolean","description":"Обязательность переменной","example":true}}}]},"StrictTemplateTattrFull":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateTattr"},{"$ref":"#/components/schemas/Strictattr"}]},"StrictTemplateTattrFolder":{"type":"object","properties":{"id":{"type":"string","description":"id группы","example":"person.user.id"},"name":{"type":"string","description":"Имя группы","example":"Группа крови"},"tattrs":{"description":"Переменные группы","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateTattr"}}}},"StrictTemplateTattrFolderWithFullTattrs":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateTattrFolder"},{"type":"object","properties":{"tattrs":{"description":"Переменные группы с полными данными строгой переменной","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateTattrFull"}}}}]},"StrictTemplateColumn":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateCells"},{"type":"object","properties":{"id":{"type":"string","description":"id колонки таблицы","example":"name"},"name":{"type":"string","description":"Название колонки","example":"Название"},"width":{"type":"string","description":"Ширина колонки","example":"10.63%"},"canApplyToAll":{"type":"boolean","description":"Можно ли применить значение ко всем строкам таблицы","example":true},"readOnly":{"type":"boolean","description":"Колонка только для чтения","example":true},"type":{"type":"string","description":"Тип данных в колонке","example":"price"},"maxLength":{"type":"integer","description":"Макс. количество символов","example":10}}}]},"StrictTemplateTableTotal":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateCells"},{"type":"object","properties":{"id":{"type":"string","description":"id глобального поля таблицы","example":"totalPrice"},"name":{"type":"string","description":"Название глобального поля таблицы","example":"Итого"}}}]},"StrictTemplateBlocksTree":{"type":"object","description":"Дерево вариативных блоков"},"StrictTemplateTable":{"type":"object","properties":{"id":{"type":"string","description":"id таблицы","example":"a68785f5-e6e2-4f30-b0a5-3776bdd34596"},"name":{"type":"string","description":"Название таблицы","example":"Таблица 1"},"columns":{"description":"Колонки таблицы","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateColumn"}},"total":{"description":"Глобальные (итоговые) поля таблицы","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateTableTotal"}}}},"StrictTemplateSide":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Заказчик"},"id":{"type":"string","description":"id","example":"zakazchik"},"tattrFolders":{"description":"Группы переменных стороны","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateTattrFolder"}},"tables":{"description":"Таблицы стороны","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateTable"}}}},"StrictTemplateSideWithFullTattrs":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateSide"},{"type":"object","properties":{"tattrFolders":{"description":"Группы переменных стороны с полными данными переменных","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateTattrFolderWithFullTattrs"}}}}]},"StrictTemplateContent":{"type":"object","properties":{"name":{"type":"string","description":"Название строгого шаблона","example":"КС-3"},"sides":{"description":"Стороны строгого шаблона","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateSide"}},"blocksTree":{"$ref":"#/components/schemas/StrictTemplateBlocksTree"}}},"StrictTemplateTattrValues":{"type":"object","description":"Значения переменных строгого шаблона","properties":{"101":{"type":"string","description":"id переменной строгого шаблона","example":"Значение"}}},"StrictTemplateTableValues":{"type":"array","description":"Значения таблиц стороны","items":{"type":"object","properties":{"tableId":{"type":"string","description":"id таблицы","example":"a68785f5-e6e2-4f30-b0a5-3776bdd34596"},"products":{"description":"Строки таблицы (товары)","type":"array","items":{"type":"object","properties":{"vendorCode":{"type":"string","description":"Артикул","example":"asds11111d"},"name":{"type":"string","description":"Название","example":"Название"},"category":{"type":"string","description":"Категория","example":"Категория"},"unit":{"type":"string","description":"Единица измерения количества продуктов","example":"шт"},"price":{"type":"integer","description":"Цена продукта","example":120000},"description":{"type":"string","description":"Описание продукта","example":"Какое-то описание"},"VAT":{"type":"integer","description":"НДС","example":10},"discountPercent":{"type":"integer","description":"Скидка в процентах","example":10},"discountCost":{"type":"integer","description":"Скидка в рублях","example":10000},"count":{"type":"integer","description":"Количество товаров","example":1}}}},"total":{"description":"Значения глобальных полей таблицы: «id поля — значение»","type":"object","properties":{"totalDiscountPercent":{"type":"string","description":"Глобальное поле таблицы","example":100}}}}}},"StrictTemplateSideValues":{"type":"array","description":"Значения сторон документа — по одному объекту на каждую сторону строгого шаблона, в том же порядке","items":{"type":"object","properties":{"counteragentid":{"type":"string","description":"id контрагента","example":"62bb25949213f16bcd934422"},"updateCounteragent":{"type":"boolean","description":"Флаг обновления данных контрагента","example":false},"tattrValues":{"$ref":"#/components/schemas/StrictTemplateTattrValues"},"tableValues":{"$ref":"#/components/schemas/StrictTemplateTableValues"}}}},"StrictTemplateComboattr":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Поиск организации"},"path":{"type":"string","description":"Путь к методу API","example":"/dadata/suggestparty"},"paramname":{"type":"string","description":"Наименование query-параметра, который нужно передать методу","example":"query"},"displayname":{"type":"string","description":"Наименование свойства возвращаемого объекта, который нужно показать","example":"value"},"substitute":{"type":"array","description":"Массив подстановок","items":{"type":"object","properties":{"tattrid":{"type":"string","description":"id переменной","example":301},"value":{"type":"string","description":"Наименование свойства возвращаемого объекта, который нужно подставить","example":"data.inn"}}}}}},"StrictTemplateSideWithCombo":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateSide"},{"type":"object","properties":{"tattrFolders":{"description":"Группы переменных стороны с полными данными и комбо-полями","type":"array","items":{"allOf":[{"$ref":"#/components/schemas/StrictTemplateTattrFolderWithFullTattrs"},{"type":"object","properties":{"comboattrs":{"description":"Комбо-поля группы: поиск по внешнему API с подстановкой найденного в переменные","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateComboattr"}}}}]}}}}]},"StrictTemplateSidesWithCombo":{"type":"object","properties":{"sides":{"description":"Стороны строгого шаблона с комбо-полями","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateSideWithCombo"}},"blocksTree":{"$ref":"#/components/schemas/StrictTemplateBlocksTree"}}},"StrictTemplate":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название строгого шаблона","example":"КС-3"}}}]},"StrictRender":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Акт 203"},"createdAt":{"type":"string","description":"Дата и время создания документа","example":"2022-07-16T13:10:43.284+00:00"}}}]},"StrictRenderContent":{"allOf":[{"$ref":"#/components/schemas/StrictRender"},{"type":"object","properties":{"strictTemplateId":{"type":"string","description":"id строгого шаблона","example":"62bb25949213f16bcd934422"},"strictTemplateVersion":{"type":"integer","description":"Версия строгого шаблона","example":0},"sides":{"description":"Стороны строгого шаблона (версии документа) с полными данными переменных","type":"array","items":{"$ref":"#/components/schemas/StrictTemplateSideWithFullTattrs"}},"sideValues":{"$ref":"#/components/schemas/StrictTemplateSideValues"},"blocksTree":{"$ref":"#/components/schemas/StrictTemplateBlocksTree"}}}]},"NewStrictProductProperty":{"type":"object","properties":{"type":{"type":"string","enum":["string","html","list","integer","decimal","money","date","email","firstname","middlename","familyname","indexnumber","address","phone"],"description":"Тип свойства: string — строка, html — форматированный текст, list — список значений, integer — целое число, decimal — дробное число, money — денежная сумма, date — дата, email — e-mail, firstname/middlename/familyname — имя/отчество/фамилия (склоняются), indexnumber — порядковый номер, address — адрес, phone — телефон","example":"string"},"name":{"type":"string","description":"Название свойства","example":"Товар"},"charset":{"type":"string","description":"Набор возможных символов","example":"R"},"minLength":{"type":"integer","description":"Минимальная длина","example":5},"maxLength":{"type":"integer","description":"Максимальная длина","example":10},"length":{"type":"integer","description":"Длина","example":7},"values":{"type":"array","description":"Набор значений","example":["Мужской","Женский"],"items":{"type":"string"}},"multiple":{"type":"boolean","description":"Флаг \"множественный выбор\"","example":true},"regexp":{"type":"string","description":"Регулярное выражение","example":"^\\d{3}-\\d{3}$"},"caseType":{"type":"string","enum":["anyCase","upperFirst","upperCase","lowerCase"],"description":"Регистр","example":"lowerCase"},"mask":{"type":"string","description":"Маска для ввода","example":"XXX-XXX"},"labelLineCount":{"type":"integer","description":"Количество строк в названии","example":1},"labelWidth":{"type":"integer","description":"Ширина названия в px","example":190},"inputWidth":{"type":"integer","description":"Ширина поля ввода в px","example":190},"inputText":{"type":"string","description":"Текст поля ввода","example":"Название"},"inputTooltip":{"type":"string","description":"Подсказка поля ввода","example":"Введите название"},"errorMessage":{"type":"string","description":"Текст ошибки","example":"Название введено неверно"},"ownVariant":{"type":"boolean","description":"Флаг \"возможен ли свой вариант свойства\"","example":true},"description":{"type":"string","description":"Описание свойства (макс. 300 символов)","example":"string"},"required":{"type":"boolean","description":"Флаг \"обязательное свойство\"","example":true}}},"IdStrictProductProperty":{"type":"object","properties":{"id":{"type":"string","description":"id свойства","example":"price"}}},"StrictProductProperty":{"allOf":[{"type":"object","properties":{"lang":{"type":"string","description":"Язык свойства","example":"ru"}}},{"$ref":"#/components/schemas/IdStrictProductProperty"},{"$ref":"#/components/schemas/NewStrictProductProperty"}]},"StorageRoomUsage":{"type":"object","description":"Объём воркспейса (FOR-2774, FOR-2779), байты. Без лимита администратора действует бесплатный объём из настроек сервиса storage.freeStorageMb и storage.freeAppendicesMb (по умолчанию «Хранилище файлов» — 0, не подключено; «Вложения» — приложения к документам и подписанные документы ПЭП/УКЭП — 100 МБ). «Лимит хранилища» администратора (от 1 ГБ) — общий объём Хранилища и вложений. Тестовый аккаунт — Хранилище по лимиту администратора или 100 МБ, вложения без лимита.","properties":{"enabled":{"type":"boolean","description":"«Хранилище файлов» включено воркспейсу","example":true},"trial":{"type":"boolean","description":"Пробный период Хранилища (пробного периода нет — всегда false)","example":false},"available":{"type":"boolean","description":"Хранилище доступно воркспейсу (сейчас совпадает с enabled)","example":true},"used":{"type":"integer","description":"Занято в Хранилище","example":12582912},"limit":{"type":"integer","description":"Объём Хранилища (при общем лимите — общий объём); 0 — Хранилище не подключено","example":1073741824},"limitGb":{"type":"number","description":"Объём Хранилища (limit), ГБ","example":1},"limitCustomGb":{"type":"number","nullable":true,"description":"Лимит администратора, ГБ; null — не задан","example":1},"appendicesUsed":{"type":"integer","description":"Занято вложениями","example":52428800},"appendicesLimit":{"type":"integer","nullable":true,"description":"Объём вложений; null — без лимита (тестовый аккаунт)","example":1073741824},"shared":{"type":"boolean","description":"Лимит общий для Хранилища и вложений (сумма не больше лимита)","example":true},"testAccount":{"type":"boolean","description":"Тестовый аккаунт — без ограничений хранилища","example":false}}},"StorageItemRef":{"type":"object","description":"Ссылка на элемент Хранилища — папку или файл","required":["type","id"],"properties":{"type":{"type":"string","enum":["folder","file"],"description":"Тип элемента: folder — папка, file — файл","example":"file"},"id":{"type":"string","description":"id папки или файла (24 шестнадцатеричных символа)","example":"62bb25949213f16bcd934422"}}},"StorageItems":{"type":"object","required":["items"],"properties":{"items":{"type":"array","description":"Выбранные элементы, от 1 до 500","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/StorageItemRef"},"example":[{"type":"folder","id":"62bb25949213f16bcd934422"},{"type":"file","id":"62bb25949213f16bcd934423"}]}}},"StorageFolder":{"type":"object","description":"Папка Хранилища файлов","properties":{"id":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"},"name":{"type":"string","description":"Название папки","example":"Договоры 2026"},"parentid":{"type":"string","nullable":true,"description":"id родительской папки; нет поля — папка в корне Хранилища","example":"62bb25949213f16bcd934421"},"groups":{"type":"array","description":"id групп пользователей, которым видна папка; пустой массив — папку видят все пользователи воркспейса","items":{"type":"string","description":"id группы пользователей"},"example":["62bb25949213f16bcd934430"]},"adminAccessOnly":{"type":"boolean","description":"Папка видна только администраторам воркспейса; нет поля — ограничения нет","example":false},"position":{"type":"integer","description":"Порядок среди соседних элементов папки (меньше — ближе к началу)","example":0},"createdAt":{"type":"string","format":"date-time","description":"Дата создания папки","example":"2026-11-01T10:00:00.000Z"}}},"StorageFileSource":{"type":"object","description":"Откуда файл попал в Хранилище — документ, отправленный кнопкой «Отправить в Хранилище»","properties":{"type":{"type":"string","enum":["render","externalInfill"],"description":"Тип документа: render — документ (рендер шаблона), externalInfill — внешнее заполнение (ПЭП)","example":"render"},"id":{"type":"string","description":"id документа","example":"62bb25949213f16bcd934440"}}},"StorageFile":{"type":"object","description":"Файл Хранилища (метаданные; содержимое скачивается отдельным запросом)","properties":{"id":{"type":"string","description":"id файла","example":"62bb25949213f16bcd934423"},"name":{"type":"string","description":"Имя файла без расширения","example":"Договор аренды"},"ext":{"type":"string","description":"Расширение без точки (латиница и цифры, до 10 символов); пустая строка — без расширения","example":"pdf"},"fullName":{"type":"string","description":"Полное имя файла — имя и расширение через точку","example":"Договор аренды.pdf"},"mimeType":{"type":"string","description":"MIME-тип файла (по умолчанию application/octet-stream)","example":"application/pdf"},"size":{"type":"integer","description":"Размер файла, байты","example":254012},"folderid":{"type":"string","nullable":true,"description":"id папки, в которой лежит файл; нет поля — файл в корне Хранилища","example":"62bb25949213f16bcd934422"},"position":{"type":"integer","description":"Порядок среди соседних элементов папки (меньше — ближе к началу)","example":1},"uid":{"type":"string","description":"id пользователя, загрузившего файл","example":"62bb25949213f16bcd934450"},"createdAt":{"type":"string","format":"date-time","description":"Дата загрузки файла","example":"2026-11-01T10:05:00.000Z"},"source":{"description":"Документ-источник; нет поля — файл загружен пользователем","allOf":[{"$ref":"#/components/schemas/StorageFileSource"}]}}},"StorageTrashMeta":{"type":"object","properties":{"deletedAt":{"type":"string","format":"date-time","description":"Когда элемент перемещён в Корзину","example":"2026-11-05T12:00:00.000Z"},"deletedBy":{"type":"object","description":"Кто удалил элемент","properties":{"id":{"type":"string","description":"id пользователя","example":"62bb25949213f16bcd934450"},"name":{"type":"string","description":"Имя пользователя (или логин, если имя не задано)","example":"Иван Петров"}}},"daysLeft":{"type":"integer","description":"Сколько дней осталось до автоматического окончательного удаления","example":7}}},"StorageTreeNode":{"type":"object","description":"Узел дерева папок","properties":{"id":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"},"name":{"type":"string","description":"Название папки","example":"Договоры 2026"},"children":{"type":"array","description":"Вложенные папки; нет поля — вложенных папок нет","items":{"$ref":"#/components/schemas/StorageTreeNode"}}}},"StorageOk":{"type":"object","properties":{"ok":{"type":"boolean","description":"Операция выполнена","example":true}}},"SmsGatewaySettings":{"type":"object","description":"Подключение своего смс-шлюза (smsc.ru) рабочего пространства. Пароль и ключ API отдаются только администраторам WS при включённом режиме (editable), остальным — только признаки hasPassword/hasApiKey","properties":{"enabled":{"type":"boolean","description":"Режим «Свой СМС шлюз» включён администратором сервиса"},"editable":{"type":"boolean","description":"Пользователь из группы администраторов WS может менять подключение (режим включён)"},"active":{"type":"boolean","description":"Режим включён и подключение заполнено — СМС идут через шлюз пользователя, ПЭП по особой цене"},"freeSms":{"type":"boolean","description":"Включены «Бесплатные СМС» (только при active) — ПЭП не тарифицируются, доступно 9999"},"provider":{"type":"string","description":"Провайдер СМС (сейчас только smsc — smsc.ru); не задан — smsc","example":"smsc"},"login":{"type":"string","description":"Логин аккаунта smsc.ru (нет — не задан)","example":"MD_Orsk"},"senderName":{"type":"string","description":"Имя отправителя; не задано — по умолчанию сервиса"},"hasPassword":{"type":"boolean","description":"Пароль аккаунта smsc.ru сохранён","example":true},"hasApiKey":{"type":"boolean","description":"Ключ API smsc.ru сохранён","example":false},"password":{"type":"string","description":"Пароль аккаунта smsc.ru (расшифрованный) — только при editable и если сохранён"},"apiKey":{"type":"string","description":"Ключ API smsc.ru (расшифрованный) — только при editable и если сохранён"}}},"SignerCabinetIdentity":{"type":"object","description":"Identity подписанта — от чьего имени он подписывает (физлицо, самозанятый, ИП, компания)","properties":{"id":{"type":"string","description":"id identity"},"type":{"type":"string","enum":["person","selfemployed","individual","entity"],"description":"Тип: person — физлицо, selfemployed — самозанятый, individual — ИП, entity — компания"},"name":{"type":"string","description":"Название или ФИО (у компании и ИП — из реестра или сертификата)"},"inn":{"type":"string","description":"ИНН (10 цифр у компании, 12 у ИП, физлица и самозанятого); может отсутствовать у физлица"},"kpp":{"type":"string","description":"КПП компании (из реестра); может отсутствовать"},"confirmed":{"type":"boolean","description":"Подтверждена ли identity УКЭП (компания и ИП — всегда true, добавляются только по УКЭП)"},"confirmedAt":{"type":"string","format":"date-time","description":"Когда identity подтверждена УКЭП"},"ogrn":{"type":"string","description":"ОГРН компании или ОГРНИП предпринимателя"},"address":{"type":"string","description":"Адрес из реестра"},"registryStatus":{"type":"string","description":"Статус в реестре DaData (ACTIVE и т.п.); NOTFOUND — не найдена в реестре, UNAVAILABLE — реестр не ответил"},"ownerName":{"type":"string","description":"ФИО владельца сертификата УКЭП, которым подтверждена identity"},"ownerTitle":{"type":"string","description":"Должность владельца сертификата УКЭП"}}},"SignTabletSettings":{"type":"object","description":"Настройки планшета DataDoc SIGN пользователя (владельца ключа API, по которому подключён планшет)","properties":{"mode":{"type":"string","enum":["lastdocument","multilink"],"description":"lastdocument - последний документ пользователя на подпись «Сигнатурой», multilink - открыть мульти-ссылку","default":"lastdocument","example":"lastdocument"},"multiLinkUrl":{"type":"string","nullable":true,"description":"Мульти-ссылка, которую планшет открывает в режиме multilink (null — ссылка не сохранена)","example":"https://datadoc.ru/ru/sign/AbCdEf/"},"background":{"type":"object","nullable":true,"description":"Подложка главного экрана планшета (публичный адрес файла)","properties":{"url":{"type":"string","description":"Публичный адрес файла подложки на статическом домене (имя меняется при каждой загрузке)","example":"https://static.forma.today/signtablet/65031e7477123beeda27f1e8/65031e7477123beeda27f1e9-1761830000000.jpg"},"type":{"type":"string","enum":["image","video"],"description":"Вид подложки — image (картинка) или video (видео)","example":"image"}}},"backgroundMaxSizeMb":{"type":"number","description":"Максимальный размер файла подложки, МБ","example":10},"backgroundMimetypes":{"type":"array","description":"Допустимые MIME-типы файла подложки","items":{"type":"string","description":"MIME-тип"},"example":["image/jpeg","image/png","image/webp","video/mp4","video/webm"]}}},"SignSettings":{"type":"object","description":"Настройки ПЭП воркспейса в виде для интерфейса","properties":{"sms":{"type":"boolean","description":"Подписание по СМС включено (по умолчанию включено)","example":true},"max":{"type":"boolean","description":"Подписание через MAX включено (и доступно воркспейсу)","example":false},"draw":{"type":"boolean","description":"Подписание «Сигнатурой» (рисунком подписи) включено (и доступно воркспейсу)","example":false},"drawAvailable":{"type":"boolean","description":"«Сигнатура» доступна воркспейсу (задаёт администратор сервиса)","example":true},"drawForbidNoPressure":{"type":"boolean","description":"«Сигнатура»: запрещать подпись без силы нажатия (сервер определяет по точкам рисунка)","example":false},"drawForbidNoGeo":{"type":"boolean","description":"«Сигнатура»: запрещать подпись без геолокации","example":false},"channelChoice":{"type":"boolean","description":"Выбор канала подписания при создании документа (как сохранено)","example":true},"channelChoiceActive":{"type":"boolean","description":"Выбор канала действует — включён и включено больше одного канала","example":false},"changePhone":{"type":"boolean","description":"Подписант может сменить номер телефона на странице подписания (по умолчанию нельзя — номер задаёт отправитель)","example":false},"channels":{"type":"array","description":"Включённые каналы в порядке приоритета (первый — канал по умолчанию)","items":{"type":"string","enum":["sms","max","draw"],"description":"Канал: sms — СМС, max — MAX, draw — «Сигнатура»"},"example":["sms"]},"maxAvailable":{"type":"boolean","description":"Подписание через MAX доступно воркспейсу (задаёт администратор сервиса)","example":true},"editable":{"type":"boolean","description":"Текущий пользователь может менять настройки (администратор воркспейса)","example":true},"tabletAvailable":{"type":"boolean","description":"Доступен «DataDoc SIGN» (подписание на планшете) — показывается блок в профиле","example":false},"cabinetAvailable":{"type":"boolean","description":"Доступно подписание в кабинете подписанта","example":false}}},"NewSharedTemplate":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Договор подряда"},"folderid":{"type":"string","description":"id папки","example":"62bb25949213f16bcd934422"},"description":{"type":"string","description":"Краткое описание шаблона","example":"Это такой классный шаблон, ни у кого такого нет!"},"seo":{"type":"string","description":"HTML для SEO","example":"<some><seo><tags></tags></seo></some>"},"seoName":{"type":"string","description":"Seo имя","example":"Some name"},"showHTML":{"type":"boolean","description":"Показывать контент как HTML","example":true},"keyWords":{"type":"array","description":"Ключевые слова для поиска шаблона (по ним ищут параметры name и query)","items":{"type":"string","description":"Какое-то ключевое слово","example":"Шаблон"}},"hashtags":{"type":"array","description":"Хештеги шаблона (фильтр hashtags в списке общих шаблонов)","items":{"type":"string","description":"Какой-то хештег слово","example":"shablon"}},"categories":{"type":"array","description":"ID категорий общих шаблонов, к которым относится шаблон","items":{"type":"string","description":"ID категории","example":"656f6f0f0178bdbbf63a543c"}}}},"SharedTemplate":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewSharedTemplate"},{"type":"object","properties":{"translatedName":{"type":"string","description":"Translated name","example":"Nazvanie_shablona"}}}]},"TemplatePreviewElement":{"type":"object","description":"Превью (картинка) общего шаблона","properties":{"id":{"type":"string","description":"ID превью","example":"656f1dab11578466cb60025b"},"templateid":{"type":"string","description":"ID шаблона","example":"656dc2f9a601bd9368d77a94"},"position":{"type":"integer","description":"Позиция превью","example":0},"type":{"type":"string","description":"Тип превью","example":"file"},"name":{"type":"string","description":"Название файла","example":"09-37-19.png"},"mimeType":{"type":"string","description":"mime/type файла","example":"image/png"},"size":{"type":"integer","description":"Размер файла","example":531741},"uploadAt":{"type":"string","description":"Дата загрузки файла","example":"2023-12-05T14:05:58.255Z"},"filePath":{"type":"string","description":"Путь к файлу","example":"/home/stingfire/forma_data/previews/656f2e4de1fa947273c3e83e"},"url":{"type":"string","description":"Абсолютный путь к файлу","example":"https://safe.forma.today/previews/6570a11756a24b7c8071f8b4"}}},"TemplateAttachmentElement":{"type":"object","description":"Прикреплённый файл общего шаблона","properties":{"id":{"type":"string","description":"ID превью","example":"656f1dab11578466cb60025b"},"templateid":{"type":"string","description":"ID шаблона","example":"656dc2f9a601bd9368d77a94"},"type":{"type":"string","description":"Тип файла","example":"file"},"name":{"type":"string","description":"Название файла","example":"09-37-19.png"},"mimeType":{"type":"string","description":"mime/type файла","example":"image/png"},"size":{"type":"integer","description":"Размер файла","example":531741},"uploadAt":{"type":"string","description":"Дата загрузки файла","example":"2023-12-05T14:05:58.255Z"},"filePath":{"type":"string","description":"Путь к файлу","example":"/home/stringfire/forma_data/previews/656f2e4de1fa947273c3e83e"},"url":{"type":"string","description":"Абсолютный путь к файлу","example":"http://172.31.1.117:8082/home/stringfire/forma_data/shared_attachments/6570a11756a24b7c8071f8b4"}}},"SharedTemplateRender":{"type":"object","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"sharedtemplateid":{"type":"string","description":"id шаблона","example":"62bb25949213f16bcd934422"},"name":{"type":"string","description":"Название","example":"Договор 203"},"sides":{"type":"array","description":"Стороны версии общего шаблона с заполненными данными переменных","items":{"$ref":"#/components/schemas/TemplateSideWithFilledTattrs"}},"sideValues":{"description":"Значения переменных по сторонам документа","allOf":[{"$ref":"#/components/schemas/TemplateSideValues"}]}}}]},"NewRootSharedFolder":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Имя папки"},"translatedName":{"type":"string","description":"Translated name","example":"Imya_papki"},"description":{"type":"string","description":"Описание","example":"Имя папки"},"keyWords":{"type":"array","description":"Ключевые слова","example":["keyword1","keyword2"]},"seo":{"type":"string","description":"Seo-описание","example":"Some text"},"seoName":{"type":"string","description":"Seo имя","example":"Some name"},"hashtags":{"type":"array","description":"Хэштеги","example":["hashtag1","hashtag2"]},"previews":{"type":"array","description":"Превью папки","items":{"$ref":"#/components/schemas/FolderPreviewElement"}},"categories":{"type":"array","description":"Id категорий","example":["62bb25949213f16bcd934422","62bb25949213f16bcd934422"]}}},"NewChildrenSharedFolder":{"allOf":[{"$ref":"#/components/schemas/NewRootSharedFolder"},{"type":"object","properties":{"parentid":{"type":"string","description":"id родительской папки","example":"62bb25949213f16bcd934422"}}}]},"RootSharedFolder":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewRootSharedFolder"}]},"ChildrenSharedFolder":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewChildrenSharedFolder"},{"type":"object","properties":{"path":{"type":"array","description":"Путь от корня до папки (родительские общие папки по порядку)","items":{"$ref":"#/components/schemas/RootSharedFolder"}}}}]},"FolderPreviewElement":{"allOf":[{"$ref":"#/components/schemas/IdObject"}],"type":"object","properties":{"folderid":{"type":"string","description":"ID папки","example":"656dc2f9a601bd9368d77a94"},"position":{"type":"integer","description":"Позиция превью","example":0},"type":{"type":"string","description":"Тип превью","example":"file"},"name":{"type":"string","description":"Название файла","example":"09-37-19.png"},"mimeType":{"type":"string","description":"mime/type файла","example":"image/png"},"size":{"type":"integer","description":"Размер файла","example":531741},"uploadedAt":{"type":"string","description":"Дата загрузки файла","example":"2023-12-05T14:05:58.255Z"},"filePath":{"type":"string","description":"Путь к файлу","example":"/home/stingfire/forma_data/previews/656f2e4de1fa947273c3e83e"},"url":{"type":"string","description":"Абсолютный путь к файлу","example":"https://safe.forma.today/previews/6570a11756a24b7c8071f8b4"}}},"SettingValue":{"description":"Значение настройки — число, строка или логическое (тип задан у каждой настройки)","oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}],"example":10},"AdminSetting":{"type":"object","description":"Настройка сервиса для экрана администратора","properties":{"key":{"type":"string","description":"Ключ настройки","example":"attachments.maxSizeMb"},"group":{"type":"string","enum":["documents","workspaces","api","uploads","trial","limits","messengers","signature","lkvisibility","storage","links","mail","partners","mailing"],"description":"Группа настройки на экране","example":"documents"},"groupName":{"type":"string","description":"Название группы (ресурс settings.group.<group> на текущем языке)","example":"Документы"},"name":{"type":"string","description":"Название настройки (ресурс settings.<key>.name)","example":"Максимальный размер вложения"},"description":{"type":"string","description":"Пояснение к настройке (ресурс settings.<key>.description)","example":"Размер одного файла вложения документа"},"type":{"type":"string","enum":["number","string","boolean"],"description":"Тип значения","example":"number"},"unit":{"type":"string","enum":["mb","kb","pcs","days","chars","rows"],"description":"Единица измерения (код, экран переводит его) — mb мегабайты, kb килобайты, pcs штуки, days дни, chars символы, rows строки; нет поля — без единицы","example":"mb"},"min":{"type":"number","description":"Минимальное допустимое значение (только для чисел)","example":1},"max":{"type":"number","description":"Максимальное допустимое значение (только для чисел)","example":50},"defaultValue":{"description":"Значение по умолчанию (из кода или окружения), действует, пока администратор его не изменил","allOf":[{"$ref":"#/components/schemas/SettingValue"}]},"value":{"description":"Действующее значение; у секрета — расшифрованное значение (\"\" — не задан)","allOf":[{"$ref":"#/components/schemas/SettingValue"}]},"isDefault":{"type":"boolean","description":"Действует значение по умолчанию (администратор не менял)","example":true},"secret":{"type":"boolean","description":"Настройка-секрет (токен, ключ) — хранится зашифрованной, в журнал попадает только маска ***; нет поля — не секрет","example":true},"isSet":{"type":"boolean","description":"Только для секрета — значение задано","example":false},"public":{"type":"boolean","description":"Значение отдаётся клиентам без авторизации (GET /settingspublic)","example":true},"updatedAt":{"type":"string","format":"date-time","description":"Когда администратор последний раз менял значение (нет поля — не менял)","example":"2026-11-01T10:00:00.000Z"}}},"SettingResult":{"type":"object","description":"Результат изменения или сброса настройки","properties":{"key":{"type":"string","description":"Ключ настройки","example":"attachments.maxSizeMb"},"value":{"description":"Новое действующее значение (у секрета — сохранённое значение)","allOf":[{"$ref":"#/components/schemas/SettingValue"}]},"isDefault":{"type":"boolean","description":"true — после сброса действует значение по умолчанию","example":false},"isSet":{"type":"boolean","description":"Только для секрета — значение задано","example":true}}},"SettingLog":{"type":"object","description":"Запись журнала изменений настроек","properties":{"id":{"type":"string","description":"id записи","example":"62bb25949213f16bcd934427"},"key":{"type":"string","description":"Ключ настройки","example":"attachments.maxSizeMb"},"reset":{"type":"boolean","description":"true — сброс к значению по умолчанию, false — изменение","example":false},"oldValue":{"description":"Прежнее действующее значение (у секрета — *** или \"\")","allOf":[{"$ref":"#/components/schemas/SettingValue"}]},"newValue":{"description":"Новое действующее значение (у секрета — ***)","allOf":[{"$ref":"#/components/schemas/SettingValue"}]},"uid":{"type":"string","description":"id администратора, который изменил настройку","example":"62bb25949213f16bcd934423"},"login":{"type":"string","description":"Логин администратора","example":"vm@datadoc.ru"},"createdAt":{"type":"string","format":"date-time","description":"Время изменения","example":"2026-11-01T10:00:00.000Z"}}},"ResourceId":{"type":"object","properties":{"id":{"type":"string","description":"id ресурса","example":"validation.id.empty"},"lang":{"type":"string","description":"Язык","example":"ru"}}},"UpdateResource":{"type":"object","properties":{"value":{"type":"string","description":"Значение","example":"Значение ресурса"}}},"Resource":{"allOf":[{"$ref":"#/components/schemas/ResourceId"},{"$ref":"#/components/schemas/UpdateResource"}]},"Key":{"type":"object","properties":{"key":{"type":"string","description":"Ключ для авторизации","example":"37b6cf33c50bd42ca0d93e252ddb2a61"}}},"TemplateRenderSignatureStatus":{"type":"string","description":"Статус подписи: TO_SIGN — ожидает подписи, SINGLE_SIGNED — подписан одной стороной, PUBLISHED — опубликован для подписания второй стороной, DOUBLE_SIGNED — подписан обеими сторонами, REJECTED — отказ в подписании, EDO_PUBLISHED — отправлен через ЭДО, EDO_DOUBLE_SIGNED — подписан обеими сторонами через ЭДО","enum":["TO_SIGN","SINGLE_SIGNED","PUBLISHED","DOUBLE_SIGNED","REJECTED","EDO_PUBLISHED","EDO_DOUBLE_SIGNED"],"example":"SINGLE_SIGNED"},"TemplateRenderSignatureType":{"type":"string","description":"Тип подписи: simple — ПЭП, qualified — УКЭП, edo — через ЭДО","enum":["simple","qualified","edo"],"example":"qualified"},"TemplateRenderSideSignature":{"type":"object","description":"Подпись одной стороны документа (ПЭП, УКЭП или ЭДО)","allOf":[{"type":"object","properties":{"type":{"$ref":"#/components/schemas/TemplateRenderSignatureType"},"signerName":{"type":"string","description":"ФИО подписанта второй стороны","example":"Иванов Иван Иванович"},"signerPhone":{"type":"string","description":"Телефон подписанта второй стороны","example":79999999999},"smsCode":{"type":"string","description":"Код из СМС","example":123456},"smsId":{"type":"string","description":"id транзакции","example":123},"mchd":{"description":"Машиночитаемая доверенность (МЧД), по которой подписана сторона","allOf":[{"$ref":"#/components/schemas/Mchd"},{"type":"object","properties":{"uid":{"type":"string","description":"id пользователя","example":"62bb25949213f16bcd934422"}}}]},"signedAt":{"type":"string","description":"Дата подписи","example":"2022-07-16T13:10:43.284+00:00"},"signerType":{"type":"string","description":"Тип подписанта","example":"entity"}}},{"$ref":"#/components/schemas/QualifiedSignatureWithoutMchdGuid"}]},"TemplateRenderSignature":{"type":"object","description":"Подписи документа обеими сторонами; нет, если подписание не начиналось","properties":{"status":{"$ref":"#/components/schemas/TemplateRenderSignatureStatus"},"readAt":{"type":"string","description":"Дата прочтения документа внешним подписантом","example":"2022-07-16T13:10:43.284+00:00"},"publishedAt":{"type":"string","description":"Дата публикации документа для подписания внешней стороной","example":"2022-07-16T13:10:43.284+00:00"},"primary":{"description":"Подпись первой стороны (владельца документа)","allOf":[{"$ref":"#/components/schemas/TemplateRenderSideSignature"}]},"counter":{"description":"Подпись второй стороны (контрагента, внешнего подписанта)","allOf":[{"$ref":"#/components/schemas/TemplateRenderSideSignature"}]}}},"TemplateRenderFull":{"type":"object","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 203"},"template":{"description":"Шаблон, по которому создан документ","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Шаблон договора"}}}]},"pack":{"description":"Пакет шаблонов, в составе которого создан документ (нет, если документ создан не из пакета)","allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Пакет договоров"}}}]},"createdAt":{"type":"string","description":"Дата и время создания документа","example":"2022-07-16T13:10:43.284+00:00"},"sides":{"type":"array","description":"Стороны версии шаблона документа с заполненными данными переменных","items":{"$ref":"#/components/schemas/TemplateSideWithFilledTattrs"}},"blocksTree":{"$ref":"#/components/schemas/TemplateBlocksTree"},"sideValues":{"type":"array","description":"Значения переменных по сторонам документа","items":{"allOf":[{"$ref":"#/components/schemas/TemplateSideValue"},{"type":"object","properties":{"counteragentname":{"type":"string","description":"Наименование контрагента","example":"Вектор"}}}]}},"creator":{"description":"Пользователь, создавший документ","allOf":[{"$ref":"#/components/schemas/User"}]},"owner":{"description":"Владелец документа (ответственный пользователь)","allOf":[{"$ref":"#/components/schemas/User"}]},"confirmer":{"description":"Пользователь, подтвердивший документ (нет, если не подтверждён)","allOf":[{"$ref":"#/components/schemas/User"}]},"confirmed":{"type":"boolean","description":"Флаг подписи","example":true},"confirmedAt":{"type":"string","description":"Дата и время подписи","example":"2022-07-16T13:10:43.284+00:00"},"signature":{"$ref":"#/components/schemas/TemplateRenderSignature"},"edited":{"type":"boolean","description":"Документ изменён пользователем в предпросмотре (editedHtml); сам HTML — GET /renders/{id}/editeddocument","example":false},"urlKey":{"type":"string","description":"URL-ключ для внешнего доступа","example":"dFsAff"}}}]},"PromocodeType":{"type":"string","enum":["discountPercent","discountBasePercent","discountAmount","tariff","trialProlong"],"description":"Тип","example":"discountPercent"},"NewPromocode":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/PromocodeType"},"reusable":{"type":"boolean","description":"Возможность использовать несколько раз в одном wid","example":false},"usesCount":{"type":"integer","description":"Счетчик использований","example":1},"usesLimit":{"type":"integer","description":"Лимит использований","example":100},"description":{"type":"string","description":"Описание","example":"Этот промокод предоставляет скидку 30%"},"dtFrom":{"type":"string","description":"Дата начала периода возможной активации","example":"2023-01-01T12:00:00.000+00:00"},"dtTo":{"type":"string","description":"Дата окончания периода возможной активации","example":"2024-01-01T12:00:00.000+00:00"},"discountPercent":{"type":"number","description":"Размер скидки в процентах","example":30},"discountAmount":{"type":"number","description":"Размер скидки в рублях","example":1000},"patternId":{"type":"string","description":"id паттерна","example":"tariff_business_30"},"trialProlongDays":{"type":"integer","description":"число дней пролонгации","example":10}}},"PromocodeId":{"type":"object","properties":{"id":{"type":"string","description":"Id промокода","example":"discount_30"}}},"Promocode":{"allOf":[{"$ref":"#/components/schemas/PromocodeId"},{"$ref":"#/components/schemas/NewPromocode"}]},"NewCategory":{"properties":{"name":{"type":"string","description":"Название категории","example":"Ноутбуки"}}},"Category":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewCategory"}]},"BaseProduct":{"properties":{"propertyValues":{"type":"object","description":"Значения свойств","additionalProperties":{"type":"string","description":"Значение свойства","example":"Значение"},"example":{"unit":"шт","675ebff2e66e906b75158dd7":"Значение"}}}},"NewProduct":{"allOf":[{"$ref":"#/components/schemas/BaseProduct"},{"type":"object","properties":{"category":{"type":"string","description":"Название категории","example":"Ноутбуки"}}}]},"Product":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/BaseProduct"},{"type":"object","properties":{"category":{"description":"Категория продукта (id и название)","allOf":[{"$ref":"#/components/schemas/Category"}]},"externalId":{"type":"string","description":"ID объекта во внешней системе","example":39287331},"externalType":{"type":"string","description":"Тип объекта во внешней системе","example":"yclientsGood"}}}]},"NewProductProperty":{"properties":{"name":{"type":"string","description":"Название свойства","example":"Цвет"},"type":{"type":"string","description":"Тип свойства","example":"string"}}},"ProductProperty":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewProductProperty"}]},"PrerenderId":{"type":"object","properties":{"id":{"type":"string","description":"id пререндера","example":12345}}},"NewPrerender":{"type":"object","properties":{"templateId":{"type":"string","description":"ID шаблона","example":"64d5e8685186ca28a0567747"},"sideValues":{"$ref":"#/components/schemas/TemplateSideValues"}}},"Prerender":{"allOf":[{"$ref":"#/components/schemas/PrerenderId"},{"$ref":"#/components/schemas/NewPrerender"},{"type":"object","properties":{"ocrPackages":{"description":"Пакеты распознавания (OCR), которыми заполняются группы переменных сторон","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"id пакета распознавания","example":41946},"sideId":{"type":"string","description":"id стороны для заполнения распознанными данными","example":"sideOne"},"tattrFolderId":{"type":"string","description":"id группы переменных для заполнения распознанными данными","example":100},"status":{"type":"string","description":"Статус распознавания","enum":["IN_PROGRESS","COMPLETED","FAILED"],"example":"COMPLETED"}}}},"createdAt":{"type":"string","description":"Дата и время создания пререндера","example":"2024-12-04T20:42:10.687+00:00"}}}]},"PartnerReferralTariff":{"type":"object","description":"Краткие данные тарифа (название и срок)","properties":{"name":{"type":"string","description":"Название экземпляра тарифа","example":"Команда месяц"},"duration":{"type":"integer","description":"Срок тарифа, дней","example":30}}},"PartnerReferral":{"type":"object","description":"Реферал — рабочее пространство, применившее промокод рекрутера","properties":{"wid":{"type":"string","description":"id рабочего пространства реферала","example":"62bb25949213f16bcd934424"},"registeredAt":{"type":"string","format":"date-time","description":"Дата регистрации (создания рабочего пространства)","example":"2026-09-01T10:00:00.000Z"},"promoAppliedAt":{"type":"string","format":"date-time","description":"Дата первого применения промокода","example":"2026-09-01T10:05:00.000Z"},"promoUsed":{"type":"boolean","description":"true — промокод был использован (применён к оплате) хотя бы в одном применении","example":true},"companyName":{"type":"string","nullable":true,"description":"Наименование организации из реквизитов (null — не заполнено)","example":"ООО «Ромашка»"},"inn":{"type":"string","nullable":true,"description":"ИНН из реквизитов (null — не заполнен)","example":"7707083893"},"ownerEmailMasked":{"type":"string","nullable":true,"description":"E-mail владельца с маской (первая буква и домен; null — владельца нет)","example":"v***@datadoc.ru"},"emailConfirmed":{"type":"boolean","description":"true — владелец подтвердил e-mail","example":true},"demo":{"type":"object","description":"Запись владельца на демонстрацию (таймслоты)","properties":{"booked":{"type":"boolean","description":"true — владелец записывался на демонстрацию","example":false},"at":{"type":"string","format":"date-time","nullable":true,"description":"Дата последней записи (null — записи нет)","example":null}}},"tariff":{"type":"object","nullable":true,"description":"Последний начавшийся неотменённый экземпляр тарифа (null — тарифов нет)","properties":{"id":{"type":"string","description":"id тарифа","example":"tariff_team"},"name":{"type":"string","description":"Название экземпляра тарифа","example":"Команда месяц"},"duration":{"type":"integer","description":"Срок, дней","example":30},"dtFrom":{"type":"string","format":"date-time","description":"Начало действия","example":"2026-10-01T00:00:00.000Z"},"dtTo":{"type":"string","format":"date-time","description":"Окончание действия","example":"2026-10-31T20:59:59.999Z"},"isPaid":{"type":"boolean","description":"true — тариф оплачен полностью и не пробный","example":true},"isTrial":{"type":"boolean","description":"true — пробный тариф","example":false}}},"firstPaymentAt":{"type":"string","format":"date-time","nullable":true,"description":"Дата первой оплаты картой или по счёту (null — оплат не было)","example":"2026-10-01T10:00:00.000Z"},"paidTotal":{"type":"number","description":"Сумма всех оплат картой и по счетам, руб.","example":9900},"lastActivityAt":{"type":"string","format":"date-time","nullable":true,"description":"Время последнего действия пользователей рабочего пространства (null — нет данных)","example":"2026-11-05T15:00:00.000Z"}}},"PartnerReferralDetails":{"description":"Карточка реферала — данные списка плюс счета, оплаты и счётчики использования","allOf":[{"$ref":"#/components/schemas/PartnerReferral"},{"type":"object","properties":{"invoices":{"type":"array","description":"Бухгалтерские документы (счета) реферала по убыванию даты","items":{"type":"object","properties":{"id":{"type":"string","description":"id документа","example":"62bb25949213f16bcd934428"},"date":{"type":"string","format":"date-time","description":"Дата документа","example":"2026-10-01T10:00:00.000Z"},"amount":{"type":"number","description":"Сумма, руб.","example":9900},"onecStatus":{"type":"string","nullable":true,"description":"Статус в 1С (PAID — оплачен; null — нет статуса)","example":"PAID"},"sourceType":{"type":"string","description":"За что выставлен счёт (tariffInstance, externalInfillEntity, signatureRequest, ocrRequest и др.)","example":"tariffInstance"},"tariff":{"description":"Тариф счёта (только для sourceType=tariffInstance)","allOf":[{"$ref":"#/components/schemas/PartnerReferralTariff"}]}}}},"cardAttempts":{"type":"array","description":"Попытки оплаты картой (транзакции эквайринга)","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"Дата оплаты или создания транзакции","example":"2026-10-01T10:00:00.000Z"},"amount":{"type":"number","description":"Сумма, руб.","example":9900},"status":{"type":"string","description":"paid — оплачено; pending — не оплачено","enum":["paid","pending"],"example":"paid"},"tariff":{"description":"Оплачиваемый тариф (нет поля — не найден)","allOf":[{"$ref":"#/components/schemas/PartnerReferralTariff"}]}}}},"payments":{"type":"array","description":"Оплаты (картой и по оплаченным счетам) по возрастанию даты","items":{"type":"object","properties":{"id":{"type":"string","description":"id транзакции или документа","example":"62bb25949213f16bcd934423"},"source":{"type":"string","description":"card — картой; invoice — по счёту","enum":["card","invoice"],"example":"card"},"date":{"type":"string","format":"date-time","description":"Дата оплаты","example":"2026-10-01T10:00:00.000Z"},"amount":{"type":"number","description":"Сумма, руб.","example":9900},"isFirstPayment":{"type":"boolean","description":"true — первая оплата реферала","example":true},"refunded":{"type":"boolean","description":"true — полный возврат (частичный виден по refundedAmount меньше amount)","example":false},"refundedAmount":{"type":"number","description":"Сумма возврата, руб. (по счетам всегда 0)","example":0},"skuCode":{"type":"string","nullable":true,"description":"Код услуги 1С (null — не определена)","example":"00-00001002"},"skuName":{"type":"string","nullable":true,"description":"Название услуги 1С (null — не определена)","example":"Доступ к личному кабинету по тарифу «Команда» на 30 дней"},"isTariff":{"type":"boolean","description":"true — оплата тарифа","example":true},"amountNoVat":{"type":"number","description":"Сумма без НДС, руб. (платформа не хранит НДС оплаты — равна amount)","example":9900},"vatAmount":{"type":"number","nullable":true,"description":"Сумма НДС (всегда null — не хранится)","example":null}}}},"usersCount":{"type":"integer","description":"Число пользователей рабочего пространства","example":3},"invitedAnyone":{"type":"boolean","description":"true — пригласили хотя бы одного пользователя (пользователей больше одного)","example":true},"templatesActive":{"type":"integer","description":"Число неудалённых шаблонов","example":5},"templatesRequestedSetup":{"type":"object","description":"Заявки на настройку шаблонов","properties":{"requested":{"type":"boolean","description":"true — заявки были","example":true},"count":{"type":"integer","description":"Число заявок","example":2}}},"documentsCreated":{"type":"integer","description":"Число созданных документов","example":40},"signatureRequestsCount":{"type":"integer","description":"Число покупок пакетов подписей (заявок на увеличение лимита подписей)","example":1},"ocrRequestsCount":{"type":"integer","description":"Число запросов распознавания (OCR)","example":0}}}]},"PartnerRates":{"type":"object","description":"Действующие ставки вознаграждения рекрутера (индивидуальные или общие из настроек сервиса)","properties":{"tariff":{"type":"number","description":"Ставка за оплаты тарифов, %","example":20},"other":{"type":"number","description":"Ставка за оплаты прочих услуг, %","example":10}}},"PartnerSummary":{"type":"object","description":"Сводка рекрутера партнёрской программы","properties":{"promocode":{"type":"string","description":"id партнёрского промокода рекрутера (создаётся при первом обращении)","example":"62bb25949213f16bcd934422"},"registrationUrl":{"type":"string","description":"Ссылка на регистрацию по промокоду рекрутера","example":"https://lk.datadoc.ru/registration/62bb25949213f16bcd934422/"},"available":{"type":"number","description":"Доступно к выводу, руб. — вознаграждение после срока удержания минус заявки на вывод (кроме отклонённых), не меньше 0","example":1500},"hold":{"type":"number","description":"Вознаграждение на удержании (срок holdDays с оплаты ещё не прошёл), руб.","example":300},"withdrawn":{"type":"number","description":"Выплачено по заявкам в статусе paid, руб.","example":5000},"turnover":{"type":"number","description":"Сумма оплат рефералов, попавших в условия программы, руб.","example":65000},"rewardTotal":{"type":"number","description":"Всё начисленное вознаграждение (доступное до вывода и на удержании), руб.","example":6800},"registrations":{"type":"integer","description":"Число рефералов — рабочих пространств, применивших промокод рекрутера","example":14},"rates":{"$ref":"#/components/schemas/PartnerRates"},"rules":{"type":"object","description":"Общие правила программы (настройки сервиса, группа partners)","properties":{"scope":{"type":"string","description":"Какие оплаты реферала вознаграждаются. all — все; days — в течение scopeDays дней с регистрации; first — только первая","enum":["all","days","first"],"example":"all"},"scopeDays":{"type":"integer","description":"Срок в днях с регистрации реферала для scope=days","example":365},"holdDays":{"type":"integer","description":"Срок удержания вознаграждения с даты оплаты, дней","example":14},"minWithdraw":{"type":"number","description":"Минимальная сумма заявки на вывод, руб.","example":1000}}},"blocked":{"type":"boolean","description":"true — рекрутер заблокирован администратором (своя страница и вывод недоступны)","example":false}}},"PartnerTransaction":{"type":"object","description":"Оплата реферала и вознаграждение по ней (рассчитывается по текущим правилам, кэш 60 секунд)","properties":{"id":{"type":"string","description":"id оплаты (транзакции эквайринга или бухгалтерского документа)","example":"62bb25949213f16bcd934423"},"source":{"type":"string","description":"Источник оплаты. card — картой (эквайринг); invoice — по счёту (оплачен в 1С)","enum":["card","invoice"],"example":"card"},"referralWid":{"type":"string","description":"id рабочего пространства реферала","example":"62bb25949213f16bcd934424"},"companyName":{"type":"string","nullable":true,"description":"Наименование организации реферала из реквизитов (null — не заполнено)","example":"ООО «Ромашка»"},"description":{"type":"string","description":"Название услуги 1С (пустая строка — не определена)","example":"Доступ к личному кабинету по тарифу «Команда» на 30 дней"},"isTariff":{"type":"boolean","description":"true — оплата тарифа (ставка tariff), false — прочей услуги (ставка other)","example":true},"amount":{"type":"number","description":"Сумма оплаты за вычетом частичного возврата, руб.","example":9900},"percent":{"type":"number","description":"Применённая ставка, % (0 — оплата вне условий программы)","example":20},"reward":{"type":"number","description":"Вознаграждение, руб. — ставка от суммы без НДС","example":1650},"inScope":{"type":"boolean","description":"true — оплата попадает в условия программы (scope)","example":true},"paidAt":{"type":"string","format":"date-time","description":"Дата оплаты","example":"2026-10-01T10:00:00.000Z"},"availableAt":{"type":"string","format":"date-time","description":"Дата, с которой вознаграждение доступно к выводу (дата оплаты плюс holdDays)","example":"2026-10-15T10:00:00.000Z"}}},"PartnerWithdrawal":{"type":"object","description":"Заявка рекрутера на выплату вознаграждения (только ООО или ИП)","properties":{"id":{"type":"string","description":"id заявки","example":"62bb25949213f16bcd934425"},"wid":{"type":"string","description":"id рабочего пространства рекрутера","example":"62bb25949213f16bcd934422"},"uid":{"type":"string","description":"id пользователя, создавшего заявку","example":"62bb25949213f16bcd934426"},"amount":{"type":"number","description":"Сумма к выплате, руб.","example":1500},"entityType":{"type":"string","description":"Тип получателя. ooo — ООО; ip — индивидуальный предприниматель","enum":["ooo","ip"],"example":"ooo"},"company":{"type":"string","description":"Наименование получателя по данным DaData","example":"ООО «Ромашка»"},"inn":{"type":"string","description":"ИНН получателя (10 или 12 цифр)","example":"7707083893"},"status":{"type":"string","description":"Статус заявки. new — новая; processing — в работе; paid — выплачена; rejected — отклонена (сумма возвращается в доступное)","enum":["new","processing","paid","rejected"],"example":"new"},"comment":{"type":"string","description":"Комментарий администратора (например, причина отклонения)","example":"Неверные реквизиты"},"createdAt":{"type":"string","format":"date-time","description":"Время создания заявки","example":"2026-11-01T10:00:00.000Z"},"processedAt":{"type":"string","format":"date-time","description":"Время последнего изменения статуса администратором","example":"2026-11-02T10:00:00.000Z"},"processedBy":{"type":"string","description":"id администратора, изменившего статус","example":"62bb25949213f16bcd934427"}}},"NewPack":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Пакет договоров"},"sides":{"type":"array","description":"Стороны пакета шаблонов","items":{"type":"object","properties":{"id":{"type":"string","description":"id стороны","example":"zakazchik"},"name":{"type":"string","description":"Название стороны","example":"Заказчик"}}}},"templates":{"type":"array","description":"Шаблоны, входящие в пакет","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"sideIndices":{"type":"array","description":"Индексы соответствия сторон шаблона и сторон пакета","items":{"type":"integer","example":1}}}}]}}}},"Pack":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewPack"},{"type":"object","properties":{"createdAt":{"type":"string","description":"Дата и время создания пакета","example":"2025-10-29T08:22:21.349Z"}}}]},"PackWithPath":{"allOf":[{"$ref":"#/components/schemas/Pack"},{"type":"object","properties":{"templates":{"type":"array","description":"Шаблоны, входящие в пакет","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"sideIndices":{"type":"array","description":"Индексы соответствия сторон шаблона и сторон пакета","items":{"type":"integer","example":1}},"name":{"type":"string","description":"Название стороны","example":"Договор подряда"},"path":{"type":"array","description":"Путь к данному шаблону","items":{"$ref":"#/components/schemas/RootPath"}}}}]}}}}]},"MchdGuid":{"type":"object","properties":{"guid":{"type":"string","description":"GUID МЧД","example":"d4158e30-f9da-496e-9fe4-bc10edd44ff2"}}},"Mchd":{"allOf":[{"$ref":"#/components/schemas/MchdGuid"},{"type":"object","properties":{"checkUrl":{"type":"string","description":"URL для проверки МЧД","example":"https://m4d.nalog.gov.ru/EMCHD/check-status?guid=d4158e30-f9da-496e-9fe4-bc10edd44ff2"},"agentFullName":{"type":"string","description":"ФИО доверенного лица","example":"Иванов Иван Иванович"},"agentInn":{"type":"string","description":"ИНН доверенного лица","example":1234567890},"principalCompanyName":{"type":"string","description":"Наименование организации доверителя","example":"ООО Умные документы"},"principalCompanyInn":{"type":"string","description":"ИНН организации доверителя","example":1234567890},"issuedOn":{"type":"string","description":"Дата выдачи доверенности","example":"2025-02-20"},"expiresOn":{"type":"string","description":"Дата окончания срока действия доверенности","example":"2025-02-20"},"description":{"type":"string","description":"Описание доверенности","example":"Иванов Иван Иванович | ИНН 1234567890 по доверенности d4158e30-f9da-496e-9fe4-bc10edd44ff2 | выдана 01.08.2025 | действует до 31.12.2025 | ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"УМНЫЕ ДОКУМЕНТЫ\" | ИНН 1234567890"},"fileId":{"type":"string","description":"id файла","example":"ON_EMCHD_20250220_d4158e30-f9da-496e-9fe4-bc10edd44ff2"}}}]},"NewManager":{"properties":{"fullName":{"type":"string","description":"ФИО менеджера","example":"Зинин Александр Александрович"},"amocrmId":{"type":"integer","description":"id менеджера в amoCRM","example":1231234}}},"Manager":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewManager"},{"type":"object","properties":{"avatarUrl":{"type":"string","description":"URL аватара","example":"https://safe.forma.today/managers/avatars/64d0e03512ddeea1afc0147b.jpg"}}}]},"MailingRecipientType":{"type":"string","description":"Тип получателей по тарифам рабочих пространств. activePaid — сейчас действует платный тариф; activeTrial — сейчас действует пробный (или выданный бесплатно) тариф и нет платного; paidStopped — платный тариф был, сейчас не действует ни один платный; trialEnded — был пробный, оплат не было, пробный сейчас не действует","enum":["activePaid","activeTrial","paidStopped","trialEnded"],"example":"activePaid"},"MailingDomain":{"type":"string","description":"Домен адреса отправителя. data-docs.ru — отправка резервной парой ключей RuSender, datadoc.ru — основной парой","enum":["data-docs.ru","datadoc.ru"],"example":"data-docs.ru"},"MailingRecipientsBody":{"type":"object","properties":{"recipientTypes":{"type":"array","description":"Типы получателей (по тарифам рабочих пространств); пустой массив — получателей нет","items":{"$ref":"#/components/schemas/MailingRecipientType"},"example":["activePaid","activeTrial"]},"allUsers":{"type":"boolean","description":"true — все пользователи рабочего пространства, false (по умолчанию) — только владелец","default":false,"example":false},"createdFrom":{"type":"string","nullable":true,"description":"Дата создания рабочего пространства «с», YYYY-MM-DD включительно (московское время); пустая строка или null — без ограничения","example":"2026-01-01"},"createdTo":{"type":"string","nullable":true,"description":"Дата создания рабочего пространства «по», YYYY-MM-DD включительно (московское время); пустая строка или null — без ограничения","example":"2026-10-31"}}},"MailingEmailBody":{"type":"object","properties":{"subject":{"type":"string","maxLength":200,"description":"Тема письма (до 200 символов, без управляющих символов; эмодзи допустимы)","example":"Новые возможности DataDoc"},"domain":{"$ref":"#/components/schemas/MailingDomain"},"fromLocal":{"type":"string","maxLength":64,"description":"Часть адреса отправителя до «@» — латинские буквы, цифры, дефис и точка (не по краям и не две подряд)","example":"hello"},"fromName":{"type":"string","maxLength":100,"description":"Имя отправителя (до 100 символов, без управляющих символов)","example":"Команда DataDoc"},"html":{"type":"string","maxLength":500000,"description":"Тело письма из редактора (без шапки и подвала писем DataDoc), до 500000 символов. Допустимы теги p, div, h1–h3, strong, b, em, i, u, s, ul, ol, li, a (class=\"button\" — кнопка), img, br, span; переменная имени получателя — span data-var=\"user_name\" с текстом по умолчанию в data-fallback","example":"<p>Здравствуйте, <span data-var=\"user_name\" data-fallback=\"Уважаемый пользователь\">Имя</span>!</p>"}}},"MailingSaveBody":{"description":"Поля черновика рассылки; все поля необязательные, переданные заменяют сохранённые (null у дат — очистить)","allOf":[{"$ref":"#/components/schemas/MailingEmailBody"},{"$ref":"#/components/schemas/MailingRecipientsBody"}]},"Mailing":{"type":"object","description":"Рассылка админки","properties":{"id":{"type":"string","description":"id рассылки","example":"62bb25949213f16bcd934422"},"subject":{"type":"string","description":"Тема письма (пустая строка — не задана)","example":"Новые возможности DataDoc"},"domain":{"$ref":"#/components/schemas/MailingDomain"},"fromLocal":{"type":"string","description":"Часть адреса отправителя до «@» (по умолчанию hello)","example":"hello"},"fromName":{"type":"string","description":"Имя отправителя (пустая строка — не задано)","example":"Команда DataDoc"},"html":{"type":"string","description":"Тело письма из редактора (без шапки и подвала)","example":"<p>Здравствуйте!</p>"},"recipientTypes":{"type":"array","description":"Типы получателей","items":{"$ref":"#/components/schemas/MailingRecipientType"},"example":["activePaid"]},"allUsers":{"type":"boolean","description":"true — все пользователи рабочего пространства, false — только владелец","example":false},"createdFrom":{"type":"string","description":"Дата создания рабочего пространства «с», YYYY-MM-DD (пустая строка или нет поля — без ограничения)","example":"2026-01-01"},"createdTo":{"type":"string","description":"Дата создания рабочего пространства «по», YYYY-MM-DD (пустая строка или нет поля — без ограничения)","example":"2026-10-31"},"status":{"type":"string","description":"Статус. draft — черновик (можно править); inProgress — идёт отправка; paused — приостановлена ответом RuSender (ключ, баланс, лимит, недоступность); stopped — остановлена администратором; completed — отправлена всем адресам","enum":["draft","inProgress","paused","stopped","completed"],"example":"draft"},"recipientsCount":{"type":"integer","description":"Число адресов, зафиксированных при запуске","example":120},"sentCount":{"type":"integer","description":"Число отправленных писем","example":118},"failedCount":{"type":"integer","description":"Число адресов, на которые письмо не ушло","example":2},"pauseStatus":{"type":"integer","description":"HTTP-статус ответа RuSender, из-за которого отправка приостановлена (0 — сетевая ошибка; нет поля — не на паузе)","example":402},"pauseError":{"type":"string","description":"Текст ошибки RuSender, из-за которой отправка приостановлена","example":"402: Insufficient balance"},"startedAt":{"type":"string","format":"date-time","description":"Время запуска","example":"2026-11-01T10:00:00.000Z"},"finishedAt":{"type":"string","format":"date-time","description":"Время завершения или остановки","example":"2026-11-01T12:00:00.000Z"},"createdBy":{"type":"string","description":"id администратора, создавшего рассылку","example":"62bb25949213f16bcd934423"},"createdAt":{"type":"string","format":"date-time","description":"Время создания","example":"2026-10-31T09:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Время последнего изменения","example":"2026-11-01T12:00:00.000Z"}}},"MailingRecipient":{"type":"object","description":"Адрес рассылки в журнале отправки (список фиксируется при запуске)","properties":{"id":{"type":"string","description":"id записи журнала","example":"62bb25949213f16bcd934424"},"mailingId":{"type":"string","description":"id рассылки","example":"62bb25949213f16bcd934422"},"email":{"type":"string","description":"Адрес получателя (в нижнем регистре)","example":"vm@datadoc.ru"},"name":{"type":"string","description":"Имя получателя для переменной user_name (пустая строка — имени нет)","example":"Иван"},"wid":{"type":"string","description":"id рабочего пространства получателя","example":"62bb25949213f16bcd934425"},"status":{"type":"string","description":"Статус отправки. pending — ожидает; sent — отправлено; failed — не отправлено","enum":["pending","sent","failed"],"example":"sent"},"error":{"type":"string","description":"Ошибка RuSender (статус и текст); нет поля — ошибки не было","example":"400: Invalid email"},"attempts":{"type":"integer","description":"Число попыток отправки","example":1},"sentAt":{"type":"string","format":"date-time","description":"Время отправки","example":"2026-11-01T10:05:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Время последнего изменения записи","example":"2026-11-01T10:05:00.000Z"}}},"LegalDocumentHtml":{"type":"object","description":"Тело документа (HTML) по языкам сайта; пустое английское тело — показывается русское","properties":{"ru":{"type":"string","description":"Тело документа на русском (HTML; очищается на сервере)","example":"<h1 style=\"text-align:center\">Публичная оферта</h1><p>Текст</p>"},"en":{"type":"string","description":"Тело документа на английском (HTML; пустая строка — на английской версии сайта показывается русское тело)","example":""}}},"NewLegalDocument":{"type":"object","properties":{"name":{"type":"string","description":"Название документа","example":"Тестовый юридический документ"},"slug":{"type":"string","description":"Адрес страницы на сайте (/<язык>/<slug>/). Строчные латинские буквы и цифры, слова через «-» или «_». Не указан — транслит названия","example":"testovii-yuridicheskii-dokument"},"html":{"$ref":"#/components/schemas/LegalDocumentHtml"},"published":{"type":"boolean","description":"Опубликован (показывается на сайте)","example":true},"order":{"type":"integer","description":"Порядок в списке","example":0}}},"LegalDocument":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewLegalDocument"},{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","description":"Дата и время создания документа","example":"2026-10-30T10:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Дата и время последнего изменения документа","example":"2026-10-30T10:00:00.000Z"}}}]},"FolderTemplate":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Договор подряда"},"translatedName":{"type":"string","description":"Название транслитерацией для ЧПУ","example":"Shablon"},"favorite":{"type":"boolean","description":"Флаг добавления в избранное","example":false},"ai":{"type":"boolean","description":"Флаг генерации с помощью ИИ","example":true}}}]},"TemplateType":{"type":"object","properties":{"type":{"type":"string","description":"Тип","example":"template"}}},"FolderType":{"type":"object","properties":{"type":{"type":"string","description":"Тип","example":"folder"}}},"NewRootFolder":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Имя папки"},"favorite":{"type":"boolean","description":"Флаг добавления в избранное","example":false},"adminAccessOnly":{"type":"boolean","description":"Флаг административного доступа","example":true},"groups":{"type":"array","description":"Список групп, которые видят папку","items":{"type":"string","example":"62bb25949213f16bcd934422"}}}},"NewChildFolder":{"allOf":[{"$ref":"#/components/schemas/NewRootFolder"},{"type":"object","properties":{"parentid":{"type":"string","description":"id родительской папки","example":"62bb25949213f16bcd934422"}}}]},"RootFolder":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewRootFolder"},{"type":"object","properties":{"translatedName":{"type":"string","description":"Название транслитерацией для ЧПУ","example":"Papka"}}}]},"ChildFolder":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewChildFolder"},{"type":"object","properties":{"translatedName":{"type":"string","description":"Название транслитерацией для ЧПУ","example":"Papka"}}}]},"RootFolderOrTemplate":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/RootFolder"},{"$ref":"#/components/schemas/FolderType"}]},{"allOf":[{"$ref":"#/components/schemas/FolderTemplate"},{"$ref":"#/components/schemas/TemplateType"}]}]},"RootFolderOrTemplateTree":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/RootFolder"},{"$ref":"#/components/schemas/FolderType"},{"type":"object","properties":{"children":{"type":"array","description":"Вложенные папки и шаблоны (поля нет, если папка пуста)","items":{"$ref":"#/components/schemas/RootFolderOrTemplate"}}}}]},{"allOf":[{"$ref":"#/components/schemas/FolderTemplate"},{"$ref":"#/components/schemas/TemplateType"}]}]},"ChildFolderOrTemplate":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/ChildFolder"},{"$ref":"#/components/schemas/FolderType"}]},{"allOf":[{"$ref":"#/components/schemas/FolderTemplate"},{"$ref":"#/components/schemas/TemplateType"}]}]},"RootPath":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Имя папки"},"translatedName":{"type":"string","description":"Название транслитерацией для ЧПУ","example":"Papka"}}}]},"Facsimile":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"uid":{"type":"string","description":"ID пользователя - создателя файла","example":"64cb87b4893b29e77c64658d"},"type":{"type":"string","description":"Тип файла","example":"file"},"name":{"type":"string","description":"Имя файла","example":"facsimile.jpg"},"fileName":{"type":"string","description":"Оригинальное имя файла","example":"facsimileOrigin.jpg"},"filePath":{"type":"string","description":"Путь к файлу на сервере","example":"http://safe.forma.today/facsimiles/64cb87b4893b29e77c646573/64cb87b4893b29e77c64658d.jpg"},"mimeType":{"type":"string","description":"MIME-тип файла","example":"image/jpeg"},"size":{"type":"number","description":"Размер файла","example":55589},"uploadedAt":{"type":"string","description":"Дата загрузки файла","example":"2023-08-14T12:21:06.245Z"}}}]},"ExternalInfillSignatureStatus":{"type":"string","description":"Статус подписи: SIGN_REQUESTED — запрошена (ждёт подписанта), SIGNED — подписан, REJECTED — подписант отказался, REVOKED — отозван отправителем (кабинет подписанта)","enum":["SIGN_REQUESTED","SIGNED","REJECTED","REVOKED"],"example":"SIGN_REQUESTED"},"ExternalInfillSigner":{"type":"object","description":"Подписант документа (ФИО и телефон, на который уходит код подтверждения)","properties":{"name":{"type":"string","description":"ФИО подписанта","example":"Иванов Иван Иванович"},"phone":{"type":"string","description":"Телефон подписанта","example":79871232343}}},"ExternalInfillSignatureShort":{"type":"object","description":"Подпись документа (ПЭП); нет, если подпись не запрашивалась","properties":{"status":{"$ref":"#/components/schemas/ExternalInfillSignatureStatus"},"signer":{"$ref":"#/components/schemas/ExternalInfillSigner"},"signComment":{"type":"string","description":"Комментарий","example":"Комментарий"},"signedAt":{"type":"string","description":"Дата подписи","example":"2024-10-27T13:38:25.156+00:00"}}},"ExternalInfillSignature":{"description":"Подпись документа (ПЭП) со служебными данными подтверждения","allOf":[{"$ref":"#/components/schemas/ExternalInfillSignatureShort"},{"type":"object","properties":{"signVerificationCode":{"type":"string","description":"Код из СМС","example":123456},"smsId":{"type":"string","description":"id транзакции","example":123},"omitEntityStamp":{"type":"boolean","description":"Флаг отмены рендеринга печати создателя заполнения","example":true}}}]},"ExternalInfillAttachments":{"type":"array","description":"Приложения (вложения) документа внешнего заполнения","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"attachment"},"filename":{"type":"string","description":"Имя файла","example":"test.txt"},"mimetype":{"type":"string","description":"Тип файла","example":"text/plain"},"size":{"type":"number","description":"Размер файла","example":100},"filledAt":{"type":"string","description":"Дата заполнения","example":"2024-05-21T17:21:46.368+00:00"},"deletedAt":{"type":"string","description":"Файл удалён пользователем в журнале «Вложений» (FOR-2909); в карточке документа — «Файлы удалены пользователем»","example":"2026-11-10T12:00:00.000+00:00"},"caption":{"type":"string","description":"Подпись приложения (выводится на страницах приложения справа вверху)","example":"Генеральный план объекта"}}}]}},"ExternalInfillSideValues":{"type":"array","description":"Массив сторон документа","items":{"properties":{"tattrValues":{"$ref":"#/components/schemas/TemplateTattrValues"},"tableValues":{"description":"Значения табличных переменных стороны (по умолчанию пустой массив)","allOf":[{"$ref":"#/components/schemas/TemplateTableValues"}]},"articleValues":{"description":"Значения переменных-пунктов (статей) стороны (по умолчанию пустой массив)","allOf":[{"$ref":"#/components/schemas/TemplateArticleValues"}]},"formulaValues":{"$ref":"#/components/schemas/TemplateFormulaValues"}}}},"ExternalInfillReuseConfig":{"type":"object","properties":{"reusable":{"type":"boolean","description":"Является ли внешнее заполнение многоразовым","example":true},"reuseActive":{"type":"boolean","description":"Является ли многоразовое внешнее заполнение активным","example":true},"childrenSignable":{"type":"boolean","description":"Можно ли применять ПЭП к дочерним документам многоразового внешнего заполнения","example":true}}},"ExternalInfillShort":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/ExternalInfillReuseConfig"},{"type":"object","properties":{"templateId":{"type":"string","description":"ID шаблона","example":"64d5e8685186ca28a0567747"},"name":{"type":"string","description":"Наименование","example":"Название документа"},"createdAt":{"type":"string","description":"Дата создания","example":"2024-05-21T17:21:46.368+00:00"},"readAt":{"type":"string","description":"Дата чтения","example":"2024-05-21T17:21:46.368+00:00"},"filledAt":{"type":"string","description":"Дата заполнения","example":"2024-05-21T17:21:46.368+00:00"},"urlKey":{"type":"string","description":"Ключ для генерации ссылки","example":"902fd2c03ba52ca302dccb3e5546543e"},"isReady":{"type":"boolean","description":"Статус готовности документа","example":false}}}]},"ExternalInfill":{"allOf":[{"$ref":"#/components/schemas/ExternalInfillShort"},{"type":"object","properties":{"uid":{"type":"string","description":"ID создателя внешнего заполнения","example":"64cb87b4893b29e77c64658d"},"version":{"type":"integer","description":"Версия шаблона","example":0},"entityId":{"type":"string","description":"ID организации","example":"64d5e8685186ca28a0567747"},"sideValues":{"$ref":"#/components/schemas/ExternalInfillSideValues"},"attachments":{"$ref":"#/components/schemas/ExternalInfillAttachments"},"externalUserEmail":{"type":"string","description":"Email внешнего пользователя","example":"test@mail.ru"},"signature":{"$ref":"#/components/schemas/ExternalInfillSignature"},"docIndexNumber":{"type":"integer","description":"Номер документа по порядку","example":1},"htmlName":{"type":"string","description":"Название документа с переменными","example":"Название"},"parentId":{"type":"string","description":"id родителя дочернего документа","example":"64d5e8685186ca28a0567747"}}}]},"NewExternalInfillEntity":{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"ООО Вектор"},"address":{"type":"string","description":"Адрес","example":"111111, г.Москва, ул. Лесная, д.1"},"inn":{"type":"string","description":"ИНН","example":1234567890},"kpp":{"type":"string","description":"КПП","example":12345678},"email":{"type":"string","description":"Email","example":"test@mail.ru"},"phone":{"type":"string","description":"Телефон","example":79012345678}}},"NewExternalInfillEntityWithApprovedFlag":{"allOf":[{"$ref":"#/components/schemas/NewExternalInfillEntity"},{"type":"object","properties":{"approved":{"type":"boolean","description":"Флаг подтверждения","example":true}}}]},"ExternalInfillEntity":{"description":"Организация, собирающая данные для внешнего заполнения","allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewExternalInfillEntityWithApprovedFlag"}]},"DocumentBase":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название","example":"Договор 203"},"createdAt":{"type":"string","description":"Дата создания","example":"2024-05-21T17:21:46.368+00:00"}}}]},"RenderBase":{"allOf":[{"$ref":"#/components/schemas/DocumentBase"},{"type":"object","properties":{"type":{"type":"string","description":"Вид документа — render (документ, созданный по шаблону)","example":"render"}}}]},"ExternalInfillBase":{"allOf":[{"$ref":"#/components/schemas/DocumentBase"},{"type":"object","properties":{"type":{"type":"string","description":"Вид документа — externalInfill (внешнее заполнение)","example":"externalInfill"},"urlKey":{"type":"string","description":"Ключ для генерации ссылки","example":"902fd2c03ba52ca302dccb3e5546543e"},"readAt":{"type":"string","description":"Дата чтения","example":"2024-05-21T17:21:46.368+00:00"},"filledAt":{"type":"string","description":"Дата заполнения","example":"2024-05-21T17:21:46.368+00:00"},"isReady":{"type":"boolean","description":"Статус готовности документа","example":false}}}]},"StrictRenderBase":{"allOf":[{"$ref":"#/components/schemas/DocumentBase"},{"type":"object","properties":{"type":{"type":"string","description":"Вид документа — strictRender (строгий документ)","example":"strictRender"}}}]},"CrmLeadType":{"type":"string","description":"Тип CRM (без учёта регистра; «bitrix» из виджета Битрикс24 принимается как Bitrix24)","enum":["amoCRM","Bitrix24","Aurumline"],"example":"amoCRM"},"CrmLeadKey":{"type":"object","required":["crm","entityId"],"properties":{"crm":{"$ref":"#/components/schemas/CrmLeadType"},"entityId":{"type":"string","description":"id лида (сделки) в CRM, до 64 символов; число принимается и сохраняется строкой","example":"27461057"},"entityType":{"type":"string","description":"Тип сущности в CRM, до 64 символов, с учётом регистра (не передан — пустая строка; лид с типом и без типа — разные записи)","example":"leads"}}},"SaveCrmLead":{"allOf":[{"$ref":"#/components/schemas/CrmLeadKey"},{"type":"object","required":["data"],"properties":{"account":{"type":"string","description":"Аккаунт (портал) CRM, до 255 символов","example":"formasales"},"data":{"type":"object","description":"Данные лида, полученные виджетом из CRM, — непустой JSON-объект до 1 МБ; сервер его не разбирает и возвращает как есть","additionalProperties":true,"example":{"crmData":[{"name":"Контакт","items":[{"id":"lead.name","name":"Название","value":"Поставка оборудования","type":"text"}]}],"crmProducts":{"products":null,"services":null}}}}}]},"CrmLead":{"type":"object","required":["id","crm","entityId","entityType","account","data","createdAt","updatedAt","expiresAt"],"properties":{"id":{"type":"string","description":"id записи — передаётся странице ЛК для чтения","example":"672a1f3e9b1c2d0012a3b4c5"},"crm":{"$ref":"#/components/schemas/CrmLeadType"},"entityId":{"type":"string","description":"id лида (сделки) в CRM","example":"27461057"},"entityType":{"type":"string","description":"Тип сущности в CRM (пустая строка — не передавался)","example":"leads"},"account":{"type":"string","description":"Аккаунт (портал) CRM, если передавался","example":"formasales"},"data":{"type":"object","additionalProperties":true,"description":"Данные лида в том виде, в каком их записал виджет"},"createdAt":{"type":"string","format":"date-time","description":"Первая запись лида"},"updatedAt":{"type":"string","format":"date-time","description":"Последняя запись лида"},"expiresAt":{"type":"string","format":"date-time","description":"Когда запись удалится (7 дней после последней записи)"}}},"CrmType":{"type":"string","description":"Тип CRM","enum":["amoCRM","Bitrix24","Aurumline"],"example":"amoCRM"},"CrmTypeWithYClients":{"type":"string","description":"Тип CRM","enum":["YCLIENTS","amoCRM","Bitrix24","Aurumline"],"example":"YCLIENTS"},"RegisterSource":{"type":"string","description":"Источник регистрации","enum":["YCLIENTS","amoCRM","Bitrix24","Aurumline","DataDoc"],"example":"YCLIENTS"},"CounteragentType":{"type":"string","enum":["entity","person","individual"],"description":"Тип контрагента","example":"entity"},"CounteragentAttrValues":{"type":"object","description":"Значения переменных контрагента","additionalProperties":{"type":"string","description":"Значение переменной","example":"Значение"},"example":{"101":"Значение","b2bb25949213f16bcd934422":"Значение"}},"NewCounteragent":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/CounteragentType"},"selfowned":{"type":"boolean","description":"Признак «мой контрагент» (своя организация/лицо пользователя); по нему работает фильтр selfowned списка","example":true},"favorite":{"type":"boolean","description":"Флаг добавления в избранное","example":false},"attrValues":{"$ref":"#/components/schemas/CounteragentAttrValues"},"createdAt":{"type":"string","description":"Дата и время создания контрагента","example":"2024-12-04T20:42:10.687+00:00"}}},"Counteragent":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewCounteragent"}]},"MappedCounteragent":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/CounteragentType"},"favorite":{"type":"boolean","description":"Флаг добавления в избранное","example":true},"name":{"type":"string","description":"Наименование контрагента","example":"Вектор"},"legalName":{"type":"string","description":"Юридическое наименование контрагента","example":"ООО Вектор"},"fullName":{"type":"string","description":"Полное наименование контрагента","example":"ООО Вектор"},"inn":{"type":"string","description":"ИНН контрагента","example":1234567890},"birthday":{"type":"string","description":"Дата рождения контрагента","example":"2023-05-04"},"snils":{"type":"string","description":"СНИЛС контрагента","example":"123-456-789-01"},"createdAt":{"type":"string","description":"Дата и время создания контрагента","example":"2023-05-04T17:34:24.535Z"}}}]},"CounteragentList":{"type":"object","properties":{"items":{"type":"array","description":"Контрагенты выбранного диапазона","items":{"$ref":"#/components/schemas/MappedCounteragent"}},"count":{"type":"integer","description":"Общее число контрагентов, подходящих под фильтр","example":1},"outside":{"type":"array","description":"Контрагенты из DaData","items":{"type":"object"}}}},"CounteragentBaseattr":{"type":"object","properties":{"id":{"type":"string","description":"id переменной","example":101},"type":{"$ref":"#/components/schemas/CounteragentType"}}},"CounteragentMatchingBlocks":{"type":"array","description":"Блоки переменных (внутри блока — «И», между блоками — «ИЛИ»); блок без переменных сохранить нельзя","items":{"type":"array","items":{"type":"string","description":"id переменной"}},"example":[["304","2006"],["305","2006"]]},"CounteragentMatchingRules":{"type":"object","properties":{"required":{"allOf":[{"$ref":"#/components/schemas/CounteragentMatchingBlocks"}],"description":"«Должно присутствовать» — проверяется документ; не выполнен ни один блок — карточка не создаётся и не обновляется"},"match":{"allOf":[{"$ref":"#/components/schemas/CounteragentMatchingBlocks"}],"description":"«Как определяем» — по порядку (приоритет); для карточки решает первый блок, у которого все переменные заполнены и в документе, и в карточке"}}},"CounteragentMatchingType":{"allOf":[{"type":"object","properties":{"type":{"$ref":"#/components/schemas/CounteragentType"}}},{"$ref":"#/components/schemas/CounteragentMatchingRules"}]},"CounteragentMatching":{"type":"object","properties":{"editable":{"type":"boolean","description":"Пользователь — администратор рабочего пространства и может менять правила","example":true},"types":{"type":"array","description":"Действующие правила по типам","items":{"allOf":[{"$ref":"#/components/schemas/CounteragentMatchingType"},{"type":"object","properties":{"isDefault":{"type":"boolean","description":"Своих правил нет, действует базовый набор","example":true}}}]}},"defaults":{"type":"array","description":"Базовый набор (одинаковый для всех рабочих пространств)","items":{"$ref":"#/components/schemas/CounteragentMatchingType"}}}},"CounteragentDuplicates":{"type":"object","properties":{"items":{"type":"array","description":"Карточки-дубли, по группам","items":{"allOf":[{"$ref":"#/components/schemas/MappedCounteragent"},{"type":"object","properties":{"duplicateGroup":{"type":"integer","description":"Номер группы карточек, которые правила считают одной карточкой","example":1}}}]}},"count":{"type":"integer","description":"Число карточек-дублей","example":2},"groups":{"type":"integer","description":"Число групп","example":1}}},"IdObject":{"type":"object","properties":{"id":{"type":"string","description":"id объекта","example":"62bb25949213f16bcd934422"}}},"SmsStatus":{"type":"object","properties":{"id":{"type":"string","description":"id документа","example":"62bb25949213f16bcd934422"},"smsId":{"type":"string","nullable":true,"description":"id СМС у провайдера (null — СМС не отправлялось)","example":"123"},"status":{"type":"string","enum":["notsent","pending","sent","delivered","failed","expired","notfound"],"description":"Статус доставки. notsent — СМС не отправлялось; pending — ожидает отправки; sent — передано оператору; delivered — доставлено; failed — не доставлено; expired — просрочено; notfound — провайдер не нашёл сообщение","example":"delivered"},"providerStatus":{"type":"number","nullable":true,"description":"Код статуса провайдера (smsc.ru) как есть","example":1},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"Время последнего изменения статуса у провайдера","example":"2026-10-21T13:38:25.000Z"}}},"File":{"type":"object","properties":{"file":{"type":"string","description":"Файл","format":"binary"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"array","description":"Тексты ошибок (по одному на каждую найденную ошибку)","items":{"type":"string","description":"сообщение об ошибке","example":"Ошибка"}},"details":{"type":"object","description":"Служебные сведения для поиска ошибки в журнале сервера","properties":{"errorId":{"type":"string","description":"id ошибки","example":"XdsaW0f"},"wid":{"type":"string","description":"id воркспейса","example":"62bb25949213f16bcd934422"},"uid":{"type":"string","description":"id пользователя","example":"62bb25949213f16bcd934422"}}}}},"CattrType":{"type":"string","enum":["string","html","list","integer","decimal","money","date","email","firstname","middlename","familyname","indexnumber","address","phone"],"description":"Тип переменной: string — строка, html — форматированный текст, list — список значений, integer — целое число, decimal — дробное число, money — денежная сумма, date — дата, email — e-mail, firstname/middlename/familyname — имя/отчество/фамилия (склоняются), indexnumber — порядковый номер, address — адрес, phone — телефон","example":"string"},"NewCattr":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/CattrType"},"name":{"type":"string","description":"Название переменной","example":"Имя кота"},"charset":{"type":"string","description":"Набор возможных символов","example":"R"},"sections":{"type":"array","description":"Список секций","example":[101,102],"items":{"type":"integer"}},"deleted":{"type":"boolean","description":"Флаг \"переменная удалена\"","example":false},"minLength":{"type":"integer","description":"Минимальная длина","example":5},"maxLength":{"type":"integer","description":"Максимальная длина","example":10},"length":{"type":"integer","description":"Длина","example":7},"values":{"type":"array","description":"Набор значений","example":["Мужской","Женский"],"items":{"type":"string"}},"multiple":{"type":"boolean","description":"Флаг \"множественный выбор\"","example":true},"regexp":{"type":"string","description":"Регулярное выражение","example":"^\\d{3}-\\d{3}$"},"caseType":{"type":"string","enum":["anyCase","upperFirst","upperCase","lowerCase"],"description":"Регистр","example":"lowerCase"},"mask":{"type":"string","description":"Маска для ввода","example":"XXX-XXX"},"labelLineCount":{"type":"integer","description":"Количество строк в названии","example":1},"labelWidth":{"type":"integer","description":"Ширина названия в px","example":190},"inputWidth":{"type":"integer","description":"Ширина поля ввода в px","example":190},"inputText":{"type":"string","description":"Текст поля ввода","example":"Фамилия"},"inputTooltip":{"type":"string","description":"Подсказка поля ввода","example":"Введите фамилию"},"errorMessage":{"type":"string","description":"Текст ошибки","example":"Фамилия введена неверно"},"folderid":{"type":"string","description":"ID папки","example":"65bbb56f5070606acb59ef70"},"ownVariant":{"type":"boolean","description":"Флаг \"возможен ли свой вариант переменной\"","example":true},"description":{"type":"string","description":"Описание переменной (макс. 300 символов)","example":"string"}}},"Cattr":{"allOf":[{"type":"object","properties":{"lang":{"type":"string","description":"Язык переменной","example":"ru"}}},{"$ref":"#/components/schemas/IdObject"},{"$ref":"#/components/schemas/NewCattr"}]},"HiddenButtons":{"type":"object","description":"Скрытые кнопки (FOR-2763). render - экран создания документа: downloadPdf, downloadDocx, print, sendEmail, massRender, sendToSign, sendToFill, signUkep, markToSign. document - карточка документа: downloadPdf, downloadDocx, print, sendEmail, createAgain, createAnother, markToSign, sendToStorage, sendToSign, signUkep.","required":["render","document"],"properties":{"render":{"type":"array","description":"Скрытые кнопки экрана создания документа","items":{"type":"string","description":"Код кнопки","enum":["downloadPdf","downloadDocx","print","sendEmail","massRender","sendToSign","sendToFill","signUkep","markToSign"]}},"document":{"type":"array","description":"Скрытые кнопки карточки документа","items":{"description":"Код кнопки","type":"string","enum":["downloadPdf","downloadDocx","print","sendEmail","createAgain","createAnother","markToSign","sendToStorage","sendToSign","signUkep"]}}},"example":{"render":["downloadDocx","massRender"],"document":["downloadDocx"]}},"ButtonSettings":{"type":"object","properties":{"available":{"type":"boolean","description":"Функция доступна воркспейсу (общая настройка сервиса workspaces.buttons.enabled или свойство воркспейса buttonsAccess)"},"hiddenButtons":{"$ref":"#/components/schemas/HiddenButtons"},"editable":{"type":"boolean","description":"Пользователь может менять (функция доступна и он в группе администраторов воркспейса)"}}},"BoxLicense":{"type":"object","description":"Лицензия коробки (on-prem версии), которую вендор выдаёт заказчику; заказчик вводит код в своей коробке","properties":{"id":{"type":"string","description":"id лицензии","example":"62bb25949213f16bcd934428"},"code":{"type":"string","description":"Код лицензии для ввода в коробке — 20 символов (латиница без похожих букв и цифры 2-9) группами по 5 через дефис; создаётся сервером","example":"ABCDE-FGHJK-LMNPQ-RS234"},"licenseId":{"type":"string","description":"id внутри подписанного файла лицензии (UUID; не меняется при продлении)","example":"3f0c9a52-7a4e-4d2b-9a77-1f2e3d4c5b6a"},"org":{"type":"string","description":"Организация, на которую выдана лицензия","example":"ООО Ромашка"},"inn":{"type":"string","description":"ИНН организации (\"\" — не указан)","example":"7700000000"},"startsAt":{"type":"string","format":"date-time","description":"Начало срока действия","example":"2026-11-01T00:00:00.000Z"},"expiresAt":{"type":"string","format":"date-time","description":"Конец срока действия (у бессрочной — через 99 лет от начала)","example":"2027-11-01T00:00:00.000Z"},"perpetual":{"type":"boolean","description":"Бессрочная лицензия","example":false},"modules":{"type":"array","description":"Модули лицензии (по умолчанию [core])","items":{"type":"string","description":"Код модуля"},"example":["core"]},"note":{"type":"string","description":"Заметка администратора","example":"Договор № 15 от 01.11.2026"},"revoked":{"type":"boolean","description":"Лицензия отозвана (проверка коробки вернёт reason = revoked)","example":false},"installId":{"type":"string","description":"id установки (сервера коробки), к которой привязан код — первая успешная проверка привязывает; нет поля — ещё не активирована","example":"9b1d4c7e-0000-4a00-8000-123456789abc"},"boundAt":{"type":"string","format":"date-time","description":"Когда код привязан к установке","example":"2026-11-02T09:00:00.000Z"},"lastCheckAt":{"type":"string","format":"date-time","description":"Время последней проверки лицензии коробкой","example":"2026-11-06T09:00:00.000Z"},"lastVersion":{"type":"string","description":"Версия коробки при последней проверке","example":"1.4.0"},"createdAt":{"type":"string","format":"date-time","description":"Когда лицензия создана","example":"2026-11-01T08:00:00.000Z"}}},"LoginPassword":{"properties":{"login":{"type":"string","description":"Логин (адрес электронной почты)","example":"user@mail.ru"},"password":{"type":"string","description":"Пароль","example":"Passw0rD"}}},"LoginPasswordUser":{"allOf":[{"$ref":"#/components/schemas/LoginPassword"},{"$ref":"#/components/schemas/NewUser"}]},"Token":{"type":"object","properties":{"token":{"type":"string","description":"Токен JWT для Bearer авторизации","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVpZCI6MTIzLCJ3c2lkIjoyMzR9LCJleHAiOjE2NTY2MDkwOTksImlhdCI6MTY1NjUyMjY5OX0.LC5mFWIxk5IwEsUDm-5xEPMYjvbD885x-uiljui0kiY"}}},"AreaOfActivityBase":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Название сферы деятельности","example":"IT Разработка"},"iconUrl":{"type":"string","description":"Ссылка на иконку сферы деятельности","example":"https://static.forma.today/icons/sharedcategories/68079aef87255d070476acaa.svg"}}}]},"AreaOfActivity":{"allOf":[{"$ref":"#/components/schemas/AreaOfActivityBase"},{"type":"object","properties":{"okved":{"type":"array","description":"Коды ОКВЭД","items":{"type":"string","example":"111.23.1"}},"priority":{"type":"number","description":"Приоритет сферы в списке","example":10}}}]},"AppendixJournalItemRef":{"type":"object","description":"Выбранный файл журнала «Вложений»: вложение документа (type = infill, documentId — id документа, id — id вложения), файл задачи (type = task, id — номер файла), подписанный PDF ПЭП (type = signedpdf, id — id документа) или архив подписанного документа УКЭП (type = signedrender, id — id документа)","required":["type","id"],"properties":{"type":{"type":"string","enum":["infill","task","signedpdf","signedrender"],"example":"infill"},"id":{"type":"string","example":"62bb25949213f16bcd934423"},"documentId":{"type":"string","description":"id документа (обязателен для type = infill, для остальных не передаётся)","example":"62bb25949213f16bcd934422"}}},"AppendixJournalItems":{"type":"object","required":["items"],"properties":{"items":{"type":"array","description":"Выбранные файлы, от 1 до 100 (одна страница журнала)","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/AppendixJournalItemRef"}}}},"AppendixJournalItem":{"type":"object","properties":{"type":{"type":"string","enum":["infill","task","signedpdf","signedrender"],"description":"infill — вложение документа, task — файл задачи, signedpdf — подписанный PDF ПЭП (filename signed.pdf), signedrender — архив подписанного документа УКЭП (filename signed.zip)","example":"infill"},"id":{"type":"string","example":"62bb25949213f16bcd934423"},"documentId":{"type":"string","description":"id документа или номер задачи","example":"62bb25949213f16bcd934422"},"documentName":{"type":"string","description":"Название документа или задачи","example":"Договор аренды"},"name":{"type":"string","description":"Название вложения в шаблоне (у файла задачи нет)","example":"Паспорт"},"filename":{"type":"string","example":"passport.pdf"},"mimetype":{"type":"string","example":"application/pdf"},"size":{"type":"integer","description":"Размер, байт","example":102400},"createdAt":{"type":"string","format":"date-time","description":"Когда файл загружен; у подписанного документа — дата подписания"},"canDelete":{"type":"boolean","description":"Пользователь может удалить файл: есть право удалять документы этого вида (подписанные / обычные) и файлы документа не читает кабинет подписанта; файл задачи удаляет её автор и администратор воркспейса","example":true},"signature":{"type":"object","description":"Подпись подписанного документа (signedpdf, signedrender) — по ней ЛК показывает иконку раздела «Подписи»","properties":{"type":{"type":"string","description":"simple (ПЭП), qualified (УКЭП), edo","example":"qualified"},"status":{"type":"string","description":"Статус подписи документа (SIGNED у ПЭП; DOUBLE_SIGNED, PUBLISHED и др. у УКЭП)","example":"DOUBLE_SIGNED"},"counterType":{"type":"string","description":"Подпись второй стороны (УКЭП)","example":"simple"}}}}},"DateGraphElement":{"type":"object","properties":{"values":{"type":"array","description":"Точки графика по датам","items":{"type":"object","properties":{"date":{"type":"string","description":"Дата","example":"2023-11-22T00:00:00+03:00"},"count":{"type":"integer","description":"Количество действий","example":43}}}},"total":{"type":"integer","description":"Общее число за указанный блок","example":43}}},"AnalyticsWorkspaceGraph":{"type":"object","properties":{"week":{"description":"Данные графика за неделю","allOf":[{"$ref":"#/components/schemas/DateGraphElement"}]},"month":{"description":"Данные графика за месяц","allOf":[{"$ref":"#/components/schemas/DateGraphElement"}]},"quarter":{"description":"Данные графика за квартал","allOf":[{"$ref":"#/components/schemas/DateGraphElement"}]},"year":{"description":"Данные графика за год","allOf":[{"$ref":"#/components/schemas/DateGraphElement"}]}}},"ActionElement":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"createdAt":{"type":"string","description":"Дата создания","example":"2023-11-17T15:40:54.279Z"},"resourceId":{"type":"string","description":"ID ресурса","example":"onboarding.complete"},"uid":{"type":"string","description":"ID пользователя","example":"65576f45c1433e2251e97a5e"},"wid":{"type":"string","description":"ID рабочего пространства","example":"65576f45c1433e2251e97a45"},"resource":{"type":"object","description":"Ресурс действия (за что начислены баллы)","properties":{"id":{"type":"string","description":"ID ресурса","example":"onboarding.complete"},"description":{"type":"string","description":"Описание ресурса","example":"Прошёл онбординг"},"cost":{"type":"number","description":"Цена ресурса (в баллах)","example":4}}}}}]},"AnalyticsPayment":{"type":"object","properties":{"paymentType":{"$ref":"#/components/schemas/TariffPaymentType"},"lastTransactionDate":{"type":"string","description":"Дата последней оплаты","example":"2024-05-04T17:59:59.000Z"},"transactionsSum":{"type":"integer","description":"Сумма всех оплат","example":15400},"lastTransactionAmount":{"type":"integer","description":"Сумма последней оплаты","example":2400}}},"AnalyticsWorkspace":{"allOf":[{"type":"object","properties":{"createdAt":{"type":"string","description":"Дата создания","example":"2023-11-17T13:48:53.850Z"},"counteragents":{"type":"integer","description":"Количество контрагентов","example":5},"users":{"type":"integer","description":"Количество пользователей","example":7},"onboarding":{"description":"Действие «Прошёл онбординг» (onboarding.complete); нет — онбординг не пройден","allOf":[{"$ref":"#/components/schemas/ActionElement"}]},"featured":{"type":"boolean","description":"Флаг избранного рабочего пространства для администратора","example":false},"amocrmId":{"type":"integer","description":"id лида amoCRM","example":25933577}}},{"$ref":"#/components/schemas/SignatureLimits"},{"$ref":"#/components/schemas/AttachmentLimits"},{"$ref":"#/components/schemas/OcrLimits"},{"$ref":"#/components/schemas/DocsLimits"}]},"AnalyticsUser":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"Логин пользователя","example":"tst@te1st.ru"},"emailConfirmed":{"type":"boolean","description":"Флаг подтверждения электронной почты","example":true},"primary":{"type":"boolean","description":"Флаг владельца рабочего пространства","example":true},"name":{"type":"string","description":"Имя пользователя","example":"Клёвое Имя"},"phone":{"type":"string","description":"Мобильный телефон пользователя","example":79287710077},"lastValidDate":{"type":"string","description":"Дата последнего посещения сервиса","example":"2023-11-21T13:12:47.354Z"},"lastActivity":{"type":"object","description":"Последнее действие пользователя в сервисе","properties":{"actionUrl":{"type":"string","description":"URL действия","example":"/analytics/65576f45c1433e2251e97a45?uid=6557951b1463ac06f148a95a"},"actionMethod":{"type":"string","description":"Метод действия","example":"GET"},"createdAt":{"type":"string","description":"Дата действия","example":"2023-11-21T16:59:43.756Z"}}}}}]},"AnalyticsTariff":{"type":"object","properties":{"id":{"type":"string","description":"ID тарифа","example":"tariff_trial"},"patternId":{"type":"string","description":"Полное ID тарифа","example":"tariff_trial_14"},"name":{"type":"string","description":"Название тарифа","example":"Триал"},"duration":{"type":"integer","description":"Длительность тарифа","example":14},"dtTo":{"type":"string","description":"Дата окончания тарифа","example":"2023-11-30T20:59:59.999Z"},"isPaid":{"type":"boolean","description":"Флаг оплаты тарифа","example":true},"isActive":{"type":"boolean","description":"Флаг активности тарифа","example":true}}},"UserDevicesElement":{"type":"object","properties":{"userOs":{"type":"string","description":"ОС пользователя","example":"Windows"},"userDevice":{"type":"string","description":"Устройство пользователя","example":"Super Laptop 9000 Game Nagibation Ultra"},"userBrowser":{"type":"string","description":"Браузер пользователя","example":"Opera"},"windowResolution":{"type":"string","description":"Разрешение экрана пользователя","example":"2400x1200"},"createdAt":{"type":"string","description":"Дата последнего действия пользователя с этого устройства","example":"2023-11-23T15:45:42.398Z"}}},"AnalyticsElement":{"type":"object","properties":{"payment":{"description":"Сведения об оплатах воркспейса (по последнему экземпляру тарифа и сумма всех оплат)","allOf":[{"$ref":"#/components/schemas/AnalyticsPayment"}]},"workspace":{"description":"Данные рабочего пространства (счётчики, лимиты, включённые функции)","allOf":[{"$ref":"#/components/schemas/AnalyticsWorkspace"}]},"accountingdetails":{"description":"Реквизиты для бухгалтерских документов воркспейса","allOf":[{"$ref":"#/components/schemas/AccountingDetails"}]},"user":{"description":"Пользователь, по которому показана аналитика (из параметра uid, иначе владелец воркспейса)","allOf":[{"$ref":"#/components/schemas/AnalyticsUser"}]},"tariff":{"description":"Текущий тариф воркспейса","allOf":[{"$ref":"#/components/schemas/AnalyticsTariff"}]},"points":{"type":"integer","description":"Количество баллов рабочего пространства","example":87},"createdToday":{"type":"object","description":"Создано за последние 24 часа","properties":{"templates":{"type":"integer","description":"Количество созданных шаблонов (за сегодня)","example":11},"packs":{"type":"integer","description":"Количество созданных пакетов (за сегодня)","example":4},"renders":{"type":"integer","description":"Количество рендеров (за сегодня)","example":79},"rendersPacks":{"type":"integer","description":"Количество рендеров пакетов (за сегодня)","example":38}}},"users":{"type":"object","description":"Пользователи рабочего пространства","properties":{"items":{"type":"array","description":"Список пользователей","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"login":{"type":"string","description":"Логин пользователя","example":"tst@te1st.ru"},"name":{"type":"string","description":"Имя пользователя","example":"Имя пользователя"},"phone":{"type":"string","description":"Телефон пользователя","example":79287710077},"primary":{"type":"boolean","description":"Флаг хозяина рабочего пространства пользователя","example":true},"emailConfirmed":{"type":"boolean","description":"Флаг подтверждения электронной почты пользователя","example":true},"usergroups":{"type":"array","description":"id групп пользователей, в которые входит пользователь","items":{"type":"string","description":"id группы пользователей","example":"65576f45c1433e2251e97a51"}}}}]}},"count":{"type":"integer","description":"Количество пользователей","example":1}}},"tcRequests":{"type":"array","description":"Последние заявки на создание шаблона (не больше 2)","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"filename":{"type":"string","description":"Имя файла","example":"Школы-Города-Регионы.xlsx"},"mimeType":{"type":"string","description":"Тип файла","example":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},"size":{"type":"integer","description":"Размер файла (в байтах)","example":1199213},"createdAt":{"type":"string","description":"Дата создания сущности","example":"2023-10-04T09:14:56.557Z"},"ext":{"type":"string","description":"Разрешение файла","example":".xlsx"}}}]}},"actions":{"type":"array","description":"Действия воркспейса, за которые начислены баллы","items":{"$ref":"#/components/schemas/ActionElement"}},"promocodes":{"type":"array","description":"Промокоды, применённые воркспейсом","items":{"allOf":[{"$ref":"#/components/schemas/PromocodeId"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/PromocodeType"},"description":{"type":"string","description":"Описание","example":"Этот промокод предоставляет скидку 30%"},"dtFrom":{"type":"datetime","description":"Дата начала периода возможной активации","example":"2023-01-01T12:00:00.000+00:00"},"dtTo":{"type":"datetime","description":"Дата окончания периода возможной активации","example":"2024-01-01T12:00:00.000+00:00"},"patternId":{"type":"string","description":"ID паттерна тарифа","example":"tariff_team_90"},"usesCount":{"type":"integer","description":"Счетчик использований","example":1}}}]}},"searchActivity":{"type":"array","description":"Последние поисковые запросы шаблонов (до 10)","items":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"data":{"type":"string","description":"Данные поиска пользователя","example":"Какие-то данные"},"createdAt":{"type":"string","description":"Дата трекинга действия","example":"2023-11-22T10:17:33.622Z"}}}]}},"devices":{"type":"array","description":"Последние устройства пользователя (до 3)","items":{"$ref":"#/components/schemas/UserDevicesElement"}},"sources":{"type":"array","description":"Параметры запроса, с которыми воркспейс пришёл на регистрацию (источники)","items":{"type":"object","properties":{"key":{"type":"string","description":"Ключ параметра, указанного при регистрации","example":"instagram"},"value":{"type":"string","description":"Значение параметра, указанного при регистрации","example":"someinstagramprofile"}}}}}},"FeaturedWorkspace":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"wid":{"type":"string","description":"ID избранного рабочего пространства","example":"65576f45c1433e2251e97a45"},"uid":{"type":"string","description":"ID пользователя, для которого рабочее пространство избранное","example":"65576f45c1433e2251e97a5e"},"createdAt":{"type":"string","description":"Дата добавления в избранное","example":"2023-11-30T12:57:18.315Z"}}}]},"PaymentCountItem":{"type":"object","properties":{"count":{"type":"integer","description":"Количество","example":1},"amount":{"type":"integer","description":"Цена","example":2900}}},"PaymentDateItem":{"type":"object","properties":{"date":{"type":"string","description":"Дата оплаты","example":"2024-01-23T14:17:21.000Z"},"amount":{"type":"integer","description":"Цена","example":2900}}},"DayCount":{"type":"object","properties":{"day":{"type":"integer","description":"Количество за день","example":12}}},"WeekCount":{"type":"object","properties":{"week":{"type":"integer","description":"Количество за неделю","example":12}}},"MonthCount":{"type":"object","properties":{"month":{"type":"integer","description":"Количество за месяц","example":12}}},"YearCount":{"type":"object","properties":{"year":{"type":"integer","description":"Количество за год","example":12}}},"AmoLeadCreatedNotification":{"type":"object","description":"Уведомление amoCRM о добавленных сделках (обрабатывается первая сделка leads.add)","properties":{"leads":{"type":"object","description":"Изменения сделок","properties":{"add":{"type":"array","description":"Добавленные сделки (берётся первая)","items":{"type":"object","properties":{"id":{"type":"string","description":"id сделки в amoCRM","example":"31234567"},"status_id":{"type":"string","description":"id статуса сделки","example":"142"},"pipeline_id":{"type":"string","description":"id воронки","example":"7654321"}}}}}},"account":{"type":"object","description":"Аккаунт amoCRM, приславший уведомление","properties":{"id":{"type":"string","description":"id аккаунта amoCRM","example":"29876543"},"subdomain":{"type":"string","description":"Поддомен аккаунта amoCRM","example":"datadoc"}}}}},"AdminUserRole":{"type":"string","description":"Роль администратора: TEST_ADMIN — тестовый администратор, COMMON_ADMIN — администратор сервиса (полный доступ), TEMPLATE_OPERATOR — оператор шаблонов, SALES_MANAGER — менеджер продаж. CREATOR — роль из старых записей базы: кодом не назначается и не проверяется (приходит только в списке администраторов)","enum":["TEST_ADMIN","COMMON_ADMIN","TEMPLATE_OPERATOR","SALES_MANAGER","CREATOR"],"example":"COMMON_ADMIN"},"AdminUser":{"type":"object","properties":{"login":{"type":"string","description":"Логин в сервисе DataDoc","example":"user@mail.ru"},"role":{"$ref":"#/components/schemas/AdminUserRole"},"color":{"type":"string","description":"Цвет администратора","example":"#99ccff"}}},"CloudPaymentsNotificationResponse":{"type":"object","description":"Ответ на уведомление CloudPayments","properties":{"code":{"type":"integer","description":"Код результата для CloudPayments. 0 — принять (уведомление обработано или пропущено); 11 — неверный AccountId (рабочее пространство); 12 — неверная сумма; 13 — платёж не может быть принят (уже оплачен, подписка не продлевается, ошибка обработки)","enum":[0,11,12,13],"example":0}}},"CloudPaymentsCheckNotification":{"type":"object","description":"Уведомление Check — проверка платежа до списания (https://developers.cloudpayments.ru/#check); все значения передаются строками","required":["TransactionId","Amount","Currency","PaymentAmount","PaymentCurrency","DateTime","CardFirstSix","CardLastFour","CardType","CardExpDate","TestMode","Status","OperationType"],"properties":{"TransactionId":{"type":"string","description":"Номер транзакции в CloudPayments","example":"1211506522"},"Amount":{"type":"string","description":"Сумма платежа, руб. (сверяется с суммой транзакции или подписки)","example":"9900.00"},"Currency":{"type":"string","description":"Валюта платежа","example":"RUB"},"PaymentAmount":{"type":"string","description":"Сумма списания в валюте карты","example":"9900.00"},"PaymentCurrency":{"type":"string","description":"Валюта списания","example":"RUB"},"DateTime":{"type":"string","description":"Дата и время создания платежа (UTC, yyyy-MM-dd HH:mm:ss)","example":"2026-11-01 10:00:00"},"CardId":{"type":"string","description":"id карты в CloudPayments","example":"8f7b3f1c2a"},"CardFirstSix":{"type":"string","description":"Первые 6 цифр номера карты","example":"424242"},"CardLastFour":{"type":"string","description":"Последние 4 цифры номера карты","example":"4242"},"CardType":{"type":"string","description":"Платёжная система карты","example":"Visa"},"CardExpDate":{"type":"string","description":"Срок действия карты, MM/YY","example":"12/28"},"TestMode":{"type":"string","description":"Тестовый режим. 1 — тестовый платёж, 0 — боевой","enum":["0","1"],"example":"0"},"Status":{"type":"string","description":"Статус платежа. Completed — для одностадийной оплаты; Authorized — для двухстадийной","enum":["Completed","Authorized"],"example":"Completed"},"OperationType":{"type":"string","description":"Тип операции","enum":["Payment","Refund","CardPayout"],"example":"Payment"},"InvoiceId":{"type":"string","description":"Номер счёта — invoiceNumber транзакции эквайринга; нет поля — платёж по подписке","example":"1024"},"AccountId":{"type":"string","description":"id рабочего пространства, которое платит","example":"62bb25949213f16bcd934422"},"SubscriptionId":{"type":"string","description":"id подписки CloudPayments (для платежей по подписке)","example":"sc_db7849542c378960bcb736fb42cc3"},"TokenRecipient":{"type":"string","description":"Токен получателя платежа (для выплат)","example":"tk_recipient"},"Name":{"type":"string","description":"Имя держателя карты","example":"IVAN PETROV"},"Email":{"type":"string","description":"E-mail плательщика","example":"vm@datadoc.ru"},"IpAddress":{"type":"string","description":"IP-адрес плательщика","example":"185.10.10.10"},"IpCountry":{"type":"string","description":"Страна по IP (код ISO 3166-1 alpha-2)","example":"RU"},"IpCity":{"type":"string","description":"Город по IP","example":"Москва"},"IpRegion":{"type":"string","description":"Регион по IP","example":"Москва"},"IpDistrict":{"type":"string","description":"Федеральный округ по IP","example":"Центральный федеральный округ"},"IpLatitude":{"type":"string","description":"Широта по IP","example":"55.75"},"IpLongitude":{"type":"string","description":"Долгота по IP","example":"37.61"},"Issuer":{"type":"string","description":"Банк-эмитент карты","example":"Sberbank of Russia"},"IssuerBankCountry":{"type":"string","description":"Страна банка-эмитента (ISO 3166-1 alpha-2)","example":"RU"},"Description":{"type":"string","description":"Назначение платежа","example":"Оплата тарифа DataDoc"},"CardProduct":{"type":"string","description":"Тип карточного продукта","example":"C"},"PaymentMethod":{"type":"string","description":"Метод оплаты (ApplePay, GooglePay, SberPay и т.п.; нет поля — картой)","example":"GooglePay"},"Data":{"type":"object","description":"Произвольные данные, переданные при создании платежа (в т.ч. чек CloudPayments.CustomerReceipt)","example":{}}}},"CloudPaymentsPayNotification":{"description":"Уведомление Pay — успешная оплата (https://developers.cloudpayments.ru/#pay); поля Check (кроме TokenRecipient) плюс перечисленные","allOf":[{"$ref":"#/components/schemas/CloudPaymentsCheckNotification"},{"type":"object","required":["GatewayName","AuthCode"],"properties":{"GatewayName":{"type":"string","description":"Идентификатор банка-эквайера","example":"Tinkoff"},"AuthCode":{"type":"string","description":"Код авторизации","example":"A1B2C3"},"Token":{"type":"string","description":"Токен карты для повторных оплат (обязателен для платежа по подписке — сохраняется карта)","example":"tk_a8b6963c38e0091a0aa16f4d04648"},"TotalFee":{"type":"string","description":"Комиссия CloudPayments","example":"0"},"FallBackScenarioDeclinedTransactionId":{"type":"string","description":"Номер отклонённой транзакции, после которой сработал резервный сценарий","example":"1211506521"},"Rrn":{"type":"string","description":"Номер операции в банке (RRN)","example":"123456789012"},"CustomFields":{"type":"string","description":"Дополнительные поля платежа","example":""}}}]},"CloudPaymentsRecurrentNotification":{"type":"object","description":"Уведомление Recurrent — изменение подписки (https://developers.cloudpayments.ru/#recurrent); все значения строками","required":["Id","AccountId","Description","Email","Amount","Currency","RequireConfirmation","StartDate","Interval","Period","Status","SuccessfulTransactionsNumber","FailedTransactionsNumber"],"properties":{"Id":{"type":"string","description":"id подписки CloudPayments","example":"sc_db7849542c378960bcb736fb42cc3"},"AccountId":{"type":"string","description":"id рабочего пространства подписки","example":"62bb25949213f16bcd934422"},"Description":{"type":"string","description":"Назначение платежей подписки","example":"Продление тарифа DataDoc"},"Email":{"type":"string","description":"E-mail плательщика","example":"vm@datadoc.ru"},"Amount":{"type":"string","description":"Сумма платежа подписки, руб.","example":"9900.00"},"Currency":{"type":"string","description":"Валюта","example":"RUB"},"RequireConfirmation":{"type":"string","description":"Двухстадийные платежи (true/false)","example":"false"},"StartDate":{"type":"string","description":"Дата и время первого платежа подписки (UTC)","example":"2026-12-01 10:00:00"},"Interval":{"type":"string","description":"Единица интервала платежей","enum":["Day","Week","Month"],"example":"Month"},"Period":{"type":"string","description":"Число единиц интервала между платежами","example":"1"},"Status":{"type":"string","description":"Статус подписки. Active — активна; PastDue — просрочена; Cancelled — отменена; Rejected — отклонена; Expired — завершена","enum":["Active","PastDue","Cancelled","Rejected","Expired"],"example":"Active"},"SuccessfulTransactionsNumber":{"type":"string","description":"Число успешных платежей","example":"3"},"FailedTransactionsNumber":{"type":"string","description":"Число неуспешных платежей","example":"0"},"MaxPeriods":{"type":"string","description":"Максимальное число платежей подписки","example":"12"},"LastTransactionDate":{"type":"string","description":"Дата и время последнего платежа (UTC)","example":"2026-11-01 10:00:00"},"NextTransactionDate":{"type":"string","description":"Дата и время следующего платежа (UTC)","example":"2026-12-01 10:00:00"}}},"CloudPaymentsRefundNotification":{"type":"object","description":"Уведомление Refund — возврат (https://developers.cloudpayments.ru/#refund)","required":["TransactionId","PaymentTransactionId","Amount","DateTime"],"properties":{"TransactionId":{"type":"string","description":"Номер транзакции возврата (повторное уведомление с тем же номером не учитывается)","example":"1211506600"},"PaymentTransactionId":{"type":"string","description":"Номер исходной транзакции оплаты","example":"1211506522"},"Amount":{"type":"string","description":"Сумма возврата, руб. (больше 0)","example":"9900.00"},"DateTime":{"type":"string","description":"Дата и время возврата (UTC)","example":"2026-11-03 10:00:00"},"InvoiceId":{"type":"string","description":"Номер счёта исходной оплаты","example":"1024"},"AccountId":{"type":"string","description":"id рабочего пространства (если передан, должен совпадать с рабочим пространством транзакции)","example":"62bb25949213f16bcd934422"},"Email":{"type":"string","description":"E-mail плательщика","example":"vm@datadoc.ru"},"TestMode":{"type":"string","description":"1 — тестовый режим, 0 — боевой","enum":["0","1"],"example":"0"},"Data":{"type":"object","description":"Произвольные данные исходного платежа","example":{}}}},"CloudPaymentsReceiptNotification":{"type":"object","description":"Уведомление Receipt — сформирован онлайн-чек CloudKassir (https://developers.cloudkassir.ru/#receipt)","required":["Id","DocumentNumber","SessionNumber","Number","FiscalSign","DeviceNumber","RegNumber","FiscalNumber","Inn","Type","Ofd","Url","QrCodeUrl","Amount","DateTime","Receipt"],"properties":{"Id":{"type":"string","description":"id чека — по нему строится ссылка на чек (receiptUrl транзакции)","example":"0da8dedd24254bffb77bf179bc149e81"},"DocumentNumber":{"type":"string","description":"Номер фискального документа","example":"1234"},"SessionNumber":{"type":"string","description":"Номер смены","example":"12"},"Number":{"type":"string","description":"Номер чека в смене","example":"5"},"FiscalSign":{"type":"string","description":"Фискальный признак документа","example":"1234567890"},"DeviceNumber":{"type":"string","description":"Заводской номер кассы","example":"00000000123456"},"RegNumber":{"type":"string","description":"Регистрационный номер кассы","example":"0000000001012345"},"FiscalNumber":{"type":"string","description":"Номер фискального накопителя","example":"9999078900001234"},"Inn":{"type":"string","description":"ИНН продавца","example":"7707083893"},"Type":{"type":"string","description":"Тип чека (Income — приход, IncomeReturn — возврат прихода и т.д.)","example":"Income"},"Ofd":{"type":"string","description":"Оператор фискальных данных","example":"Taxcom"},"Url":{"type":"string","description":"Ссылка на чек у ОФД","example":"https://receipts.ru/0da8dedd24254bffb77bf179bc149e81"},"QrCodeUrl":{"type":"string","description":"Ссылка на QR-код чека","example":"https://qr.cloudpayments.ru/receipt?q=t%3d20261101T1000"},"TransactionId":{"type":"string","description":"Номер транзакции оплаты (нужен, чтобы сохранить ссылку на чек)","example":"1211506522"},"Amount":{"type":"string","description":"Сумма чека, руб.","example":"9900.00"},"DateTime":{"type":"string","description":"Дата и время чека","example":"2026-11-01 10:00:05"},"InvoiceId":{"type":"string","description":"Номер счёта оплаты","example":"1024"},"AccountId":{"type":"string","description":"id рабочего пространства (нужен, должен совпадать с рабочим пространством транзакции)","example":"62bb25949213f16bcd934422"},"Receipt":{"type":"string","description":"Состав чека (JSON строкой)","example":"{\"Items\":[{\"label\":\"Оплата тарифа DataDoc\",\"price\":9900,\"quantity\":1,\"amount\":9900}]}"},"CalculationPlace":{"type":"string","description":"Место расчётов","example":"datadoc.ru"},"CashierName":{"type":"string","description":"Имя кассира","example":"Иванов И.И."},"SettlePlace":{"type":"string","description":"Адрес расчётов","example":"г. Москва"}}},"AcquiringTransaction":{"type":"object","properties":{"type":{"type":"string","description":"Тип эквайринга","example":"cloudpayments"},"invoiceNumber":{"type":"integer","description":"Номер счета","example":1},"amount":{"type":"number","description":"Сумма","example":1},"description":{"type":"string","description":"Описание","example":"Оплата тарифа DataDoc"},"transactionId":{"type":"string","description":"id транзакции","example":121909128},"dtPay":{"type":"string","description":"Дата оплаты","example":"2023-08-12T13:12:23.000+00:00"},"tariffInstanceId":{"type":"string","description":"id инстанса тарифа","example":"62bb25949213f16bcd934422"},"receiptUrl":{"type":"string","description":"URL чека","example":"https://receipts.ru/0da8dedd24254bffb77bf179bc149e81"}}},"AcquiringPayData":{"type":"object","properties":{"publicId":{"type":"string","description":"id для эквайринга","example":"pk_89834923csdicsdc09203"},"description":{"type":"string","description":"Описание","example":"Оплата тарифа DataDoc"},"amount":{"type":"number","description":"Сумма","example":1},"currency":{"type":"string","description":"Валюта","example":"RUR"},"invoiceId":{"type":"integer","description":"Номер счета","example":1},"accountId":{"type":"string","description":"id аккаунта (wid)","example":"64e22852ab98c223fc691bb8"},"email":{"type":"string","description":"Адрес почты","example":"test@mail.ru"}}},"AcquiringCard":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"cardType":{"type":"string","description":"Тип карты","example":"Visa"},"cardFirstSix":{"type":"string","description":"Первые 6 цифр","example":424242},"cardLastFour":{"type":"string","description":"Последние 4 цифры","example":4242},"cardExpDate":{"type":"string","description":"Дата окончания","example":"11/11"},"token":{"type":"string","description":"Токен для оплаты","example":"tk_a8b6963c38e0091a0aa16f4d04648"}}}]},"AcquiringSubscription":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"subscriptionId":{"type":"string","description":"id подписки","example":"sc_db7849542c378960bcb736fb42cc3"},"amount":{"type":"number","description":"Сумма","example":1000},"startDate":{"type":"string","description":"Дата начала","example":"2023-09-03T17:59:59.000Z"},"interval":{"type":"string","description":"Вид интервала","example":"Day"},"period":{"type":"integer","description":"Интервал","example":30},"status":{"type":"string","description":"Статус","example":"Active"},"successfulTransactionsNumber":{"type":"integer","description":"Число успешных транзакций","example":1},"failedTransactionsNumber":{"type":"integer","description":"Число неуспешных транзакций","example":1},"lastTransactionDate":{"type":"string","description":"Дата последней транзакции","example":"2023-09-03T17:51:41.000Z"},"nextTransactionDate":{"type":"string","description":"Дата следующей транзакции","example":"2023-09-03T17:51:41.000Z"},"card":{"description":"Привязанная карта, с которой списываются платежи подписки","allOf":[{"$ref":"#/components/schemas/AcquiringCard"}]}}}]},"AcquiringDetailedTransaction":{"type":"object","properties":{"id":{"type":"string","description":"id транзакции эквайринга","example":"62bb25949213f16bcd934422"},"wid":{"type":"string","description":"id воркспейса, который оплатил","example":"62bb25949213f16bcd934422"},"wnumber":{"type":"string","description":"Номер воркспейса","example":"40356"},"amoLeadId":{"type":"integer","description":"id сделки воркспейса в amoCRM (нет поля — сделка не привязана)","example":31234567},"email":{"type":"string","description":"Логин (e-mail) владельца воркспейса","example":"vm@datadoc.ru"},"name":{"type":"string","description":"Наименование организации из реквизитов воркспейса (нет поля — реквизиты не заполнены)","example":"ООО «Ромашка»"},"inn":{"type":"string","description":"ИНН из реквизитов воркспейса (нет поля — реквизиты не заполнены)","example":"7707083893"},"skuCode":{"type":"string","description":"Код услуги 1С оплаченного тарифа (нет поля — услуга не найдена)","example":"00-00001002"},"isFirstPayment":{"type":"boolean","description":"true — первая оплата картой этого воркспейса","example":true},"dtPay":{"type":"string","format":"date-time","description":"Дата и время оплаты","example":"2026-10-21T13:38:25.000Z"},"amount":{"type":"number","description":"Сумма оплаты, руб.","example":9900}}},"AccountingDetails":{"type":"object","properties":{"companyname":{"type":"string","description":"Наименование","example":"ООО \"Вектор\""},"inn":{"type":"string","description":"ИНН","example":7837805668},"kpp":{"type":"string","description":"КПП","example":781101001},"ogrn":{"type":"string","description":"ОГРН","example":19812721921},"address":{"type":"string","description":"Адрес","example":"101001, г.Москва, ул.Рябиновая, д.1"},"phone":{"type":"string","description":"Телефон","example":"+7-999-123-45-67"}}},"AccountingDocumentSourceType":{"type":"string","description":"Тип источника данных","enum":["tariffInstance","externalInfillEntity","signatureRequest","signDrawRequest","signMaxRequest","storagePack","ocrRequest","templateRequest"],"example":"tariffInstance"},"AccountingDocument":{"allOf":[{"$ref":"#/components/schemas/IdObject"},{"type":"object","properties":{"name":{"type":"string","description":"Наименование","example":"Счет на оплату №800"},"date":{"type":"string","description":"Дата","example":"2023-08-18T00:00:00.000+00:00"},"amount":{"type":"number","description":"Сумма","example":12000},"type":{"type":"string","description":"Тип","example":"invoice"},"sourceType":{"$ref":"#/components/schemas/AccountingDocumentSourceType"},"sourceId":{"type":"string","description":"id источника данных","example":"62bb25949213f16bcd934422"},"onecId":{"type":"string","description":"id документа в 1С","example":"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"},"onecNumber":{"type":"string","description":"Номер документа в 1С","example":"0000-001234"},"onecStatus":{"type":"string","description":"Статус документа в 1С","enum":["UNPAID","PAID","FAILED"],"example":"PAID"},"filename":{"type":"string","description":"Имя файла","example":"https://safe.forma.today/invoices/64d11d92ec1cdcdb22ec2fa4/64d11ded43a7f1cf81a2c8b0.pdf"}}}]},"AccountingDocumentType":{"type":"object","properties":{"id":{"type":"string","description":"Id","example":"invoice"},"name":{"type":"string","description":"Наименование","example":"Счет на оплату"}}}},"parameters":{"tariff":{"in":"query","name":"tariff","description":"id тарифа/тарифов","schema":{"type":"array","items":{"type":"string"}},"explode":false},"crm":{"in":"query","name":"crm","description":"Название используемой CRM","schema":{"$ref":"#/components/schemas/CrmTypeWithYClients"}},"registerSource":{"in":"query","name":"registerSource","description":"Название источника регистрации воркспейса","schema":{"$ref":"#/components/schemas/RegisterSource"}},"registeredAtFrom":{"in":"query","name":"registeredAtFrom","description":"Фильтр по дате регистрации от","schema":{"type":"string"}},"registeredAtTo":{"in":"query","name":"registeredAtTo","description":"Фильтр по дате регистрации до","schema":{"type":"string"}},"paidAtFrom":{"in":"query","name":"paidAtFrom","description":"Фильтр по дате оплаты от","schema":{"type":"string"}},"paidAtTo":{"in":"query","name":"paidAtTo","description":"Фильтр по дате оплаты до","schema":{"type":"string"}},"storageUsedFromMb":{"in":"query","name":"storageUsedFromMb","description":"FOR-2780. Хранилище заполнено от N МБ (Хранилище файлов + вложения), число не меньше 0, дробная часть через точку; пусто — без фильтра","schema":{"type":"number","example":500}},"appendicesUsedFromMb":{"in":"query","name":"appendicesUsedFromMb","description":"FOR-2780. Вложения от N МБ (вложения документов и подписанные документы), число не меньше 0, дробная часть через точку; пусто — без фильтра","schema":{"type":"number","example":100}},"from":{"in":"query","name":"from","description":"Номер записи, с которой осуществлять выборку (0-based)","schema":{"type":"number"},"example":0},"to":{"in":"query","name":"to","description":"Номер записи, до которой осуществлять выборку (0-based)","schema":{"type":"number"},"example":15},"isActive":{"in":"query","name":"isActive","description":"Флаг активности","schema":{"type":"boolean"}},"currentUsersCountFrom":{"in":"query","name":"currentUsersCountFrom","description":"Количество пользователей от","schema":{"type":"integer"}},"currentUsersCountTo":{"in":"query","name":"currentUsersCountTo","description":"Количество пользователей до","schema":{"type":"integer"}},"duration":{"in":"query","name":"duration","description":"Продолжительность в днях","schema":{"type":"integer"}},"daysLeftFrom":{"in":"query","name":"daysLeftFrom","description":"Дней до завершения от","schema":{"type":"integer"}},"daysLeftTo":{"in":"query","name":"daysLeftTo","description":"Дней до завершения до","schema":{"type":"integer"}},"loginOrInn":{"in":"query","name":"loginOrInn","description":"Логин пользователя или ИНН или номер воркспейса","schema":{"type":"string"}},"featured":{"in":"query","name":"featured","description":"Флаг избранного воркспейса","schema":{"type":"boolean"}},"StrictattrId":{"in":"path","name":"id","required":true,"description":"id объекта","schema":{"type":"integer","example":101}},"StrictattrSectionId":{"in":"path","name":"id","required":true,"description":"id раздела","schema":{"type":"integer","example":101}},"StrictattrFolderId":{"in":"path","name":"id","required":true,"description":"id папки","schema":{"type":"integer","example":101}},"IdStrictProductProperty":{"name":"id","in":"path","description":"id объекта","schema":{"type":"string","example":"price"}},"SettingKey":{"in":"path","name":"key","required":true,"description":"Ключ настройки сервиса (латинские буквы и точки), например attachments.maxSizeMb, links.landingUrl, mail.rusender.token","schema":{"type":"string","pattern":"^[a-zA-Z.]+$","example":"attachments.maxSizeMb"}},"key":{"in":"path","name":"key","description":"Ключ","required":true,"schema":{"type":"string"}},"fromPublishedAt":{"in":"query","name":"fromPublishedAt","description":"Дата публикации от","schema":{"type":"string"}},"toPublishedAt":{"in":"query","name":"toPublishedAt","description":"Дата публикации до","schema":{"type":"string"}},"PromocodeId":{"in":"path","name":"id","required":true,"description":"id промокода","schema":{"type":"string","example":"discount_30"}},"partnerWid":{"in":"path","name":"id","required":true,"description":"id рабочего пространства рекрутера","schema":{"type":"string","example":"62bb25949213f16bcd934422"}},"guid":{"name":"guid","in":"path","description":"GUID МЧД","schema":{"type":"string"}},"timeslotId":{"in":"path","name":"timeslotId","description":"id таймслота","required":true,"schema":{"type":"string"}},"mailingFrom":{"in":"query","name":"from","description":"Смещение — сколько записей пропустить (целое ≥ 0, по умолчанию 0)","schema":{"type":"integer","minimum":0,"default":0,"example":0}},"fromCreatedAt":{"in":"query","name":"fromCreatedAt","description":"Дата создания от","schema":{"type":"string"}},"toCreatedAt":{"in":"query","name":"toCreatedAt","description":"Дата создания до","schema":{"type":"string"}},"type":{"in":"query","name":"type","description":"Тип контрагента (поиск по точному совпадению)","schema":{"$ref":"#/components/schemas/CounteragentType"}},"sort":{"in":"query","name":"sort","description":"Поле, по которому сортировать контрагентов. Минус означает \"по убыванию\"","schema":{"type":"string","enum":["name","fullName","createdAt","-name","-fullName","-createdAt"],"default":"-createdAt"}},"id":{"in":"path","name":"id","description":"id объекта","required":true,"schema":{"type":"string"}},"wid":{"in":"path","name":"wid","required":true,"description":"ID рабочего пространства","example":"65576f45c1433e2251e97a45","schema":{"type":"string"}},"uid":{"in":"query","name":"uid","description":"ID пользователя рабочего пространства","example":"6557951b1463ac06f148a95a","schema":{"type":"string"}}},"responses":{"PartnersAdminForbidden":{"description":"Раздел доступен общему администратору и менеджеру по продажам; для /{id}/referrals — также если рабочее пространство не рекрутер","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PartnerForbidden":{"description":"Рабочее пространство не является рекрутером или рекрутер заблокирован","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"MailingsForbidden":{"description":"Раздел «Рассылки» доступен только общему администратору (роль COMMON_ADMIN)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Отказ в доступе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Объект не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"AlreadyExists":{"description":"Объект уже существует","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InvalidData":{"description":"Неверный запрос","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PaymentRequired":{"description":"Необходима оплата","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalError":{"description":"Внутренняя ошибка сервера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"tags":[]}