{"info":{"title":"Kommand API","description":"REST API для управления документами, формами и другими ресурсами Kommand.\n\n## Аутентификация\n\nВсе запросы требуют заголовок `Authorization` с одним из:\n\n| Метод | Формат | Описание |\n|-------|--------|----------|\n| **API Key** | `Bearer kmd_...` | Постоянный ключ, привязан к аккаунту. Создаётся в настройках |\n| **JWT** | `Bearer eyJ...` | Временный токен (production) |\n\n```bash\ncurl -H \"Authorization: Bearer kmd_your_api_key\" \\\n  https://api.kommand.ru/api/v2/accounts/{account_id}/documents\n```\n\n## Формат ответов\n\nВсе ответы обёрнуты в стандартный envelope:\n\n```json\n{\n  \"data\": { ... },\n  \"meta\": {\n    \"request_id\": \"req_abc123\",\n    \"pagination\": { \"total\": 42, \"page\": 1, \"last_page\": 5, \"has_next\": true }\n  }\n}\n```\n\n`pagination` присутствует только в list-эндпоинтах. `request_id` — уникальный ID запроса для отладки.\n\n## Формат ошибок\n\n```json\n{\n  \"error\": {\n    \"code\": \"not_found\",\n    \"message\": \"Couldn't find Document\",\n    \"details\": [{ \"field\": \"name\", \"messages\": [\"is missing\"] }]\n  },\n  \"meta\": { \"request_id\": \"req_xyz789\" }\n}\n```\n\n| Код | HTTP | Описание |\n|-----|------|----------|\n| `unauthorized` | 401 | Токен отсутствует или невалиден |\n| `forbidden` | 403 | Нет доступа к аккаунту или ресурсу |\n| `not_found` | 404 | Ресурс не найден |\n| `validation_error` | 422 | Ошибка валидации (детали в `details`) |\n| `internal_error` | 500 | Внутренняя ошибка сервера |\n\n## Контент в Markdown\n\nТекстовый контент (поля `content`, `description`) передаётся и возвращается в формате **Markdown**.\n\nПоддерживаемый синтаксис:\n- Заголовки: `# H1`, `## H2`, `### H3`\n- Форматирование: `**bold**`, `*italic*`, `~~strikethrough~~`, `` `code` ``\n- Ссылки: `[text](url)`\n- Списки: `- item`, `1. item`, `- [ ] todo`, `- [x] done`\n- Цитаты: `\u003e quote`\n- Код: ` ```ruby\\ncode\\n``` `\n- Таблицы: GFM pipe-таблицы\n- Разделители: `---`\n\n## Идемпотентность\n\nPOST-запросы поддерживают заголовок `Idempotency-Key`. При повторном запросе с тем же ключом в течение 24 часов возвращается кешированный ответ без создания дубликатов.\n\n```bash\ncurl -X POST \\\n  -H \"Idempotency-Key: unique-key-123\" \\\n  -H \"Authorization: Bearer kmd_...\" \\\n  https://api.kommand.ru/api/v2/accounts/{id}/documents\n```\n\n## Пагинация\n\nList-эндпоинты поддерживают параметры `page` и `limit`:\n\n```bash\nGET /api/v2/accounts/{id}/documents?page=2\u0026limit=25\n```\n\nОтвет содержит `meta.pagination` с информацией о текущей странице и наличии следующей.\n","version":"0.0.1"},"swagger":"2.0","produces":["application/json"],"securityDefinitions":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","scheme":"Bearer","description":"API-ключ (`Bearer kmd_...`) или JWT-токен (`Bearer eyJ...`)"}},"security":[{"Bearer":[]}],"host":"api.kommand.ru","basePath":"/api","tags":[{"name":"Sections","description":"Operations about Sections"},{"name":"Section records","description":"Operations about Section records"},{"name":"Signatories","description":"Operations about Signatories"},{"name":"Powers of attorney","description":"Operations about Powers of attorneys"},{"name":"Video Instructions","description":"Operations about Video Instructions"},{"name":"System","description":"Системное описание платформы: модули, справочники, контракты, точки расширения. Анонимно, ключ не нужен"},{"name":"Authentication","description":"Проверка токена и получение account_id"},{"name":"Documents","description":"CRUD-операции с документами. Поддерживает 6 типов документов, Markdown-контент, папки, soft-delete и восстановление"},{"name":"Folders","description":"Управление папками. Иерархическая структура с вложенностью, каскадное мягкое удаление (подпапки и документы) и восстановление"},{"name":"Custom fields","description":"Метаданные своих полей разделов: машинный ключ, тип, локализованная метка, варианты списка. Значения ездят конвертом `custom_fields` внутри самих сущностей"},{"name":"Counterparties","description":"Контрагенты модуля «Логистика» — отношения аккаунта с юрлицами организации: роли, контакт, заметки, свои поля. Создаются по ИНН, реквизиты и профили ЭДО — у юрлица (`legal_entity`), общего для организации. Справочник бывает общим для аккаунтов организации — видно, чьё отношение; правит и удаляет только владелец"},{"name":"Vehicles","description":"Машины модуля «Логистика» — отношения аккаунта с машинами организации: активность, заметки, свои поля. Машина (ключ — страна и госномер) общая для организации, вложенным объектом; правят её управляющий аккаунт и администратор организации"},{"name":"Drivers","description":"Водители модуля «Логистика» — отношения аккаунта с водителями организации. Ключи водителя — удостоверение и ИНН; это персональные данные: в списке их нет, в одиночном ответе — есть"},{"name":"Locations","description":"Пункты модуля «Логистика» — отношения аккаунта с пунктами организации (склады, РЦ, терминалы): контакт на месте, часы работы, как заехать, внешние ключи аккаунта, контрагенты на пункте. Пункт (ключ — GLN или адрес с названием) общий для организации, вложенным объектом; адрес через API — текстом, «не подтверждён»"},{"name":"Contracts","description":"Договоры модуля «Логистика» — договоры аккаунта со сторонами-юрлицами: наше юрлицо аккаунта и юрлицо его контрагентов. Номер и дата с парой сторон — ключ (409 `contract_exists`); предупреждения, не мешающие записи, — полем `warnings`. Договоры соседних аккаунтов организации не видны (404)"},{"name":"Cargo templates","description":"Номенклатура модуля «Логистика» — шаблоны груза аккаунта: описание одного места (наименование, тара, массы, габариты, опасный груз, контейнеры, госсистема, условия перевозки). Владелец — юрлицо контрагентов аккаунта; невидимый ключу — `owner_hidden`. Итоги на число мест — `totals`. Шаблоны соседних аккаунтов организации не видны (404)"},{"name":"Orders","description":"Заказы клиентов модуля «Логистика»: шапка (клиент, наше юрлицо, договор, условия, цена), точки погрузки и выгрузки по порядку и строки груза «из точки — в точку» — одним телом и одной транзакцией. Подстановки (договор, стороны и контакты точек, маршрут, описание из шаблона груза) — как в окне; статусы — действиями `accept`, `cancel`, `reopen`; «Повторить» — `repeat`; план ЭТрН — `document_plan`; внешние ключи — `external_refs`. Ссылки, которых ключ не читает, — `*_hidden`. Заказы соседних аккаунтов организации не видны (404)"},{"name":"Trips","description":"Перевозки модуля «Логистика»: рейс — остановки по порядку, позиции груза «из остановки — в остановку» и назначения машин и водителей — одним телом и одной транзакцией. Собрать из принятых заказов — `from_orders` (с черновиком заявки — `with_request`); отменить — `cancel`; внешние ключи — `external_refs`. Ссылки, которых ключ не читает, — `*_hidden`; водитель — id и ФИО, без удостоверения и ИНН. Перевозки соседних аккаунтов не видны (404)"},{"name":"Carrier requests","description":"Заявки перевозчику: стороны, договор, ставка, условия, подписант. Подстановки — как в окне; статусы — действиями `send` (титул ЭЗЗ оператору ЭДО), `confirm` (машина и водители в перевозку), `reject`, `withdraw`, `cancel`, `renew`; файл ЭЗЗ — `ezz.xml`, печатная форма со ставкой — `print.pdf`. Только тому, кто читает заявки (в них ставка)"},{"name":"TMS documents","description":"Документы ЭДО перевозок и заявок (ЭЗЗ и другие) с титулами; файл титула — байт в байт, как отправлен. Документ ЭЗЗ — тому, кто читает и документ, и его заявку"},{"name":"Comments","description":"Обсуждения любого поддерживаемого объекта (документ, исполнение процедуры). Общий полиморфный слой: список, создание, resolve/reopen"}],"paths":{"/v2/accounts/{account_id}/documents":{"get":{"summary":"Список документов","description":"Возвращает постраничный список документов в аккаунте.\n\nРезультаты можно фильтровать по папке, типу документа и статусу. Полнотекстовый поиск доступен через параметр `q`.\nЭтот эндпоинт **не возвращает** поля `content` и `description` — используйте GET `/documents/{id}` для полного содержимого.\n\n**Сортировка:** по умолчанию `updated_at desc` (последние изменённые первыми).\n\n**Пагинация:** через параметры `page` и `limit`. Ответ содержит `meta.pagination` с полями `total`, `page`, `last_page` и `has_next`.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Номер страницы","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Количество результатов на странице, по умолчанию: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"folder_id","description":"Фильтр по UUID папки. Возвращает только документы из этой папки","type":"string","required":false},{"in":"query","name":"type","description":"Фильтр по типу документа: single_page_document, multi_page_document, embedded_document, diagram_document, procedure","type":"string","enum":["single_page_document","multi_page_document","embedded_document","diagram_document","procedure"],"required":false},{"in":"query","name":"status","description":"Фильтр по статусу. `active` — активные, `discarded` — удалённые, `all` — все","type":"string","default":"active","enum":["active","discarded","all"],"required":false},{"in":"query","name":"q","description":"Полнотекстовый поиск по названию документа (без учёта регистра, частичное совпадение)","type":"string","required":false},{"in":"query","name":"sort_by","description":"Поле сортировки","type":"string","default":"updated_at","enum":["name","created_at","updated_at"],"required":false},{"in":"query","name":"sort_order","description":"Направление сортировки","type":"string","default":"desc","enum":["asc","desc"],"required":false}],"responses":{"200":{"description":"List documents","schema":{"$ref":"#/definitions/Api_V2_Entities_Document"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no access to this account"}},"tags":["Documents"],"operationId":"getV2AccountsAccountIdDocuments"},"post":{"summary":"Создать документ","description":"Создаёт новый документ в аккаунте.\n\n**Формат контента:** Поля `content` и `description` принимают текст в формате Markdown. Поддерживаемый синтаксис:\n- Заголовки: `# H1`, `## H2`, `### H3`\n- Форматирование: `**bold**`, `*italic*`, `~~strikethrough~~`, `` `code` ``, `[link](url)`\n- Списки: `- маркированный`, `1. нумерованный`, `- [ ] чеклист`, `- [x] выполнено`\n- Цитаты: `\u003e цитата`\n- Блоки кода: ` ```язык\\nкод\\n``` `\n- Таблицы: GFM pipe-таблицы (`| A | B |`)\n- Разделители: `---`\n\n**Идемпотентность:** Поддерживает заголовок `Idempotency-Key`. Повторные запросы с одинаковым ключом в течение 24 часов возвращают кэшированный ответ без создания дубликата.\n\n**Права доступа:** Требуется разрешение `manage` на документы.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdDocuments","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdDocuments"}}],"responses":{"201":{"description":"Create a document","schema":{"$ref":"#/definitions/Api_V2_Entities_Document"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission on documents"},"422":{"description":"Validation error — missing required fields, invalid type or width limits"}},"tags":["Documents"],"operationId":"postV2AccountsAccountIdDocuments"}},"/v2/accounts/{account_id}/documents/{id}":{"get":{"summary":"Получить документ","description":"Возвращает один документ с полным содержимым.\n\nВ отличие от списка, ответ включает поля `content`, `description` и `content_format`.\nКонтент возвращается в формате Markdown, независимо от внутреннего формата хранения.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a document","schema":{"$ref":"#/definitions/Api_V2_Entities_Document"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no read permission"},"404":{"description":"Not found — document does not exist or belongs to another account"}},"tags":["Documents"],"operationId":"getV2AccountsAccountIdDocumentsId"},"patch":{"summary":"Обновить документ","description":"Частично обновляет документ. Изменяются только переданные поля — остальные остаются без изменений.\n\n**Формат контента:** Тот же Markdown-синтаксис, что и при создании.\n\n**Управление папками:**\n- Передайте `folder_id` с UUID для перемещения документа в папку\n- Передайте `folder_id: null` для удаления из папки (перемещение в корень)\n- Не передавайте `folder_id` если не хотите менять папку\n\nИзменение пишется в журнал действий записью `updated` со строками изменённых полей; смена папки — строкой поля `folder_id`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdDocumentsId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdDocumentsId"}}],"responses":{"200":{"description":"Update a document","schema":{"$ref":"#/definitions/Api_V2_Entities_Document"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found — document does not exist or belongs to another account"},"422":{"description":"Validation error — invalid folder, width limit out of range or min above max"}},"tags":["Documents"],"operationId":"patchV2AccountsAccountIdDocumentsId"},"delete":{"summary":"Удалить документ (soft delete)","description":"Мягко удаляет документ. Документ не удаляется навсегда — его можно восстановить через эндпоинт restore.\n\nПосле удаления документ не отображается в списке по умолчанию (статус `active`), но доступен при `status=discarded` или `status=all`.\n\nВ ответе устанавливается поле `discarded_at`.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized — missing or invalid token"},"204":{"description":"Discard a document (soft delete)","schema":{"$ref":"#/definitions/Api_V2_Entities_Document"}},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found"}},"tags":["Documents"],"operationId":"deleteV2AccountsAccountIdDocumentsId"}},"/v2/accounts/{account_id}/documents/{id}/blocks":{"get":{"summary":"Read document blocks (for granular editing)","description":"Returns the document's blocks. **BlockNote (collaborative) documents only.**\nThe source of truth is the collaborative CRDT state, so this reflects the latest edits.\n\n**`view` (query):**\n- `flat` (default) — a flat list of `{ id, type, text }`. Use the `id`s to address\n  blocks in the operations endpoint.\n- `structured` — the full block tree `{ id, type, props, content, children }`. Needed\n  when you must edit a block's internal structure — for example, to add an image\n  (`inlineImage`) into a specific table cell: read the table with `view=structured`,\n  insert the inline image into the target cell's `content`, then send it back via an\n  `update` op.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true},{"in":"query","name":"view","description":"`flat` → {id,type,text}; `structured` → full block tree with props/content/children","type":"string","default":"flat","enum":["flat","structured"],"required":false}],"responses":{"200":{"description":"Read document blocks (for granular editing)"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no read permission"},"404":{"description":"Not found"},"422":{"description":"Document is not a collaborative (BlockNote) document"}},"tags":["Documents"],"operationId":"getV2AccountsAccountIdDocumentsIdBlocks"}},"/v2/accounts/{account_id}/documents/{id}/blocks/operations":{"post":{"summary":"Apply block operations (granular content editing via CRDT)","description":"Applies a list of granular block operations to a **BlockNote (collaborative)** document.\nEdits are merged into the collaborative CRDT (not a destructive blob-replace), so they\ncoexist with concurrent live edits.\n\n**Operations** (applied in order). The body of `append`/`update`/`replace` is EITHER\n`markdown` OR a structured `block` (a BlockNote block object, or an array of them):\n- `append`  — add content at the end: `{ \"op\": \"append\", \"markdown\": \"## New section\\n...\" }`\n- `insert`  — add content next to a block: `{ \"op\": \"insert\", \"after\": \"\u003cblock id\u003e\", \"markdown\": \"...\" }` (or `before`)\n- `update`  — replace a block's content, keeps its id: `{ \"op\": \"update\", \"block_id\": \"...\", \"markdown\": \"## New heading\" }`\n- `delete`  — remove a block: `{ \"op\": \"delete\", \"block_id\": \"...\" }`\n- `replace` — replace the ENTIRE document content: `{ \"op\": \"replace\", \"markdown\": \"# ...\" }`\n\n**Structured `block` payload** — required for content Markdown cannot express\n(images, files, tables with images in cells). Examples:\n- Image block: `{ \"op\": \"append\", \"block\": { \"type\": \"image\", \"props\": { \"url\": \"https://…/a.png\", \"caption\": \"Fig. 1\", \"align\": \"center\" } } }`\n- File block: `{ \"op\": \"append\", \"block\": { \"type\": \"file\", \"props\": { \"url\": \"https://…/doc.pdf\", \"name\": \"doc.pdf\" } } }`\n- HTML block (interactive widget, like Notion): `{ \"op\": \"append\", \"block\": { \"type\": \"html\", \"props\": { \"html\": \"\u003c!doctype html\u003e…\" } } }`.\n  The source runs in a sandbox: scripts and inline styles work, **network is closed** (no fetch/XHR/WebSocket,\n  no external scripts, styles, fonts or images — embed them as `data:` URIs), no access to the page, cookies\n  or the account. Up to 512 KB per block. In PDF it prints as a placeholder; in Markdown — as a ```html render fenced block.\n  Markdown can create it too: a fence with the info string `html render` becomes an HTML block,\n  a plain ```html fence stays a code block (syntax-highlighted source).\n- Image inside a table cell: read the table with `GET /documents/{id}/blocks?view=structured`,\n  add `{ \"type\": \"inlineImage\", \"props\": { \"url\": \"https://…/a.png\", \"height\": 48 } }` to the target\n  cell's `content`, then `{ \"op\": \"update\", \"block_id\": \"\u003ctable id\u003e\", \"block\": { …the whole table block… } }`.\n\nFor adding a single image/file you can also use the simpler `POST /blocks/image`\nand `POST /blocks/file` endpoints (they also accept a file upload).\n\nUse `GET /documents/{id}/blocks` to discover `block_id`s. Returns the resulting blocks.\n\n**Note:** editing/removing a block detaches any comment anchors on it (comment thread data is preserved).\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdDocumentsIdBlocksOperations","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdDocumentsIdBlocksOperations"}}],"responses":{"201":{"description":"Apply block operations (granular content editing via CRDT)"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found"},"422":{"description":"Invalid operation (unknown block/op, missing fields) or not a BlockNote document"}},"tags":["Documents"],"operationId":"postV2AccountsAccountIdDocumentsIdBlocksOperations"}},"/v2/accounts/{account_id}/documents/{id}/blocks/image":{"post":{"summary":"Add an image block","description":"Appends an image block to a **BlockNote (collaborative)** document. Provide the image\nas EITHER an already-hosted `url` OR an uploaded `file` (`multipart/form-data`). When a\n`file` is uploaded it is stored (ActiveStorage) and the resulting URL is used.\n\nThis is a convenience wrapper over the operations endpoint (images cannot be expressed\nas Markdown). The edit is merged into the collaborative CRDT, so it coexists with\nconcurrent live edits. **BlockNote documents only.** Returns the resulting blocks.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdDocumentsIdBlocksImage","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdDocumentsIdBlocksImage"}}],"responses":{"201":{"description":"Add an image block"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found"},"422":{"description":"Missing/ambiguous source (exactly one of url/file) or not a BlockNote document"}},"tags":["Documents"],"operationId":"postV2AccountsAccountIdDocumentsIdBlocksImage"}},"/v2/accounts/{account_id}/documents/{id}/blocks/file":{"post":{"summary":"Add a file block","description":"Appends a file (attachment) block to a **BlockNote (collaborative)** document. Provide\nthe file as EITHER an already-hosted `url` OR an uploaded `file` (`multipart/form-data`).\nWhen a `file` is uploaded it is stored (ActiveStorage) and the resulting URL is used.\n\nThis is a convenience wrapper over the operations endpoint (file blocks cannot be\nexpressed as Markdown). **BlockNote documents only.** Returns the resulting blocks.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdDocumentsIdBlocksFile","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdDocumentsIdBlocksFile"}}],"responses":{"201":{"description":"Add a file block"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found"},"422":{"description":"Missing/ambiguous source (exactly one of url/file) or not a BlockNote document"}},"tags":["Documents"],"operationId":"postV2AccountsAccountIdDocumentsIdBlocksFile"}},"/v2/accounts/{account_id}/documents/{id}/restore":{"post":{"summary":"Восстановить удалённый документ","description":"Восстанавливает ранее мягко удалённый документ, делая его снова активным.\n\nПосле восстановления документ появляется в списке по умолчанию, а `discarded_at` устанавливается в `null`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true}],"responses":{"201":{"description":"Restore a discarded document","schema":{"$ref":"#/definitions/Api_V2_Entities_Document"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found — document does not exist or was not discarded"}},"tags":["Documents"],"operationId":"postV2AccountsAccountIdDocumentsIdRestore"}},"/v2/accounts/{account_id}/custom_field_definitions":{"get":{"summary":"List custom field definitions of a section","description":"Returns the custom fields configured for a section of the account's organization.\n\n**Contract.** `key` is a machine name: immutable, unique within the section — bind to\nit. `label` is localized and may be renamed at any time — show it. This is the same\nmetadata the UI uses, so a client never has to guess names or types.\n\n**Values** are not here: they travel inside the entity itself, in the envelope named\nafter this resource (see the section's endpoints). Reading and writing use the very\nsame keys.\n\n**Inactive fields** stay in the list with `active: false`: historical values are still\nreadable, but writing into such a field is rejected with 422.\n\n`filterable: true` marks a field the section's grid can filter and sort by.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"owner_type","description":"Section the fields belong to, e.g. Task; `SectionRecord` — a custom section","type":"string","enum":["StructureNode","User","Requirement","Task","Document","Counterparty","AccountVehicle","AccountDriver","AccountLocation","Contract","SectionRecord"],"required":true},{"in":"query","name":"section","description":"Custom section key — required with `owner_type=SectionRecord`","type":"string","required":false}],"responses":{"200":{"description":"List custom field definitions of a section"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no access to this account"},"404":{"description":"Not found — unknown section"}},"tags":["Custom fields"],"operationId":"getV2AccountsAccountIdCustomFieldDefinitions"},"post":{"summary":"Create a custom field","description":"Adds a field to a section. **Organization administrator only** — a field belongs to the\norganization and appears in every account of it at once.\n\n`key` is generated from the label when omitted (transliterated to snake_case) and is\n**immutable afterwards**: stored values reference it.\n\n`field_type` is also immutable after creation — values are already coerced to it.\n\nFor `multipleChoice` pass `options` — a field of that type without options is a dead\nend for the person filling the form.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdCustomFieldDefinitions","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCustomFieldDefinitions"}}],"responses":{"201":{"description":"Create a custom field"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — not an organization administrator"},"422":{"description":"Validation error — reserved key, unknown type, limit reached"}},"tags":["Custom fields"],"operationId":"postV2AccountsAccountIdCustomFieldDefinitions"}},"/v2/accounts/{account_id}/custom_field_definitions/{key}":{"patch":{"summary":"Update a custom field","description":"Renames a field, toggles its flags, moves it to another group or replaces the options\nof a choice field. **Organization administrator only.**\n\n`key`, `field_type` and `owner_type` cannot be changed — stored values are bound to\nthem; an attempt is rejected with 422.\n\nSet `active: false` to retire a field: it disappears from forms, its historical values\nstay readable, and writing into it starts returning 422. `DELETE` removes the field\nitself — use it only when the data is not needed either.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"key","type":"string","required":true},{"name":"patchV2AccountsAccountIdCustomFieldDefinitionsKey","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdCustomFieldDefinitionsKey"}}],"responses":{"200":{"description":"Update a custom field"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — not an organization administrator"},"404":{"description":"Not found — no such field in this section"},"422":{"description":"Validation error"}},"tags":["Custom fields"],"operationId":"patchV2AccountsAccountIdCustomFieldDefinitionsKey"},"delete":{"summary":"Delete a custom field","description":"Removes the field itself. **Organization administrator only.**\n\nValues already stored in records are dropped the next time each record is saved.\nTo keep the data and only hide the field, `PATCH` it with `active: false` instead.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"key","type":"string","required":true},{"in":"query","name":"owner_type","type":"string","enum":["StructureNode","User","Requirement","Task","Document","Counterparty","AccountVehicle","AccountDriver","AccountLocation","Contract"],"required":true}],"responses":{"204":{"description":"Delete a custom field"},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — not an organization administrator"},"404":{"description":"Not found — no such field in this section"}},"tags":["Custom fields"],"operationId":"deleteV2AccountsAccountIdCustomFieldDefinitionsKey"}},"/v2/accounts/{account_id}/custom_field_groups":{"get":{"summary":"List field groups of a section","description":"Groups are the collapsible sections a field can be put into. Referenced by `group_id`.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"owner_type","type":"string","enum":["StructureNode","User","Requirement","Task","Document","Counterparty","AccountVehicle","AccountDriver","AccountLocation","Contract"],"required":true}],"responses":{"200":{"description":"List field groups of a section"}},"tags":["Custom fields"],"operationId":"getV2AccountsAccountIdCustomFieldGroups"},"post":{"summary":"Create a field group","description":"Organization administrator only.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdCustomFieldGroups","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCustomFieldGroups"}}],"responses":{"201":{"description":"Create a field group"},"403":{"description":"Forbidden — not an organization administrator"},"422":{"description":"Validation error"}},"tags":["Custom fields"],"operationId":"postV2AccountsAccountIdCustomFieldGroups"}},"/v2/accounts/{account_id}/sections":{"get":{"summary":"List sections","description":"Custom sections of the organization that are ready to use. A section is addressed by\nits `key` — the same as in the web address `/s/\u003ckey\u003e`.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true}],"responses":{"200":{"description":"List sections","schema":{"$ref":"#/definitions/Api_V2_Entities_Section"}},"401":{"description":"Unauthorized"},"404":{"description":"Sections are not enabled for this organization"}},"tags":["Sections"],"operationId":"getV2AccountsAccountIdSections"}},"/v2/accounts/{account_id}/sections/{section_key}":{"get":{"description":"Get a section","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true}],"responses":{"200":{"description":"Get a section","schema":{"$ref":"#/definitions/Api_V2_Entities_Section"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found — unknown, draft or archived section"}},"tags":["Sections"],"operationId":"getV2AccountsAccountIdSectionsSectionKey"}},"/v2/accounts/{account_id}/sections/{section_key}/categories":{"get":{"summary":"List categories of a section","description":"The category tree of the section as a flat list in tree order: `parent_id` and\n`depth` restore the hierarchy. Categories are also the branches that scope custom\nfields — a field may exist only in some branches.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true}],"responses":{"200":{"description":"List categories of a section","schema":{"$ref":"#/definitions/Api_V2_Entities_SectionCategory"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found — unknown section"}},"tags":["Sections"],"operationId":"getV2AccountsAccountIdSectionsSectionKeyCategories"}},"/v2/accounts/{account_id}/sections/{section_key}/records":{"get":{"summary":"List records of a section","description":"Records of the section in the account, ordered by name. Filter by category\n(`category_id`, only that category, without subcategories; `none` — records\nwithout a category) and by name (`q`, case-insensitive substring).\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"category_id","description":"Category UUID, or `none` for records without a category","type":"string","required":false},{"in":"query","name":"q","description":"Name substring, case-insensitive","type":"string","required":false}],"responses":{"200":{"description":"List records of a section","schema":{"$ref":"#/definitions/Api_V2_Entities_SectionRecord"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"},"404":{"description":"Not found — unknown section"}},"tags":["Section records"],"operationId":"getV2AccountsAccountIdSectionsSectionKeyRecords"},"post":{"summary":"Create a record","description":"Creates a record. `custom_fields` are keyed by the machine key; only fields of the\nrecord branch (its category) are accepted — see `/custom_field_definitions`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true},{"name":"postV2AccountsAccountIdSectionsSectionKeyRecords","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdSectionsSectionKeyRecords"}}],"responses":{"201":{"description":"Create a record","schema":{"$ref":"#/definitions/Api_V2_Entities_SectionRecord"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"404":{"description":"Not found — unknown section"},"422":{"description":"Validation error"}},"tags":["Section records"],"operationId":"postV2AccountsAccountIdSectionsSectionKeyRecords"}},"/v2/accounts/{account_id}/sections/{section_key}/records/{id}":{"get":{"description":"Get a record","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true},{"in":"path","name":"id","description":"Record UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a record","schema":{"$ref":"#/definitions/Api_V2_Entities_SectionRecord"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found — unknown section or record"}},"tags":["Section records"],"operationId":"getV2AccountsAccountIdSectionsSectionKeyRecordsId"},"patch":{"summary":"Update a record","description":"Partial update: omitted fields stay. `custom_fields` merge — only the given keys\nchange, `null` clears one. Moving a record to another category keeps the values\nof fields outside the new branch: moved back, they are visible again.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true},{"in":"path","name":"id","description":"Record UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdSectionsSectionKeyRecordsId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdSectionsSectionKeyRecordsId"}}],"responses":{"200":{"description":"Update a record","schema":{"$ref":"#/definitions/Api_V2_Entities_SectionRecord"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Section records"],"operationId":"patchV2AccountsAccountIdSectionsSectionKeyRecordsId"},"delete":{"summary":"Delete a record","description":"Soft delete: the record disappears from the section, its data is kept.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"section_key","description":"Section key","type":"string","required":true},{"in":"path","name":"id","description":"Record UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a record","schema":{"$ref":"#/definitions/Api_V2_Entities_SectionRecord"}},"403":{"description":"Forbidden — no destroy permission"},"404":{"description":"Not found"}},"tags":["Section records"],"operationId":"deleteV2AccountsAccountIdSectionsSectionKeyRecordsId"}},"/v2/accounts/{account_id}/counterparties":{"get":{"summary":"List counterparties","description":"Counterparties visible to the account (its own and, for a shared directory, those of\nother accounts in the pool), ordered by name. Filters: `roles[]` — any of the roles,\n`operator_code` — the legal entity has an EDI profile at the operator, `q` — name or INN substring.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"roles","description":"Any of the roles","type":"array","items":{"type":"string","enum":["shipper","carrier","forwarder","consignee","customer"]},"required":false},{"in":"query","name":"operator_code","description":"EDI operator code","type":"string","enum":["kontur","tensor","taxcom","sbercorus","astral","ediweb","evotor","foraprom","itcom","crpt","tochka","ntssoft","esk","niias","ntc_stek","other"],"required":false},{"in":"query","name":"q","description":"Name or INN substring, case-insensitive","type":"string","required":false}],"responses":{"200":{"description":"List counterparties","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Counterparties"],"operationId":"getV2AccountsAccountIdCounterparties"},"post":{"summary":"Create a counterparty","description":"Creates a counterparty of the account by INN (and KPP for a branch). The legal entity comes from\nthe requisites source; if the organization already has it, only the relation is created. `name`\nis used only when the source is unavailable — the legal entity is then `unverified`. Other\nrequisites in the request are ignored.\n\nRefusals: 409 `counterparty_exists` (`details.id`, `details.archived` for one in the trash),\n422 `branch_required` (`details.branches`), 422 `company_not_found`, 422 `source_unavailable`\n(no `name`), 422 `kpp_required` (source unavailable and a legal entity without `kpp`). `custom_fields` are keyed by the machine key — see `/custom_field_definitions`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdCounterparties","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCounterparties"}}],"responses":{"201":{"description":"Create a counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"409":{"description":"The account already has this counterparty"},"422":{"description":"Validation error or no company"}},"tags":["Counterparties"],"operationId":"postV2AccountsAccountIdCounterparties"}},"/v2/accounts/{account_id}/counterparties/{id}":{"get":{"description":"Get a counterparty","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Counterparties"],"operationId":"getV2AccountsAccountIdCounterpartiesId"},"patch":{"summary":"Update a counterparty","description":"Partial update of the relation: omitted fields stay; requisites are not editable and ignored.\n`edi_profiles` change the legal entity's profiles — with `id` updates one, with `_destroy: true`\ndeletes it, without `id` adds one; allowed only to the managing account or the organization\nadmin, otherwise the whole request is refused with 403. `custom_fields` merge — only the given\nkeys change, `null` clears one.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdCounterpartiesId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdCounterpartiesId"}}],"responses":{"200":{"description":"Update a counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — not the owner, or EDI profiles of a legal entity managed by another account"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Counterparties"],"operationId":"patchV2AccountsAccountIdCounterpartiesId"},"delete":{"summary":"Delete a counterparty","description":"Soft delete of the relation to the trash of the owner account; the legal entity stays. Only the owner account may delete.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"403":{"description":"Forbidden — not the owner or no destroy permission"},"404":{"description":"Not found"}},"tags":["Counterparties"],"operationId":"deleteV2AccountsAccountIdCounterpartiesId"}},"/v2/accounts/{account_id}/counterparties/{id}/contracts":{"get":{"summary":"List contracts of a counterparty","description":"Contracts of the account where the counterparty legal entity is either side, the latest date first. For an own legal entity — also contracts inside the group.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"List contracts of a counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"},"404":{"description":"Not found"}},"tags":["Counterparties"],"operationId":"getV2AccountsAccountIdCounterpartiesIdContracts"}},"/v2/accounts/{account_id}/counterparties/{id}/locations":{"get":{"summary":"Linked locations of the counterparty","description":"Preliminary links of the account — a hint for shipments, not a restriction: locations linked to the counterparty that the role may read. Only for a relation of the account itself.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"Linked locations of the counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Counterparties"],"operationId":"getV2AccountsAccountIdCounterpartiesIdLocations"},"post":{"summary":"Link a location to the counterparty","description":"Both are relations of the account. Who may edit the counterparty or the location of the account may link them; managing rights are not needed. Refusals: 422 `not_account_relation` — no such location in the account (or the role may not read it), 409 `link_exists`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCounterpartiesIdLocations","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCounterpartiesIdLocations"}}],"responses":{"201":{"description":"Link a location to the counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Already linked"},"422":{"description":"Not a relation of the account"}},"tags":["Counterparties"],"operationId":"postV2AccountsAccountIdCounterpartiesIdLocations"}},"/v2/accounts/{account_id}/counterparties/{id}/locations/{location_id}":{"delete":{"summary":"Unlink a location from the counterparty","description":"Hard delete of the link; both journals keep the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"path","name":"location_id","description":"Location — relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Unlink a location from the counterparty","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Counterparties"],"operationId":"deleteV2AccountsAccountIdCounterpartiesIdLocationsLocationId"}},"/v2/accounts/{account_id}/legal_entities":{"get":{"summary":"Find a legal entity by INN","description":"The organization's legal entity with the INN (and KPP for a branch). Without `kpp`: the only card\nwith the INN; if the organization has several branches of the company — 422 `branch_required`\nwith `details.branches`. Not in the organization — 404.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"inn","description":"INN","type":"string","required":true},{"in":"query","name":"kpp","description":"KPP of the branch","type":"string","required":false}],"responses":{"200":{"description":"Find a legal entity by INN","schema":{"$ref":"#/definitions/Api_V2_Entities_LegalEntity"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"},"404":{"description":"Not found"},"422":{"description":"Several branches — pass the KPP"}},"tags":["Counterparties"],"operationId":"getV2AccountsAccountIdLegalEntities"}},"/v2/accounts/{account_id}/signatories/pick":{"get":{"summary":"Signatory to put on a title","description":"In order: the current user if they are a signatory of the legal entity; the account's default signatory\nfor the legal entity and purpose; the only suitable one. Suitable — the check is not `blocked`. Otherwise\n`signatory` is `null`; `candidates` — active signatories with their checks, not blocked first, then by\nname. No personal data.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"legal_entity_id","description":"Legal entity UUID — on whose behalf the title is signed","type":"string","required":true},{"in":"query","name":"purpose","description":"Title purpose","type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"],"required":true},{"in":"query","name":"on","description":"Signing date, defaults to today","type":"string","format":"date","required":false}],"responses":{"200":{"description":"Signatory to put on a title","schema":{"$ref":"#/definitions/Api_V2_Entities_SignatoryOption"}},"401":{"description":"Unauthorized"},"404":{"description":"Legal entity not found or not readable"},"422":{"description":"Invalid parameters"}},"tags":["Signatories"],"operationId":"getV2AccountsAccountIdSignatoriesPick"}},"/v2/accounts/{account_id}/signatories/{id}/check":{"get":{"summary":"Can the signatory sign a title","description":"`signer_status` (СтатПодп 1–6), the power of attorney it rests on and the problems with their severity.\n`on_behalf_of` — the legal entity the title is signed for; another than the signatory's — only the\nshipper title as the loader (СтатПодп 4–6). No personal data.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Signatory UUID","type":"string","required":true},{"in":"query","name":"purpose","description":"Title purpose","type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"],"required":true},{"in":"query","name":"on_behalf_of","description":"Legal entity UUID, defaults to the signatory's","type":"string","required":false},{"in":"query","name":"on","description":"Signing date, defaults to today","type":"string","format":"date","required":false}],"responses":{"200":{"description":"Can the signatory sign a title","schema":{"$ref":"#/definitions/Api_V2_Entities_SignatoryCheck"}},"401":{"description":"Unauthorized"},"404":{"description":"Signatory or legal entity not found"},"422":{"description":"Invalid parameters"}},"tags":["Signatories"],"operationId":"getV2AccountsAccountIdSignatoriesIdCheck"}},"/v2/accounts/{account_id}/counterparties/{id}/signatories":{"get":{"summary":"List signatories of the counterparty legal entity","description":"Alive signatories, by name. INN and SNILS are masked unless you can update them.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"List signatories of the counterparty legal entity","schema":{"$ref":"#/definitions/Api_V2_Entities_Signatory"}},"401":{"description":"Unauthorized"},"404":{"description":"Counterparty not found or its signatories not readable"}},"tags":["Signatories"],"operationId":"getV2AccountsAccountIdCounterpartiesIdSignatories"},"post":{"summary":"Create a signatory of the counterparty legal entity","description":"Response — 201 with `warnings` (`name_twin`, `position_too_long`): they do not prevent saving.\nRefusal: 409 `signatory_exists` — an alive signatory of the legal entity has this INN or SNILS\n(`details.id`).\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCounterpartiesIdSignatories","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCounterpartiesIdSignatories"}}],"responses":{"201":{"description":"Create a signatory of the counterparty legal entity","schema":{"$ref":"#/definitions/Api_V2_Entities_Signatory"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — you cannot edit signatories of this legal entity"},"404":{"description":"Counterparty not found"},"409":{"description":"Signatory exists"},"422":{"description":"Validation error"}},"tags":["Signatories"],"operationId":"postV2AccountsAccountIdCounterpartiesIdSignatories"}},"/v2/accounts/{account_id}/signatories/{id}":{"get":{"description":"Get a signatory","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Signatory UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a signatory","schema":{"$ref":"#/definitions/Api_V2_Entities_Signatory"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"}},"tags":["Signatories"],"operationId":"getV2AccountsAccountIdSignatoriesId"},"patch":{"summary":"Update a signatory","description":"Partial update: omitted fields stay. Another signatory with this INN or SNILS — 409.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Signatory UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdSignatoriesId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdSignatoriesId"}}],"responses":{"200":{"description":"Update a signatory","schema":{"$ref":"#/definitions/Api_V2_Entities_Signatory"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Signatory exists"},"422":{"description":"Validation error"}},"tags":["Signatories"],"operationId":"patchV2AccountsAccountIdSignatoriesId"},"delete":{"summary":"Delete a signatory","description":"Soft delete to the trash. A signatory with alive powers of attorney is refused with 422.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Signatory UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a signatory","schema":{"$ref":"#/definitions/Api_V2_Entities_Signatory"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Has powers of attorney"}},"tags":["Signatories"],"operationId":"deleteV2AccountsAccountIdSignatoriesId"}},"/v2/accounts/{account_id}/counterparties/{id}/powers_of_attorney":{"get":{"summary":"List powers of attorney of the counterparty legal entity as the principal","description":"Alive powers of attorney, the latest issued first. `expiring_within_days` — in effect today and\nending within the days. GUID and powers — only if you can update them.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"signatory_id","description":"Representative UUID","type":"string","required":false},{"in":"query","name":"expiring_within_days","description":"Ending within the days","type":"integer","format":"int32","minimum":0,"maximum":365,"required":false}],"responses":{"200":{"description":"List powers of attorney of the counterparty legal entity as the principal","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"401":{"description":"Unauthorized"},"404":{"description":"Counterparty not found or its powers of attorney not readable"}},"tags":["Powers of attorney"],"operationId":"getV2AccountsAccountIdCounterpartiesIdPowersOfAttorney"},"post":{"summary":"Create a paper power of attorney","description":"Only a paper one: an MCHD is created by uploading its file. Response — 201 with `warnings`\n(`paper_twin`): they do not prevent saving.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCounterpartiesIdPowersOfAttorney","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCounterpartiesIdPowersOfAttorney"}}],"responses":{"201":{"description":"Create a paper power of attorney","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Counterparty not found"},"422":{"description":"Validation error"}},"tags":["Powers of attorney"],"operationId":"postV2AccountsAccountIdCounterpartiesIdPowersOfAttorney"}},"/v2/accounts/{account_id}/counterparties/{id}/powers_of_attorney/import":{"post":{"summary":"Import an MCHD file","description":"Multipart `file` — XML of an MCHD (format 003) issued by the counterparty legal entity. The\nrepresentative is found among its signatories by INN or SNILS from the file, or set `signatory_id`; a\nredelegation under a paper power of attorney needs `parent_id`. Response — 201 created, 200 this MCHD\nis already here for this principal (nothing changed), 409 `power_of_attorney_exists` — the same file\nfor this principal was imported concurrently, 422 — refused with the import `code` (`details` — field names or the\nformat version, never INN or SNILS values) or `validation_error`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Counterparty UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCounterpartiesIdPowersOfAttorneyImport","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCounterpartiesIdPowersOfAttorneyImport"}}],"responses":{"201":{"description":"Import an MCHD file","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Counterparty, signatory or parent not found"},"409":{"description":"Identifier taken"},"422":{"description":"Refused or validation error"}},"tags":["Powers of attorney"],"operationId":"postV2AccountsAccountIdCounterpartiesIdPowersOfAttorneyImport"}},"/v2/accounts/{account_id}/powers_of_attorney/{id}":{"get":{"description":"Get a power of attorney","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Power of attorney UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a power of attorney","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"}},"tags":["Powers of attorney"],"operationId":"getV2AccountsAccountIdPowersOfAttorneyId"},"patch":{"summary":"Update a power of attorney","description":"Partial update: omitted fields stay. An MCHD — only `covers_title_purposes` and the registry fields;\nothers are refused with 422 `from_file`. The representative and the principal do not change.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Power of attorney UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdPowersOfAttorneyId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdPowersOfAttorneyId"}}],"responses":{"200":{"description":"Update a power of attorney","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Powers of attorney"],"operationId":"patchV2AccountsAccountIdPowersOfAttorneyId"},"delete":{"summary":"Delete a power of attorney","description":"Soft delete to the trash. A parent with alive redelegations is refused with 422.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Power of attorney UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a power of attorney","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Has redelegations"}},"tags":["Powers of attorney"],"operationId":"deleteV2AccountsAccountIdPowersOfAttorneyId"}},"/v2/accounts/{account_id}/powers_of_attorney/{id}/revoke":{"post":{"summary":"Revoke a power of attorney","description":"`on` — revocation date: from it the power of attorney is not in effect. `superseded: true` — replaced\nby a new one, without a date. A revoked or superseded one is refused with 422.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Power of attorney UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdPowersOfAttorneyIdRevoke","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdPowersOfAttorneyIdRevoke"}}],"responses":{"201":{"description":"Revoke a power of attorney","schema":{"$ref":"#/definitions/Api_V2_Entities_PowerOfAttorney"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Powers of attorney"],"operationId":"postV2AccountsAccountIdPowersOfAttorneyIdRevoke"}},"/v2/accounts/{account_id}/signing_defaults":{"get":{"summary":"List the account's default signatories","description":"Only legal entities whose signatories you read. Optional filters: legal entity, purpose.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"legal_entity_id","description":"Legal entity UUID","type":"string","required":false},{"in":"query","name":"purpose","description":"Title purpose","type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"],"required":false},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"List the account's default signatories","schema":{"$ref":"#/definitions/Api_V2_Entities_SigningDefault"}},"401":{"description":"Unauthorized"},"422":{"description":"Invalid parameters"}},"tags":["Signatories"],"operationId":"getV2AccountsAccountIdSigningDefaults"},"put":{"summary":"Set the default signatory for a legal entity and purpose","description":"Creates (201) or replaces (200) the account's default. The signatory — of this legal entity and not in the\ntrash, otherwise 422. An inactive or blocked signatory may be set: `pick` skips it until they can sign.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"putV2AccountsAccountIdSigningDefaults","in":"body","required":true,"schema":{"$ref":"#/definitions/putV2AccountsAccountIdSigningDefaults"}}],"responses":{"200":{"description":"Set the default signatory for a legal entity and purpose","schema":{"$ref":"#/definitions/Api_V2_Entities_SigningDefault"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — you cannot assign default signatories"},"404":{"description":"Legal entity or signatory not found"},"422":{"description":"Validation error"}},"tags":["Signatories"],"operationId":"putV2AccountsAccountIdSigningDefaults"},"delete":{"summary":"Remove the default signatory for a legal entity and purpose","description":"Returns the removed default; none set — 404.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"legal_entity_id","description":"Legal entity UUID","type":"string","required":true},{"in":"query","name":"purpose","description":"Title purpose","type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"],"required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove the default signatory for a legal entity and purpose","schema":{"$ref":"#/definitions/Api_V2_Entities_SigningDefault"}},"403":{"description":"Forbidden — you cannot assign default signatories"},"404":{"description":"Legal entity or default not found"}},"tags":["Signatories"],"operationId":"deleteV2AccountsAccountIdSigningDefaults"}},"/v2/accounts/{account_id}/vehicles":{"get":{"summary":"List vehicles","description":"Vehicles visible to the account (its own and, for a shared directory, those of other accounts in the pool). Filters by the record fields, `active` and `q`.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"kind","type":"string","enum":["tractor","truck","trailer","semitrailer"],"required":false},{"in":"query","name":"status","type":"string","enum":["in_service","repair","decommissioned"],"required":false},{"in":"query","name":"carrier_legal_entity_id","description":"Carrier legal entity UUID","type":"string","required":false},{"in":"query","name":"active","type":"boolean","required":false},{"in":"query","name":"q","description":"Substring of the registration number (Latin look-alikes match Cyrillic), make or model, case-insensitive","type":"string","required":false}],"responses":{"200":{"description":"List vehicles","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Vehicles"],"operationId":"getV2AccountsAccountIdVehicles"},"post":{"summary":"Create a vehicle","description":"Connects the vehicle to the account by its key; the key is `vehicle.country` and `vehicle.reg_number`.\nIf the organization already has it, only the relation is created and the `vehicle` fields\nare ignored; otherwise the vehicle is created with them, managed by the account.\n\nRefusals: 409 `vehicle_exists` (`details.id`, `details.archived` for one in the trash), 409 `key_changed` — found by a former key (`details.vehicle_id`, `details.current_key`); pass `new_identity: true` if it is another vehicle.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdVehicles","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdVehicles"}}],"responses":{"201":{"description":"Create a vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"409":{"description":"The account already has this vehicle, or a former key"},"422":{"description":"Validation error"}},"tags":["Vehicles"],"operationId":"postV2AccountsAccountIdVehicles"}},"/v2/accounts/{account_id}/vehicles/{id}":{"get":{"description":"Get a vehicle","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Vehicles"],"operationId":"getV2AccountsAccountIdVehiclesId"},"patch":{"summary":"Update a vehicle","description":"Partial update: omitted fields stay. Changing the `vehicle` fields — only the managing account or\nthe organization admin, otherwise the whole request is refused with 403 (values equal to the\ncurrent ones are not a change). `custom_fields` merge.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdVehiclesId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdVehiclesId"}}],"responses":{"200":{"description":"Update a vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — not the owner, or the vehicle is managed by another account"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Vehicles"],"operationId":"patchV2AccountsAccountIdVehiclesId"},"delete":{"summary":"Delete a vehicle","description":"Soft delete of the relation to the trash of the owner account; the vehicle stays in the organization. The owner account or the organization admin may delete.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"403":{"description":"Forbidden — not the owner or no destroy permission"},"404":{"description":"Not found"}},"tags":["Vehicles"],"operationId":"deleteV2AccountsAccountIdVehiclesId"}},"/v2/accounts/{account_id}/vehicles/{id}/drivers":{"get":{"summary":"Linked drivers of the vehicle","description":"Preliminary links of the account — a hint for shipments, not a restriction: drivers linked to the vehicle that the role may read. Only for a relation of the account itself.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"Linked drivers of the vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Vehicles"],"operationId":"getV2AccountsAccountIdVehiclesIdDrivers"},"post":{"summary":"Link a driver to the vehicle","description":"Both are relations of the account. Who may edit the vehicle or the driver of the account may link them; managing rights are not needed. Refusals: 422 `not_account_relation` — no such driver in the account (or the role may not read it), 409 `link_exists`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdVehiclesIdDrivers","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdVehiclesIdDrivers"}}],"responses":{"201":{"description":"Link a driver to the vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Already linked"},"422":{"description":"Not a relation of the account"}},"tags":["Vehicles"],"operationId":"postV2AccountsAccountIdVehiclesIdDrivers"}},"/v2/accounts/{account_id}/vehicles/{id}/drivers/{driver_id}":{"delete":{"summary":"Unlink a driver from the vehicle","description":"Hard delete of the link; both journals keep the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"path","name":"driver_id","description":"Driver — relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Unlink a driver from the vehicle","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Vehicles"],"operationId":"deleteV2AccountsAccountIdVehiclesIdDriversDriverId"}},"/v2/accounts/{account_id}/drivers":{"get":{"summary":"List drivers","description":"Drivers visible to the account (its own and, for a shared directory, those of other accounts in the pool). Filters by the record fields, `active` and `q`. The list has no license and INN — they are in single-record responses.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"employer_legal_entity_id","description":"Employer legal entity UUID","type":"string","required":false},{"in":"query","name":"active","type":"boolean","required":false},{"in":"query","name":"q","description":"Substring of the last, first or middle name or the phone, case-insensitive; the license and the INN are not searched","type":"string","required":false}],"responses":{"200":{"description":"List drivers","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Drivers"],"operationId":"getV2AccountsAccountIdDrivers"},"post":{"summary":"Create a driver","description":"Connects the driver to the account by its key; the keys are the license (`driver.license_country`, `driver.license_series`, `driver.license_number`; with `driver.license_issued_on` — the license is entered whole) and `driver.inn` — at least one.\nIf the organization already has it, only the relation is created and the `driver` fields\nare ignored; otherwise the driver is created with them, managed by the account.\n\nRefusals: 409 `driver_exists` (`details.id`, `details.archived` for one in the trash), 409 `key_changed` — found by a former key (`details.driver_id`; the current key is not disclosed — pass the current license or the INN); pass `new_identity: true` if it is another driver, 422 `keys_conflict` — the license and the INN belong to different drivers.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdDrivers","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdDrivers"}}],"responses":{"201":{"description":"Create a driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"409":{"description":"The account already has this driver, or a former key"},"422":{"description":"Validation error"}},"tags":["Drivers"],"operationId":"postV2AccountsAccountIdDrivers"}},"/v2/accounts/{account_id}/drivers/{id}":{"get":{"description":"Get a driver","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Drivers"],"operationId":"getV2AccountsAccountIdDriversId"},"patch":{"summary":"Update a driver","description":"Partial update: omitted fields stay. Changing the `driver` fields — only the managing account or\nthe organization admin, otherwise the whole request is refused with 403 (values equal to the\ncurrent ones are not a change). `custom_fields` merge.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdDriversId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdDriversId"}}],"responses":{"200":{"description":"Update a driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — not the owner, or the driver is managed by another account"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Drivers"],"operationId":"patchV2AccountsAccountIdDriversId"},"delete":{"summary":"Delete a driver","description":"Soft delete of the relation to the trash of the owner account; the driver stays in the organization. The owner account or the organization admin may delete.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountDriver"}},"403":{"description":"Forbidden — not the owner or no destroy permission"},"404":{"description":"Not found"}},"tags":["Drivers"],"operationId":"deleteV2AccountsAccountIdDriversId"}},"/v2/accounts/{account_id}/drivers/{id}/vehicles":{"get":{"summary":"Linked vehicles of the driver","description":"Preliminary links of the account — a hint for shipments, not a restriction: vehicles linked to the driver that the role may read. Only for a relation of the account itself.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"Linked vehicles of the driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Drivers"],"operationId":"getV2AccountsAccountIdDriversIdVehicles"},"post":{"summary":"Link a vehicle to the driver","description":"Both are relations of the account. Who may edit the driver or the vehicle of the account may link them; managing rights are not needed. Refusals: 422 `not_account_relation` — no such vehicle in the account (or the role may not read it), 409 `link_exists`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdDriversIdVehicles","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdDriversIdVehicles"}}],"responses":{"201":{"description":"Link a vehicle to the driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Already linked"},"422":{"description":"Not a relation of the account"}},"tags":["Drivers"],"operationId":"postV2AccountsAccountIdDriversIdVehicles"}},"/v2/accounts/{account_id}/drivers/{id}/vehicles/{vehicle_id}":{"delete":{"summary":"Unlink a vehicle from the driver","description":"Hard delete of the link; both journals keep the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"path","name":"vehicle_id","description":"Vehicle — relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Unlink a vehicle from the driver","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountVehicle"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Drivers"],"operationId":"deleteV2AccountsAccountIdDriversIdVehiclesVehicleId"}},"/v2/accounts/{account_id}/locations":{"get":{"summary":"List locations","description":"Locations visible to the account (its own and, for a shared directory, those of other accounts in the pool). Filters by the record fields, `active` and `q`.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"kind","type":"string","enum":["warehouse","distribution_center","terminal","store","production","site","customs","parking","other"],"required":false},{"in":"query","name":"status","type":"string","enum":["active","closed"],"required":false},{"in":"query","name":"address_status","type":"string","enum":["verified","unverified"],"required":false},{"in":"query","name":"owner_legal_entity_id","description":"Owner legal entity UUID","type":"string","required":false},{"in":"query","name":"region_code","description":"Region code of a verified address (two digits)","type":"string","required":false},{"in":"query","name":"external_system","description":"External key system of the account","type":"string","enum":["onec","tms","wms","csv","other"],"required":false},{"in":"query","name":"external_id","description":"External key of the account, exact","type":"string","required":false},{"in":"query","name":"active","type":"boolean","required":false},{"in":"query","name":"q","description":"Substring of the name, address or city, the GLN, or an external key of the account","type":"string","required":false}],"responses":{"200":{"description":"List locations","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Locations"],"operationId":"getV2AccountsAccountIdLocations"},"post":{"summary":"Create a location","description":"Connects the location to the account by its key; the key is `location.gln`, or `location.address_text` (or the point) with `location.name`.\nIf the organization already has it, only the relation is created and the `location` fields\nare ignored; otherwise the location is created with them, managed by the account.\n\nRefusals: 409 `location_exists` (`details.id`, `details.archived` for one in the trash), 409 `key_changed` — found by a former key (`details.location_id`, `details.current_key`); pass `new_identity: true` if it is another location, 422 `keys_conflict` — the GLN and the address with the name belong to different locations.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdLocations","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdLocations"}}],"responses":{"201":{"description":"Create a location","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"409":{"description":"The account already has this location, or a former key"},"422":{"description":"Validation error"}},"tags":["Locations"],"operationId":"postV2AccountsAccountIdLocations"}},"/v2/accounts/{account_id}/locations/resolve":{"get":{"summary":"Resolve a location key","description":"What creating would do, without creating: `own_account` — the account already has it (`id`),\n`archived_own` — in the account trash (`id`), `in_organization` — the organization has it, it will be\nconnected (`former` — found by a former address, `current_key` is the current one), `not_found` — a new one\nwill be created, `keys_conflict` — the GLN and the address with the name belong to different locations.\nThe key is the GLN, or the address (or the point) with the name.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"gln","type":"string","required":false},{"in":"query","name":"name","type":"string","required":false},{"in":"query","name":"address","description":"Address as one line","type":"string","required":false},{"in":"query","name":"latitude","type":"number","format":"float","required":false},{"in":"query","name":"longitude","type":"number","format":"float","required":false}],"responses":{"200":{"description":"Resolve a location key","schema":{"$ref":"#/definitions/Api_V2_Entities_LocationResolution"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"422":{"description":"No key"}},"tags":["Locations"],"operationId":"getV2AccountsAccountIdLocationsResolve"}},"/v2/accounts/{account_id}/locations/{id}/external_refs":{"post":{"summary":"Add an external key","description":"A key of the record in 1C, WMS or another system of the account — a repeated import with it updates the location. Only for a relation of the account itself; who may edit the relation. Refusals: 409 `ref_taken` — the account already has this key.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdLocationsIdExternalRefs","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdLocationsIdExternalRefs"}}],"responses":{"201":{"description":"Add an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Key taken"},"422":{"description":"Validation error"}},"tags":["Locations"],"operationId":"postV2AccountsAccountIdLocationsIdExternalRefs"}},"/v2/accounts/{account_id}/locations/{id}/external_refs/{ref_id}":{"delete":{"summary":"Remove an external key","description":"Hard delete; the journal of the location keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"path","name":"ref_id","description":"External key UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Locations"],"operationId":"deleteV2AccountsAccountIdLocationsIdExternalRefsRefId"}},"/v2/accounts/{account_id}/locations/{id}":{"get":{"description":"Get a location","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a location","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Locations"],"operationId":"getV2AccountsAccountIdLocationsId"},"patch":{"summary":"Update a location","description":"Partial update: omitted fields stay. Changing the `location` fields — only the managing account or\nthe organization admin, otherwise the whole request is refused with 403 (values equal to the\ncurrent ones are not a change). `custom_fields` merge.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdLocationsId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdLocationsId"}}],"responses":{"200":{"description":"Update a location","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — not the owner, or the location is managed by another account"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Locations"],"operationId":"patchV2AccountsAccountIdLocationsId"},"delete":{"summary":"Delete a location","description":"Soft delete of the relation to the trash of the owner account; the location stays in the organization. The owner account or the organization admin may delete.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a location","schema":{"$ref":"#/definitions/Api_V2_Entities_AccountLocation"}},"403":{"description":"Forbidden — not the owner or no destroy permission"},"404":{"description":"Not found"}},"tags":["Locations"],"operationId":"deleteV2AccountsAccountIdLocationsId"}},"/v2/accounts/{account_id}/locations/{id}/counterparties":{"get":{"summary":"Linked counterparties of the location","description":"Preliminary links of the account — a hint for shipments, not a restriction: counterparties linked to the location that the role may read. Only for a relation of the account itself.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false}],"responses":{"200":{"description":"Linked counterparties of the location","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Locations"],"operationId":"getV2AccountsAccountIdLocationsIdCounterparties"},"post":{"summary":"Link a counterparty to the location","description":"Both are relations of the account. Who may edit the location or the counterparty of the account may link them; managing rights are not needed. Refusals: 422 `not_account_relation` — no such counterparty in the account (or the role may not read it), 409 `link_exists`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdLocationsIdCounterparties","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdLocationsIdCounterparties"}}],"responses":{"201":{"description":"Link a counterparty to the location","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Already linked"},"422":{"description":"Not a relation of the account"}},"tags":["Locations"],"operationId":"postV2AccountsAccountIdLocationsIdCounterparties"}},"/v2/accounts/{account_id}/locations/{id}/counterparties/{counterparty_id}":{"delete":{"summary":"Unlink a counterparty from the location","description":"Hard delete of the link; both journals keep the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Relation UUID","type":"string","required":true},{"in":"path","name":"counterparty_id","description":"Counterparty — relation UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Unlink a counterparty from the location","schema":{"$ref":"#/definitions/Api_V2_Entities_Counterparty"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Locations"],"operationId":"deleteV2AccountsAccountIdLocationsIdCounterpartiesCounterpartyId"}},"/v2/accounts/{account_id}/contracts/effective":{"get":{"summary":"Contract in effect for the pair and kind","description":"The contract a document takes on the date: the default of the pair if in effect, otherwise the only one\nin effect. Otherwise `contract` is `null`, `candidates` — contracts in effect, the default first, then\nthe latest date first; none — empty. A contract whose our legal entity is no longer own in the account\nis never offered.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"our_legal_entity_id","description":"Our legal entity UUID","type":"string","required":true},{"in":"query","name":"counterparty_legal_entity_id","description":"Other side legal entity UUID","type":"string","required":true},{"in":"query","name":"kind","type":"string","enum":["transport_expedition","carriage","carriage_organization","handling_storage","vehicle_rent_with_crew","vehicle_rent","other"],"required":true},{"in":"query","name":"on","description":"Defaults to today","type":"string","format":"date","required":false}],"responses":{"200":{"description":"Contract in effect for the pair and kind","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"getV2AccountsAccountIdContractsEffective"}},"/v2/accounts/{account_id}/contracts/{id}/terminate":{"post":{"summary":"Terminate a contract","description":"Status `terminated` from `terminated_on` (today when omitted; not before `valid_from`). A future date is\nallowed: the contract stays in effect until then — see `terminates_on`. The default mark stays.\nTerminating again moves the date.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdContractsIdTerminate","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdContractsIdTerminate"}}],"responses":{"201":{"description":"Terminate a contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"postV2AccountsAccountIdContractsIdTerminate"}},"/v2/accounts/{account_id}/contracts/{id}/resume":{"post":{"summary":"Resume a terminated contract","description":"Status `active`, the termination date is cleared; the state follows the term again.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true}],"responses":{"201":{"description":"Resume a terminated contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"postV2AccountsAccountIdContractsIdResume"}},"/v2/accounts/{account_id}/contracts/{id}/make_default":{"post":{"summary":"Make the contract the default","description":"The default of the pair «our legal entity × other side × kind»: the former default loses the mark in\nthe same transaction. A terminated or expired contract can be the default — `effective` skips it.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true}],"responses":{"201":{"description":"Make the contract the default","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"postV2AccountsAccountIdContractsIdMakeDefault"}},"/v2/accounts/{account_id}/contracts":{"get":{"summary":"List contracts","description":"Contracts of the account, the latest date first. Filters by the kind, the sides, the default mark and\nthe state today; `expiring_within_days` — in effect today and ending within the days by the term or by\na future termination. `q` — number (`15/А` finds `15-a`), name, other side name or INN.\n`external_system` and `external_id` — by an external key of the account, among contracts only.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"kind","type":"string","enum":["transport_expedition","carriage","carriage_organization","handling_storage","vehicle_rent_with_crew","vehicle_rent","other"],"required":false},{"in":"query","name":"our_legal_entity_id","description":"Our legal entity UUID","type":"string","required":false},{"in":"query","name":"counterparty_legal_entity_id","description":"Other side legal entity UUID","type":"string","required":false},{"in":"query","name":"is_default","type":"boolean","required":false},{"in":"query","name":"state","description":"State today","type":"string","enum":["pending","effective","expiring","expired","terminated"],"required":false},{"in":"query","name":"expiring_within_days","description":"Ending within the days","type":"integer","format":"int32","minimum":0,"maximum":365,"required":false},{"in":"query","name":"q","description":"Number, name, other side name or INN","type":"string","required":false},{"in":"query","name":"external_system","description":"External key system of the account","type":"string","enum":["onec","tms","wms","csv","other"],"required":false},{"in":"query","name":"external_id","description":"External key of the account, exact","type":"string","required":false}],"responses":{"200":{"description":"List contracts","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Contracts"],"operationId":"getV2AccountsAccountIdContracts"},"post":{"summary":"Create a contract","description":"Creates a contract of the account. Our legal entity — own in the account (the only one is substituted\nwhen omitted), the other side — a legal entity of the account counterparties; another one is refused\nwith 422 on its field. The name defaults to the kind, `valid_from` — to the date.\n\nResponse — 201 with `warnings` (`numberless_twin`, `organization_twin`): they do not prevent saving.\nRefusal: 409 `contract_exists` — the account already has a contract with these parties, number and date\n(`details.id`, `details.archived` — it is in the trash: restore it instead of a new one).\n`custom_fields` are keyed by the machine key — see `/custom_field_definitions`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdContracts","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdContracts"}}],"responses":{"201":{"description":"Create a contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"409":{"description":"The account already has this contract"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"postV2AccountsAccountIdContracts"}},"/v2/accounts/{account_id}/contracts/{id}":{"get":{"description":"Get a contract","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Contracts"],"operationId":"getV2AccountsAccountIdContractsId"},"patch":{"summary":"Update a contract","description":"Partial update: omitted fields stay. A side is checked when it changes — a side that later left the\naccount does not block other edits. Changing the parties, number or date onto another contract —\n409 `contract_exists`. Response — with `warnings`. `custom_fields` merge.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdContractsId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdContractsId"}}],"responses":{"200":{"description":"Update a contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"409":{"description":"Another contract has these parties, number and date"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"patchV2AccountsAccountIdContractsId"},"delete":{"summary":"Delete a contract","description":"Soft delete to the trash of the account; the default mark goes with it.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"403":{"description":"Forbidden — no destroy permission"},"404":{"description":"Not found"}},"tags":["Contracts"],"operationId":"deleteV2AccountsAccountIdContractsId"}},"/v2/accounts/{account_id}/contracts/{id}/external_refs":{"post":{"summary":"Add an external key","description":"A key of the contract in 1C or another system of the account — a repeated import with it updates the contract. Who may edit the contract. Refusals: 409 `ref_taken` — the account already has this key on another contract (a location may have the same key).","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdContractsIdExternalRefs","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdContractsIdExternalRefs"}}],"responses":{"201":{"description":"Add an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Key taken"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"postV2AccountsAccountIdContractsIdExternalRefs"}},"/v2/accounts/{account_id}/contracts/{id}/external_refs/{ref_id}":{"delete":{"summary":"Remove an external key","description":"Hard delete; the journal of the contract keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"in":"path","name":"ref_id","description":"External key UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Contracts"],"operationId":"deleteV2AccountsAccountIdContractsIdExternalRefsRefId"}},"/v2/accounts/{account_id}/contracts/{id}/files":{"post":{"summary":"Upload a file to the contract","description":"Multipart `file`. Who may edit the contract. Types, size and number — rules of the contract; refusal — 422 `validation_error` on the field `file`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdContractsIdFiles","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdContractsIdFiles"}}],"responses":{"201":{"description":"Upload a file to the contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Contracts"],"operationId":"postV2AccountsAccountIdContractsIdFiles"}},"/v2/accounts/{account_id}/contracts/{id}/files/{file_id}":{"get":{"summary":"Download a file of the contract","description":"Streamed with the rights of the contract: `Cache-Control: private, no-store`; PDF and raster images — inline, other types — attachment.","produces":["application/octet-stream"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"in":"path","name":"file_id","description":"File ID","type":"string","required":true}],"responses":{"200":{"description":"Download a file of the contract"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Contracts"],"operationId":"getV2AccountsAccountIdContractsIdFilesFileId"},"delete":{"summary":"Delete a file of the contract","description":"Hard delete; the journal of the contract keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Contract UUID","type":"string","required":true},{"in":"path","name":"file_id","description":"File ID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a file of the contract","schema":{"$ref":"#/definitions/Api_V2_Entities_Contract"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Contracts"],"operationId":"deleteV2AccountsAccountIdContractsIdFilesFileId"}},"/v2/accounts/{account_id}/cargo_templates":{"get":{"summary":"List cargo templates","description":"Cargo templates of the account by name. Active only by default; `status=archived` — the archive.\n`owner_legal_entity_id` — only an owner the key sees (another one gives an empty list). `q` — name, code,\nHS heading or external key. `external_system` and `external_id` — a template by its key in 1C or another\nsystem of the account (keys of locations and contracts are not searched).\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"status","type":"string","default":"active","enum":["active","archived"],"required":false},{"in":"query","name":"owner_legal_entity_id","description":"Owner legal entity UUID","type":"string","required":false},{"in":"query","name":"package_type_code","type":"string","required":false},{"in":"query","name":"dangerous","type":"boolean","required":false},{"in":"query","name":"temperature_controlled","type":"boolean","required":false},{"in":"query","name":"gov_tracked","type":"boolean","required":false},{"in":"query","name":"q","description":"Name, code, HS heading or external key","type":"string","required":false},{"in":"query","name":"external_system","description":"External key system of the account","type":"string","enum":["onec","tms","wms","csv","other"],"required":false},{"in":"query","name":"external_id","description":"External key of the account, exact","type":"string","required":false}],"responses":{"200":{"description":"List cargo templates","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Cargo templates"],"operationId":"getV2AccountsAccountIdCargoTemplates"},"post":{"summary":"Create a cargo template","description":"Creates a template of the account: one place of cargo. The owner — a legal entity of the account\ncounterparties, another one is refused with 422 on its field. Response — 201 with `warnings`\n(`name_twin` — the owner already has a template with this name; `details.id` — if the key reads it).\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdCargoTemplates","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCargoTemplates"}}],"responses":{"201":{"description":"Create a cargo template","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"422":{"description":"Validation error"}},"tags":["Cargo templates"],"operationId":"postV2AccountsAccountIdCargoTemplates"}},"/v2/accounts/{account_id}/cargo_templates/pick":{"get":{"summary":"Cargo templates to pick for an order line","description":"Active templates of the account the key reads, without the archive and the trash. Templates of\n`owner_legal_entity_id` go first, then the rest by name; an owner the key does not see is ignored (the order\nwould tell which hidden templates are its). `q` — name, code or HS heading. Not paginated: `limit` 1–50.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"q","description":"Name, code or HS heading","type":"string","required":false},{"in":"query","name":"owner_legal_entity_id","description":"Owner legal entity UUID — its templates go first","type":"string","required":false},{"in":"query","name":"limit","type":"integer","format":"int32","default":30,"minimum":1,"maximum":50,"required":false}],"responses":{"200":{"description":"Cargo templates to pick for an order line","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplateOption"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Cargo templates"],"operationId":"getV2AccountsAccountIdCargoTemplatesPick"}},"/v2/accounts/{account_id}/cargo_templates/{id}":{"get":{"description":"Get a cargo template","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a cargo template","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Cargo templates"],"operationId":"getV2AccountsAccountIdCargoTemplatesId"},"patch":{"summary":"Update a cargo template","description":"Partial update: omitted fields stay; a list is replaced as a whole. Response — with `warnings`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdCargoTemplatesId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdCargoTemplatesId"}}],"responses":{"200":{"description":"Update a cargo template","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Cargo templates"],"operationId":"patchV2AccountsAccountIdCargoTemplatesId"},"delete":{"summary":"Delete a cargo template","description":"Soft delete to the trash of the account.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a cargo template","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"403":{"description":"Forbidden — no destroy permission"},"404":{"description":"Not found"}},"tags":["Cargo templates"],"operationId":"deleteV2AccountsAccountIdCargoTemplatesId"}},"/v2/accounts/{account_id}/cargo_templates/{id}/archive":{"post":{"summary":"Archive a cargo template","description":"The template stays in the account but is not offered for new orders.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true}],"responses":{"201":{"description":"Archive a cargo template","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"}},"tags":["Cargo templates"],"operationId":"postV2AccountsAccountIdCargoTemplatesIdArchive"}},"/v2/accounts/{account_id}/cargo_templates/{id}/restore":{"post":{"description":"Restore a cargo template from the archive","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true}],"responses":{"201":{"description":"Restore a cargo template from the archive","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Cargo templates"],"operationId":"postV2AccountsAccountIdCargoTemplatesIdRestore"}},"/v2/accounts/{account_id}/cargo_templates/{id}/totals":{"get":{"summary":"Totals for a number of places","description":"Masses, volume and pallets × places (bulk cargo — one place, values as is). 422 `totals_out_of_format`\n— a total does not fit the e-waybill format (`details.field`).\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true},{"in":"query","name":"places","type":"integer","format":"int32","minimum":1,"maximum":9999,"required":true}],"responses":{"200":{"description":"Totals for a number of places"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Out of format"}},"tags":["Cargo templates"],"operationId":"getV2AccountsAccountIdCargoTemplatesIdTotals"}},"/v2/accounts/{account_id}/cargo_templates/{id}/external_refs":{"post":{"summary":"Add an external key","description":"A key of the template in 1C or another system of the account — a repeated import with it updates the template. Who may edit the template. Refusals: 409 `ref_taken` — the account already has this key on another template (a location or a contract may have the same key).","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCargoTemplatesIdExternalRefs","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCargoTemplatesIdExternalRefs"}}],"responses":{"201":{"description":"Add an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Key taken"},"422":{"description":"Validation error"}},"tags":["Cargo templates"],"operationId":"postV2AccountsAccountIdCargoTemplatesIdExternalRefs"}},"/v2/accounts/{account_id}/cargo_templates/{id}/external_refs/{ref_id}":{"delete":{"summary":"Remove an external key","description":"Hard delete; the journal of the template keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Cargo template UUID","type":"string","required":true},{"in":"path","name":"ref_id","description":"External key UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_CargoTemplate"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Cargo templates"],"operationId":"deleteV2AccountsAccountIdCargoTemplatesIdExternalRefsRefId"}},"/v2/accounts/{account_id}/orders":{"get":{"summary":"List orders","description":"Orders of the account, the latest first, with stops and lines. `customer_legal_entity_id` — only a customer\nthe key sees (another one gives an empty list). `q` — our number, number of the customer, customer name or\nINN. `external_system` and `external_id` — an order by its key in 1C or another system of the account.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"status","type":"string","enum":["draft","accepted","planning","planned","in_transit","delivered","closed","cancelled"],"required":false},{"in":"query","name":"customer_legal_entity_id","description":"Customer legal entity UUID","type":"string","required":false},{"in":"query","name":"manager_user_id","description":"Manager user UUID","type":"string","required":false},{"in":"query","name":"q","description":"Number, number of the customer, customer name or INN","type":"string","required":false},{"in":"query","name":"external_system","description":"External key system of the account","type":"string","enum":["onec","tms","wms","csv","other"],"required":false},{"in":"query","name":"external_id","description":"External key of the account, exact","type":"string","required":false}],"responses":{"200":{"description":"List orders","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Orders"],"operationId":"getV2AccountsAccountIdOrders"},"post":{"summary":"Create an order","description":"Creates a draft with stops and lines in one transaction. Substituted when omitted: our legal entity, the\npayer, the contract (by the pair), the party, loader and contact of a stop (by the location), the route of a\nline, the description of a line from `cargo_template_id`, conditions from the lines. A reference the key\ndoes not read — 422 `inaccessible` on its field. Response — 201 with `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdOrders","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdOrders"}}],"responses":{"201":{"description":"Create an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"422":{"description":"Validation error"}},"tags":["Orders"],"operationId":"postV2AccountsAccountIdOrders"}},"/v2/accounts/{account_id}/orders/{id}":{"get":{"description":"Get an order","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true}],"responses":{"200":{"description":"Get an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Orders"],"operationId":"getV2AccountsAccountIdOrdersId"},"patch":{"summary":"Update an order","description":"Partial update: omitted fields stay; `stops` and `lines`, when passed, are the full lists (`id` keeps an\nitem). An accepted order must keep a loading, an unloading and a line. The status is not a field — see\n`accept`, `cancel`, `reopen`. Response — with `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdOrdersId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdOrdersId"}}],"responses":{"200":{"description":"Update an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Orders"],"operationId":"patchV2AccountsAccountIdOrdersId"},"delete":{"summary":"Delete an order","description":"Soft delete to the trash of the account; the number stays taken.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"403":{"description":"Forbidden — no destroy permission"},"404":{"description":"Not found"}},"tags":["Orders"],"operationId":"deleteV2AccountsAccountIdOrdersId"}},"/v2/accounts/{account_id}/orders/{id}/accept":{"post":{"summary":"Accept an order","description":"Draft → accepted. The order must have a loading, an unloading and a cargo line (422 on `stops`/`lines`); another status — 422 `transition_not_allowed` on `status`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true}],"responses":{"201":{"description":"Accept an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Orders"],"operationId":"postV2AccountsAccountIdOrdersIdAccept"}},"/v2/accounts/{account_id}/orders/{id}/cancel":{"post":{"summary":"Cancel an order","description":"Draft or accepted → cancelled, with a reason.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdOrdersIdCancel","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdOrdersIdCancel"}}],"responses":{"201":{"description":"Cancel an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed or no reason"}},"tags":["Orders"],"operationId":"postV2AccountsAccountIdOrdersIdCancel"}},"/v2/accounts/{account_id}/orders/{id}/reopen":{"post":{"summary":"Reopen a cancelled order","description":"Cancelled → draft; the reason leaves the order (the journal keeps it).","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true}],"responses":{"201":{"description":"Reopen a cancelled order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Orders"],"operationId":"postV2AccountsAccountIdOrdersIdReopen"}},"/v2/accounts/{account_id}/orders/{id}/repeat":{"post":{"summary":"Repeat an order","description":"A new draft by the order: the same parties, locations, cargo and conditions, without numbers, dates\n(windows, delivery date) and external keys; the manager — the key user; the contract is picked anew.\nA reference the key does not read — 422 `inaccessible`, nothing is created. Response — 201.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true}],"responses":{"201":{"description":"Repeat an order","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Orders"],"operationId":"postV2AccountsAccountIdOrdersIdRepeat"}},"/v2/accounts/{account_id}/orders/{id}/document_plan":{"get":{"summary":"Document plan of an order","description":"Lines grouped by loading and unloading locations, shipper and consignee — one group is one future\ne-waybill (ЭТрН). A hint, not a document. References — by what the key reads (`*_hidden`).\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true}],"responses":{"200":{"description":"Document plan of an order"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Orders"],"operationId":"getV2AccountsAccountIdOrdersIdDocumentPlan"}},"/v2/accounts/{account_id}/orders/{id}/external_refs":{"post":{"summary":"Add an external key","description":"A key of the order in 1C or another system of the account — a repeated import with it updates the order. Who may edit the order. Refusals: 409 `ref_taken` — the account already has this key on another order (a record of another type may have the same key).","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdOrdersIdExternalRefs","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdOrdersIdExternalRefs"}}],"responses":{"201":{"description":"Add an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Key taken"},"422":{"description":"Validation error"}},"tags":["Orders"],"operationId":"postV2AccountsAccountIdOrdersIdExternalRefs"}},"/v2/accounts/{account_id}/orders/{id}/external_refs/{ref_id}":{"delete":{"summary":"Remove an external key","description":"Hard delete; the journal of the order keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Order UUID","type":"string","required":true},{"in":"path","name":"ref_id","description":"External key UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_Order"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Orders"],"operationId":"deleteV2AccountsAccountIdOrdersIdExternalRefsRefId"}},"/v2/accounts/{account_id}/trips/from_orders":{"post":{"summary":"Plan orders into a trip","description":"A trip from accepted orders (§6.2): stops by the order stops, cargo lines by the remaining places of the\nlines, conditions in common. An order already planned — into its live trip when it is the only one. Who may\ncreate trips and edit EACH order; `with_request` — also create a draft request to a carrier (who may create\nrequests). Refusal — 422 on `order_ids`. Response — the trip and `warnings`: 201 — a new trip, 200 — the\nexisting one (the request goes to it).\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdTripsFromOrders","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdTripsFromOrders"}}],"responses":{"201":{"description":"A new trip","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"200":{"description":"The existing trip of the order","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Order not found"},"422":{"description":"Not allowed"}},"tags":["Trips"],"operationId":"postV2AccountsAccountIdTripsFromOrders"}},"/v2/accounts/{account_id}/trips/{id}/cancel":{"post":{"summary":"Cancel a trip","description":"Plan or confirmed → cancelled, with a reason. Requests are withdrawn (drafts — cancelled), assignments end, the order lines are free again. Another status — 422 `transition_not_allowed` on `status`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Trip UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdTripsIdCancel","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdTripsIdCancel"}}],"responses":{"201":{"description":"Cancel a trip","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed or no reason"}},"tags":["Trips"],"operationId":"postV2AccountsAccountIdTripsIdCancel"}},"/v2/accounts/{account_id}/trips":{"get":{"summary":"List trips","description":"Trips of the account, the latest first, with stops, cargo lines and assignments. `order_id` — trips of an\norder the key reads (another one gives an empty list). `q` — our number, city of a visible location; to the\nkey that reads requests — also the request number, number at the carrier, carrier name or INN.\n`external_system` and `external_id` — a trip by its key in another system of the account.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"status","type":"string","enum":["plan","confirmed","in_transit","delivered","closed","cancelled","no_show"],"required":false},{"in":"query","name":"manager_user_id","description":"Manager user UUID","type":"string","required":false},{"in":"query","name":"order_id","description":"Order UUID","type":"string","required":false},{"in":"query","name":"q","description":"Number, city, request number, carrier","type":"string","required":false},{"in":"query","name":"external_system","description":"External key system of the account","type":"string","enum":["onec","tms","wms","csv","other"],"required":false},{"in":"query","name":"external_id","description":"External key of the account, exact","type":"string","required":false}],"responses":{"200":{"description":"List trips","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Trips"],"operationId":"getV2AccountsAccountIdTrips"},"post":{"summary":"Create a trip","description":"Creates a trip in the plan with stops, cargo lines and assignments in one transaction. Substituted when\nomitted: our legal entity (the only own one), the manager (the key user), the contact of a stop (by the\nlocation). A reference the key does not read — 422 `inaccessible` on its field. To plan orders — use\n`POST /trips/from_orders`. Response — 201 with `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdTrips","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdTrips"}}],"responses":{"201":{"description":"Create a trip","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"422":{"description":"Validation error"}},"tags":["Trips"],"operationId":"postV2AccountsAccountIdTrips"}},"/v2/accounts/{account_id}/trips/{id}":{"get":{"description":"Get a trip","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Trip UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a trip","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Trips"],"operationId":"getV2AccountsAccountIdTripsId"},"patch":{"summary":"Update a trip","description":"Partial update: omitted fields stay; `stops`, `cargo_lines` and `assignments`, when passed, are the full\nlists (`id` keeps an item). What may change depends on the status (a confirmed trip keeps its route, a\ncancelled one — only notes). The status is not a field — see `cancel`. Response — with `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Trip UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdTripsId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdTripsId"}}],"responses":{"200":{"description":"Update a trip","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Trips"],"operationId":"patchV2AccountsAccountIdTripsId"},"delete":{"summary":"Delete a trip","description":"Soft delete to the trash of the account — only a trip in the plan without a sent or confirmed request; the number stays taken, the order lines are free again.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Trip UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a trip","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"403":{"description":"Forbidden — no destroy permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Trips"],"operationId":"deleteV2AccountsAccountIdTripsId"}},"/v2/accounts/{account_id}/trips/{id}/external_refs":{"post":{"summary":"Add an external key","description":"A key of the trip in 1C or another system of the account — a repeated import with it updates the trip. Who may edit the trip. Refusals: 409 `ref_taken` — the account already has this key on another trip (a record of another type may have the same key).","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Trip UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdTripsIdExternalRefs","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdTripsIdExternalRefs"}}],"responses":{"201":{"description":"Add an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Key taken"},"422":{"description":"Validation error"}},"tags":["Trips"],"operationId":"postV2AccountsAccountIdTripsIdExternalRefs"}},"/v2/accounts/{account_id}/trips/{id}/external_refs/{ref_id}":{"delete":{"summary":"Remove an external key","description":"Hard delete; the journal of the trip keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Trip UUID","type":"string","required":true},{"in":"path","name":"ref_id","description":"External key UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_Trip"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Trips"],"operationId":"deleteV2AccountsAccountIdTripsIdExternalRefsRefId"}},"/v2/accounts/{account_id}/carrier_requests/{id}/send":{"post":{"summary":"Send a request","description":"Draft → sent: the shipper title of the e-request (ЭЗЗ, format 5.01) is built, stored and queued to the EDI\noperator. Not ready — 422 `not_ready` on `base` with the list of missing fields (the same as `ezz.xml` of a\ndraft); another sent or confirmed request of the trip — 422 `active_request_exists`. A substituted owner\nof a location — in `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"201":{"description":"Send a request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdSend"}},"/v2/accounts/{account_id}/carrier_requests/{id}/confirm":{"post":{"summary":"Confirm a request","description":"Sent → confirmed by the carrier answer: the vehicle (a tractor or a truck), a trailer and up to two drivers\nbecome assignments of the trip. Vehicles and drivers — of the account, readable by the key. Errors — on\nthe fields of the body (`vehicle_id`, `driver_id` …).\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCarrierRequestsIdConfirm","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCarrierRequestsIdConfirm"}}],"responses":{"201":{"description":"Confirm a request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdConfirm"}},"/v2/accounts/{account_id}/carrier_requests/{id}/reject":{"post":{"summary":"Reject a request","description":"Sent → rejected by the carrier, with a reason. The trip stays in the plan; a new request — `renew`.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCarrierRequestsIdReject","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCarrierRequestsIdReject"}}],"responses":{"201":{"description":"Reject a request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdReject"}},"/v2/accounts/{account_id}/carrier_requests/{id}/withdraw":{"post":{"summary":"Withdraw a request","description":"Sent or confirmed → withdrawn. The trip stays in the plan; assignments of a confirmed request end.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"201":{"description":"Withdraw a request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdWithdraw"}},"/v2/accounts/{account_id}/carrier_requests/{id}/cancel":{"post":{"description":"Cancel a draft request","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"201":{"description":"Cancel a draft request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no status permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdCancel"}},"/v2/accounts/{account_id}/carrier_requests/{id}/renew":{"post":{"summary":"Renew a request","description":"A new draft for the same trip after a rejection or a withdrawal: the carrier, the contract and the rate are\nempty. One renewal per request — a repeated call returns the existing one (200). Response — 201.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"201":{"description":"Renew a request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdRenew"}},"/v2/accounts/{account_id}/carrier_requests/{id}/ezz.xml":{"get":{"summary":"E-request file (XML)","description":"The shipper title of the e-request (ЭЗЗ 5.01, windows-1251). A sent request — the stored file byte for\nbyte; a draft — built now, not ready — 422 `not_ready` with the missing fields. Not a draft without a\ntitle (cancelled draft) — 404. Who reads the request.\n","produces":["application/xml"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"200":{"description":"E-request file (XML)"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"422":{"description":"Not ready"}},"tags":["Carrier requests"],"operationId":"getV2AccountsAccountIdCarrierRequestsIdEzzXml"}},"/v2/accounts/{account_id}/carrier_requests/{id}/print.pdf":{"get":{"summary":"Print form (PDF)","description":"The same content as `ezz.xml` and a separate block with the rate; a draft — marked, with the missing fields. Who reads the request.","produces":["application/pdf"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"200":{"description":"Print form (PDF)"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Carrier requests"],"operationId":"getV2AccountsAccountIdCarrierRequestsIdPrintPdf"}},"/v2/accounts/{account_id}/carrier_requests":{"get":{"summary":"List carrier requests","description":"Requests of the account, the latest first. `trip_id` — requests of a trip; `carrier_legal_entity_id` — only a\ncarrier the key sees (another one gives an empty list). `q` — our number or the number at the carrier.\n`external_system` and `external_id` — a request by its key in another system of the account.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"status","type":"string","enum":["draft","sent","confirmed","rejected","withdrawn","cancelled"],"required":false},{"in":"query","name":"trip_id","description":"Trip UUID","type":"string","required":false},{"in":"query","name":"carrier_legal_entity_id","description":"Carrier legal entity UUID","type":"string","required":false},{"in":"query","name":"q","description":"Our number or number at the carrier","type":"string","required":false},{"in":"query","name":"external_system","description":"External key system of the account","type":"string","enum":["onec","tms","wms","csv","other"],"required":false},{"in":"query","name":"external_id","description":"External key of the account, exact","type":"string","required":false}],"responses":{"200":{"description":"List carrier requests","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["Carrier requests"],"operationId":"getV2AccountsAccountIdCarrierRequests"},"post":{"summary":"Create a carrier request","description":"A draft request to a carrier for a trip in the plan. Substituted when omitted: our legal entity, the contract\n(by the pair), the basis, the currency, the signatory. A reference the key does not read — 422 `inaccessible`\non its field. Response — 201 with `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdCarrierRequests","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCarrierRequests"}}],"responses":{"201":{"description":"Create a carrier request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no create permission"},"422":{"description":"Validation error"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequests"}},"/v2/accounts/{account_id}/carrier_requests/{id}":{"get":{"description":"Get a carrier request","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a carrier request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Carrier requests"],"operationId":"getV2AccountsAccountIdCarrierRequestsId"},"patch":{"summary":"Update a carrier request","description":"Partial update. A draft — every field; a sent request — only the number at the carrier, notes and the\nanswer deadline; later — notes (422 on the locked field). A new carrier or our legal entity picks the\ncontract anew (warnings). The status is not a field — see the actions. Response — with `warnings`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdCarrierRequestsId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdCarrierRequestsId"}}],"responses":{"200":{"description":"Update a carrier request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no update permission"},"404":{"description":"Not found"},"422":{"description":"Validation error"}},"tags":["Carrier requests"],"operationId":"patchV2AccountsAccountIdCarrierRequestsId"},"delete":{"summary":"Delete a carrier request","description":"Soft delete to the trash of the account — only a draft; the number stays taken.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Delete a carrier request","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"403":{"description":"Forbidden — no destroy permission"},"404":{"description":"Not found"},"422":{"description":"Not allowed"}},"tags":["Carrier requests"],"operationId":"deleteV2AccountsAccountIdCarrierRequestsId"}},"/v2/accounts/{account_id}/carrier_requests/{id}/external_refs":{"post":{"summary":"Add an external key","description":"A key of the request in 1C or another system of the account — a repeated import with it updates the request. Who may edit the request. Refusals: 409 `ref_taken` — the account already has this key on another request (a record of another type may have the same key).","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true},{"name":"postV2AccountsAccountIdCarrierRequestsIdExternalRefs","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdCarrierRequestsIdExternalRefs"}}],"responses":{"201":{"description":"Add an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Key taken"},"422":{"description":"Validation error"}},"tags":["Carrier requests"],"operationId":"postV2AccountsAccountIdCarrierRequestsIdExternalRefs"}},"/v2/accounts/{account_id}/carrier_requests/{id}/external_refs/{ref_id}":{"delete":{"summary":"Remove an external key","description":"Hard delete; the journal of the request keeps the record.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Request UUID","type":"string","required":true},{"in":"path","name":"ref_id","description":"External key UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized"},"204":{"description":"Remove an external key","schema":{"$ref":"#/definitions/Api_V2_Entities_CarrierRequest"}},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["Carrier requests"],"operationId":"deleteV2AccountsAccountIdCarrierRequestsIdExternalRefsRefId"}},"/v2/accounts/{account_id}/tms_documents":{"get":{"summary":"List TMS documents","description":"Documents of the account, the latest first, with titles. `trip_id`, `carrier_request_id` — documents of a trip or a request.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"trip_id","description":"Trip UUID","type":"string","required":false},{"in":"query","name":"carrier_request_id","description":"Request UUID","type":"string","required":false},{"in":"query","name":"kind","type":"string","enum":["ezz"],"required":false},{"in":"query","name":"status","type":"string","enum":["draft","sent","delivered","signed","rejected","annulled"],"required":false}],"responses":{"200":{"description":"List TMS documents","schema":{"$ref":"#/definitions/Api_V2_Entities_TmsDocument"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden — no read permission"}},"tags":["TMS documents"],"operationId":"getV2AccountsAccountIdTmsDocuments"}},"/v2/accounts/{account_id}/tms_documents/{id}":{"get":{"description":"Get a TMS document","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a TMS document","schema":{"$ref":"#/definitions/Api_V2_Entities_TmsDocument"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["TMS documents"],"operationId":"getV2AccountsAccountIdTmsDocumentsId"}},"/v2/accounts/{account_id}/tms_documents/{id}/titles/{title_id}/file":{"get":{"summary":"Download a title file","description":"The file of the title as it was sent — byte for byte (the signature is checked by bytes): `Cache-Control: private, no-store`.","produces":["application/xml"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Document UUID","type":"string","required":true},{"in":"path","name":"title_id","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"Download a title file"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"tags":["TMS documents"],"operationId":"getV2AccountsAccountIdTmsDocumentsIdTitlesTitleIdFile"}},"/v2/accounts/{account_id}/comments":{"get":{"summary":"List discussions","description":"Returns discussion threads for a subject, newest first.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Page number","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Number of results per page (1–100), default: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"subject_type","description":"Subject class name, e.g. Document or ProcedureRun","type":"string","required":true},{"in":"query","name":"subject_id","description":"Subject UUID","type":"string","required":true},{"in":"query","name":"status","description":"Filter: open (default), resolved, or all","type":"string","default":"open","enum":["open","resolved","all"],"required":false}],"responses":{"200":{"description":"List discussions","schema":{"$ref":"#/definitions/Api_V2_Entities_CommentThread"}}},"tags":["Comments"],"operationId":"getV2AccountsAccountIdComments"},"post":{"summary":"Start a discussion","description":"Creates a new discussion thread on a subject.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdComments","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdComments"}}],"responses":{"201":{"description":"Start a discussion","schema":{"$ref":"#/definitions/Api_V2_Entities_CommentThread"}}},"tags":["Comments"],"operationId":"postV2AccountsAccountIdComments"}},"/v2/accounts/{account_id}/comments/{id}/resolve":{"post":{"summary":"Resolve a discussion","description":"Marks a discussion as resolved.","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true}],"responses":{"201":{"description":"Resolve a discussion","schema":{"$ref":"#/definitions/Api_V2_Entities_CommentThread"}}},"tags":["Comments"],"operationId":"postV2AccountsAccountIdCommentsIdResolve"},"delete":{"summary":"Reopen a discussion","description":"Returns a resolved discussion back to work.","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true}],"responses":{"200":{"description":"Reopen a discussion","schema":{"$ref":"#/definitions/Api_V2_Entities_CommentThread"}}},"tags":["Comments"],"operationId":"deleteV2AccountsAccountIdCommentsIdResolve"}},"/v2/accounts/{account_id}/folders":{"get":{"summary":"Список папок","description":"Возвращает постраничный список папок в аккаунте.\n\nПо умолчанию возвращает **корневые папки** (без родителя). Передайте `parent_id` для получения дочерних папок.\n\nПолнотекстовый поиск доступен через параметр `q` (без учёта регистра, частичное совпадение).\n\n**Сортировка:** по умолчанию `name asc` (по алфавиту).\n\n**Пагинация:** через параметры `page` и `limit`. Ответ содержит `meta.pagination`.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"query","name":"page","description":"Номер страницы","type":"integer","format":"int32","required":false},{"in":"query","name":"limit","description":"Количество результатов на странице, по умолчанию: 20","type":"integer","format":"int32","minimum":1,"maximum":100,"required":false},{"in":"query","name":"parent_id","description":"UUID родительской папки. Если не указан, возвращает корневые папки","type":"string","required":false},{"in":"query","name":"status","description":"Фильтр по статусу. `active` — активные, `discarded` — удалённые, `all` — все","type":"string","default":"active","enum":["active","discarded","all"],"required":false},{"in":"query","name":"q","description":"Полнотекстовый поиск по названию папки (без учёта регистра, частичное совпадение)","type":"string","required":false},{"in":"query","name":"sort_by","description":"Поле сортировки","type":"string","default":"name","enum":["name","created_at","updated_at"],"required":false},{"in":"query","name":"sort_order","description":"Направление сортировки","type":"string","default":"asc","enum":["asc","desc"],"required":false}],"responses":{"200":{"description":"List folders","schema":{"$ref":"#/definitions/Api_V2_Entities_Folder"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no access to this account"}},"tags":["Folders"],"operationId":"getV2AccountsAccountIdFolders"},"post":{"summary":"Создать папку","description":"Создаёт новую папку в аккаунте.\n\n**Вложенность:** Передайте `parent_id` для создания подпапки внутри существующей папки. Если не указан, создаётся корневая папка.\n\n**Идемпотентность:** Поддерживает заголовок `Idempotency-Key`.\n\n**Права доступа:** Требуется разрешение `manage` на папки.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdFolders","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdFolders"}}],"responses":{"201":{"description":"Create a folder","schema":{"$ref":"#/definitions/Api_V2_Entities_Folder"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission on folders"},"422":{"description":"Validation error — missing name or invalid parent"}},"tags":["Folders"],"operationId":"postV2AccountsAccountIdFolders"}},"/v2/accounts/{account_id}/folders/{id}":{"get":{"summary":"Получить папку","description":"Возвращает одну папку с подробной информацией.\n\nВ отличие от списка, ответ включает поле `description`.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Folder UUID","type":"string","required":true}],"responses":{"200":{"description":"Get a folder","schema":{"$ref":"#/definitions/Api_V2_Entities_Folder"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no read permission"},"404":{"description":"Not found — folder does not exist or belongs to another account"}},"tags":["Folders"],"operationId":"getV2AccountsAccountIdFoldersId"},"patch":{"summary":"Обновить папку","description":"Частично обновляет папку. Изменяются только переданные поля — остальные остаются без изменений.\n\n**Перемещение папок:**\n- Передайте `parent_id` с UUID для перемещения папки внутрь другой папки\n- Передайте `parent_id: null` для перемещения в корень\n- Не передавайте `parent_id` если не хотите менять расположение\n- Нельзя переместить папку в саму себя или в собственного потомка\n\nИзменение пишется в журнал действий записью `updated` со строками изменённых полей; смена родителя — строкой поля `ancestry`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Folder UUID","type":"string","required":true},{"name":"patchV2AccountsAccountIdFoldersId","in":"body","required":true,"schema":{"$ref":"#/definitions/patchV2AccountsAccountIdFoldersId"}}],"responses":{"200":{"description":"Update a folder","schema":{"$ref":"#/definitions/Api_V2_Entities_Folder"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found — folder does not exist or belongs to another account"},"422":{"description":"Validation error — invalid parent or circular reference"}},"tags":["Folders"],"operationId":"patchV2AccountsAccountIdFoldersId"},"delete":{"summary":"Удалить папку (soft delete)","description":"Мягко удаляет папку вместе со всеми подпапками и их документами.\n\nПосле удаления папка не отображается в списке по умолчанию (статус `active`), но доступна при `status=discarded` или `status=all`.\n","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Folder UUID","type":"string","required":true}],"responses":{"401":{"description":"Unauthorized — missing or invalid token"},"204":{"description":"Discard a folder (soft delete)","schema":{"$ref":"#/definitions/Api_V2_Entities_Folder"}},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found"}},"tags":["Folders"],"operationId":"deleteV2AccountsAccountIdFoldersId"}},"/v2/accounts/{account_id}/folders/{id}/restore":{"post":{"summary":"Восстановить удалённую папку","description":"Восстанавливает ранее мягко удалённую папку вместе со всеми подпапками и их документами.\n\nПосле восстановления папка появляется в списке по умолчанию, а `discarded_at` устанавливается в `null`.\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","description":"Folder UUID","type":"string","required":true}],"responses":{"201":{"description":"Restore a discarded folder","schema":{"$ref":"#/definitions/Api_V2_Entities_Folder"}},"401":{"description":"Unauthorized — missing or invalid token"},"403":{"description":"Forbidden — no manage permission"},"404":{"description":"Not found — folder does not exist or was not discarded"}},"tags":["Folders"],"operationId":"postV2AccountsAccountIdFoldersIdRestore"}},"/v2/accounts/{account_id}/video_instructions/upload_url":{"post":{"description":"Get presigned upload URL for video file","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"header","name":"Idempotency-Key","description":"UUID v4","type":"string","required":true},{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdVideoInstructionsUploadUrl","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdVideoInstructionsUploadUrl"}}],"responses":{"201":{"description":"Get presigned upload URL for video file"}},"tags":["Video Instructions"],"operationId":"postV2AccountsAccountIdVideoInstructionsUploadUrl"}},"/v2/accounts/{account_id}/video_instructions":{"post":{"description":"Create video instruction (starts pipeline)","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"header","name":"Idempotency-Key","type":"string","required":true},{"in":"path","name":"account_id","type":"string","required":true},{"name":"postV2AccountsAccountIdVideoInstructions","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdVideoInstructions"}}],"responses":{"201":{"description":"Create video instruction (starts pipeline)"}},"tags":["Video Instructions"],"operationId":"postV2AccountsAccountIdVideoInstructions"}},"/v2/accounts/{account_id}/video_instructions/{id}":{"get":{"description":"Get video instruction (full)","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true}],"responses":{"200":{"description":"Get video instruction (full)"}},"tags":["Video Instructions"],"operationId":"getV2AccountsAccountIdVideoInstructionsId"}},"/v2/accounts/{account_id}/video_instructions/{id}/status":{"get":{"description":"Lightweight pipeline status poll","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true}],"responses":{"200":{"description":"Lightweight pipeline status poll"}},"tags":["Video Instructions"],"operationId":"getV2AccountsAccountIdVideoInstructionsIdStatus"}},"/v2/accounts/{account_id}/video_instructions/{id}/regenerate":{"post":{"description":"Regenerate steps with optional new prompt version / LLM engine","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"header","name":"Idempotency-Key","type":"string","required":false},{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true},{"name":"postV2AccountsAccountIdVideoInstructionsIdRegenerate","in":"body","required":true,"schema":{"$ref":"#/definitions/postV2AccountsAccountIdVideoInstructionsIdRegenerate"}}],"responses":{"201":{"description":"Regenerate steps with optional new prompt version / LLM engine"}},"tags":["Video Instructions"],"operationId":"postV2AccountsAccountIdVideoInstructionsIdRegenerate"}},"/v2/accounts/{account_id}/video_instructions/{id}/steps":{"get":{"description":"List steps","produces":["application/json"],"parameters":[{"in":"path","name":"account_id","type":"string","required":true},{"in":"path","name":"id","type":"string","required":true}],"responses":{"200":{"description":"List steps"}},"tags":["Video Instructions"],"operationId":"getV2AccountsAccountIdVideoInstructionsIdSteps"}},"/v2/system/manifest":{"get":{"summary":"Манифест системы: модули, справочники, контракты, точки расширения","description":"Машиночитаемое описание платформы. Собирается из кода, версия — дайджест содержимого.","produces":["application/json"],"parameters":[{"in":"query","name":"projection","type":"string","default":"public","enum":["public","internal"],"required":false}],"responses":{"200":{"description":"Манифест системы: модули, справочники, контракты, точки расширения"}},"tags":["System"],"operationId":"getV2SystemManifest"}},"/v2/system/graph":{"get":{"summary":"Граф системы в формате {nodes, edges}","description":"Тот же материал, что в манифесте, в форме, которую понимает графовый островок портала.","produces":["application/json"],"parameters":[{"in":"query","name":"projection","type":"string","default":"public","enum":["public","internal"],"required":false},{"in":"query","name":"root","description":"Идентификатор узла, вокруг которого строится подграф","type":"string","required":false},{"in":"query","name":"depth","type":"integer","format":"int32","default":2,"minimum":1,"maximum":3,"required":false},{"in":"query","name":"kinds","description":"Виды узлов через запятую, например module,contract","type":"string","required":false}],"responses":{"200":{"description":"Граф системы в формате {nodes, edges}"}},"tags":["System"],"operationId":"getV2SystemGraph"}},"/v2/me":{"get":{"summary":"Получить информацию о токене","description":"Возвращает аккаунт и пользователя, связанные с текущим токеном.\n\n**Сценарий использования:** После получения API-ключа или JWT-токена вызовите этот эндпоинт, чтобы узнать `account_id` для использования в других эндпоинтах.\n\nДля API-ключа возвращается аккаунт, к которому привязан ключ.\nДля JWT-токена возвращается первый доступный аккаунт пользователя.\n","produces":["application/json"],"responses":{"200":{"description":"Get current token info"},"401":{"description":"Unauthorized — missing or invalid token"}},"tags":["Authentication"],"operationId":"getV2Me"}}},"definitions":{"Api_V2_Entities_Document":{"type":"object","properties":{"id":{"type":"string","description":"UUID документа"},"name":{"type":"string","description":"Название документа"},"type":{"type":"string","enum":["single_page_document","multi_page_document","embedded_document","diagram_document","procedure"],"description":"Тип документа"},"folder_id":{"type":"string","description":"UUID родительской папки (null если не в папке)"},"content_format":{"type":"string","description":"Формат кодирования контента. Всегда \"markdown\""},"content":{"type":"string","description":"Содержимое документа в формате Markdown. Поддерживает заголовки, жирный, курсив, зачёркнутый, ссылки, списки (маркированные, нумерованные, чеклисты), цитаты, блоки кода, таблицы и горизонтальные линии"},"description":{"type":"string","description":"Краткое описание документа в формате Markdown"},"anchors":{"type":"array","description":"List of heading blocks with their IDs. Use `id` to build in-document anchor links to a specific section."},"full_width":{"type":"boolean","description":"Full-width mode (single_page_document only)"},"full_width_min":{"type":"integer","format":"int32","description":"Minimum text column width in full-width mode, px; null — no limit (single_page_document only)"},"full_width_max":{"type":"integer","format":"int32","description":"Maximum text column width in full-width mode, px; null — no limit (single_page_document only)"},"discarded_at":{"type":"string","format":"date-time","description":"Метка времени мягкого удаления (null если активен)"},"cover_image":{"type":"object","description":"URL обложки документа (null если нет изображения)"},"owner":{"type":"object","description":"Создатель документа"},"custom_fields":{"type":"object","description":"Organization custom fields, keyed by the machine key. Choice values expand to {id, label, color}, relations to {id, type, label}. See /custom_field_definitions"},"created_at":{"type":"string","format":"date-time","description":"Дата создания (ISO 8601)"},"updated_at":{"type":"string","format":"date-time","description":"Дата последнего изменения (ISO 8601)"}},"description":"Api_V2_Entities_Document model"},"postV2AccountsAccountIdDocuments":{"type":"object","properties":{"name":{"type":"string","description":"Название документа (обязательно)"},"type":{"type":"string","description":"Тип документа. Определяет редактор и режим отображения","enum":["single_page_document","multi_page_document","embedded_document","diagram_document","procedure"]},"folder_id":{"type":"string","description":"UUID родительской папки. Если не указан, документ создаётся в корне"},"content":{"type":"string","description":"Содержимое документа в Markdown. Пример: `\"# Привет\\n\\nАбзац с **жирным** текстом\\n\\n- Пункт 1\\n- Пункт 2\"`"},"description":{"type":"string","description":"Краткое описание документа в Markdown. Пример: `\"**Важный** документ по безопасности\"`"},"full_width":{"type":"boolean","description":"Full-width mode: the text column stretches to the window width (single_page_document only)"},"full_width_min":{"type":"integer","format":"int32","description":"Minimum width of the text column in full-width mode, px (320..4000). On a narrower window the column takes the whole width. `null` removes the limit. Stored but not applied while `full_width` is off (single_page_document only)"},"full_width_max":{"type":"integer","format":"int32","description":"Maximum width of the text column in full-width mode, px (320..4000); a wider window centres the column. Must not be less than `full_width_min`. `null` removes the limit. Stored but not applied while `full_width` is off (single_page_document only)"}},"required":["name","type"],"description":"Create a document"},"patchV2AccountsAccountIdDocumentsId":{"type":"object","properties":{"name":{"type":"string","description":"Новое название документа"},"folder_id":{"type":"string","description":"UUID новой родительской папки. Передайте `null` для удаления из папки"},"content":{"type":"string","description":"Новое содержимое документа в Markdown (заменяет весь контент целиком)"},"description":{"type":"string","description":"Новое описание документа в Markdown"},"custom_fields":{"type":"object","description":"Organization custom fields, keyed by the machine key. Merge semantics: only the given keys change, `null` clears one. Unknown or inactive key → 422"},"full_width":{"type":"boolean","description":"Full-width mode: the text column stretches to the window width (single_page_document only)"},"full_width_min":{"type":"integer","format":"int32","description":"Minimum width of the text column in full-width mode, px (320..4000). On a narrower window the column takes the whole width. `null` removes the limit. Stored but not applied while `full_width` is off (single_page_document only)"},"full_width_max":{"type":"integer","format":"int32","description":"Maximum width of the text column in full-width mode, px (320..4000); a wider window centres the column. Must not be less than `full_width_min`. `null` removes the limit. Stored but not applied while `full_width` is off (single_page_document only)"}},"description":"Update a document"},"postV2AccountsAccountIdDocumentsIdBlocksOperations":{"type":"object","properties":{"operations":{"type":"array","description":"Block operations, applied in order","items":{"type":"object","properties":{"op":{"type":"string","description":"Operation type","enum":["append","insert","update","delete","replace"]},"markdown":{"type":"string","description":"Markdown body (append/update/replace)"},"block":{"type":"object","description":"Structured BlockNote block (append/update/replace) — alternative to markdown; required for image/file/table-cell-image"},"block_id":{"type":"string","description":"Target block id (update/delete)"},"after":{"type":"string","description":"insert: put the content right after this block id"},"before":{"type":"string","description":"insert: put the content right before this block id"}},"required":["op"]}}},"required":["operations"],"description":"Apply block operations (granular content editing via CRDT)"},"postV2AccountsAccountIdDocumentsIdBlocksImage":{"type":"object","properties":{"url":{"type":"string","description":"URL of an already-hosted image"},"file":{"type":"file","description":"Image file to upload (multipart/form-data)"},"caption":{"type":"string","description":"Image caption"},"align":{"type":"string","description":"Alignment (default: center)","enum":["left","center","right"]},"alt":{"type":"string","description":"Alt text"},"width":{"type":"integer","format":"int32","description":"Width as a percentage of content width (0 = natural size)"},"full_width":{"type":"boolean","description":"Stretch to full content width"}},"description":"Add an image block"},"postV2AccountsAccountIdDocumentsIdBlocksFile":{"type":"object","properties":{"url":{"type":"string","description":"URL of an already-hosted file"},"file":{"type":"file","description":"File to upload (multipart/form-data)"},"name":{"type":"string","description":"Display name (defaults to the uploaded filename)"},"caption":{"type":"string","description":"File caption"}},"description":"Add a file block"},"postV2AccountsAccountIdCustomFieldDefinitions":{"type":"object","properties":{"owner_type":{"type":"string","enum":["StructureNode","User","Requirement","Task","Document","Counterparty","AccountVehicle","AccountDriver","AccountLocation","Contract"]},"field_type":{"type":"string","description":"Field type from the registry: text, number, date, bool, multipleChoice…","enum":["text","long_text","number","date","multipleChoice","bool","employeeSelect","structure","document"]},"label":{"type":"object","description":"Localized label: { ru, en }. At least one locale is required"},"key":{"type":"string","description":"Machine key (snake_case). Generated from the label when omitted"},"description":{"type":"object","description":"Localized hint under the label: { ru, en }"},"required":{"type":"boolean","default":false},"indexed":{"type":"boolean","description":"Make the section grid filter and sort by this field","default":false},"group_id":{"type":"string","description":"Field group UUID"},"options":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"color":{"type":"string","description":"Hex colour, e.g. #dc2626"},"score":{"type":"integer","format":"int32"}},"required":["text"]}}},"required":["owner_type","field_type","label"],"description":"Create a custom field"},"patchV2AccountsAccountIdCustomFieldDefinitionsKey":{"type":"object","properties":{"owner_type":{"type":"string","enum":["StructureNode","User","Requirement","Task","Document","Counterparty","AccountVehicle","AccountDriver","AccountLocation","Contract"]},"field_type":{"type":"string","description":"Immutable — sending a different value is rejected"},"label":{"type":"object","description":"Localized label: { ru, en }"},"description":{"type":"object"},"required":{"type":"boolean"},"indexed":{"type":"boolean"},"active":{"type":"boolean","description":"false retires the field without losing its values"},"group_id":{"type":"string","description":"Field group UUID. `null` removes the field from its group"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Existing option UUID — keep it to preserve stored values"},"text":{"type":"string"},"color":{"type":"string"},"score":{"type":"integer","format":"int32"}},"required":["text"]}}},"required":["owner_type"],"description":"Update a custom field"},"postV2AccountsAccountIdCustomFieldGroups":{"type":"object","properties":{"owner_type":{"type":"string","enum":["StructureNode","User","Requirement","Task","Document","Counterparty","AccountVehicle","AccountDriver","AccountLocation","Contract"]},"label":{"type":"object","description":"Localized name: { ru, en }"}},"required":["owner_type","label"],"description":"Create a field group"},"Api_V2_Entities_Section":{"type":"object","properties":{"key":{"type":"string","description":"Section key — the address of the section, immutable"},"name":{"type":"object","description":"Localized name: { ru, en }"},"icon":{"type":"string","description":"Icon name from the Kommand sprite"},"tree_enabled":{"type":"boolean","description":"Records are organized in a category tree"},"status":{"type":"string","description":"Always `ready` here: drafts and archived are hidden"},"categories_count":{"type":"integer","format":"int32","description":"Live categories (single section only)"},"records_count":{"type":"integer","format":"int32","description":"Readable records (single section only)"}},"description":"Api_V2_Entities_Section model"},"Api_V2_Entities_SectionCategory":{"type":"object","properties":{"id":{"type":"string","description":"Category UUID"},"name":{"type":"string","description":"Category name"},"code":{"type":"string","description":"Category code (optional)"},"parent_id":{"type":"string","description":"Parent category UUID, null at the root"},"depth":{"type":"integer","format":"int32","description":"Depth from the root, 0-based"},"position":{"type":"integer","format":"int32","description":"Position among siblings"}},"description":"Api_V2_Entities_SectionCategory model"},"Api_V2_Entities_SectionRecord":{"type":"object","properties":{"id":{"type":"string","description":"Record UUID"},"name":{"type":"string","description":"Record name"},"category":{"type":"object","description":"Category { id, name } or null"},"responsible":{"type":"object","description":"Responsible user { id, name } or null"},"custom_fields":{"type":"object","description":"Custom fields of the record branch, keyed by the machine key. See /custom_field_definitions?owner_type=SectionRecord\u0026section=\u003ckey\u003e"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp (ISO 8601)"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp (ISO 8601)"}},"description":"Api_V2_Entities_SectionRecord model"},"postV2AccountsAccountIdSectionsSectionKeyRecords":{"type":"object","properties":{"name":{"type":"string","description":"Record name"},"category_id":{"type":"string","description":"Category UUID of this section"},"responsible_id":{"type":"string","description":"Responsible user UUID"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key"}},"required":["name"],"description":"Create a record"},"patchV2AccountsAccountIdSectionsSectionKeyRecordsId":{"type":"object","properties":{"name":{"type":"string"},"category_id":{"type":"string","description":"Category UUID of this section, `null` — no category"},"responsible_id":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge)"}},"description":"Update a record"},"Api_V2_Entities_Counterparty":{"type":"object","properties":{"id":{"type":"string","description":"Counterparty UUID"},"name":{"type":"string","description":"Short name. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"full_name":{"type":"string","description":"Full legal name. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"inn":{"type":"string","description":"INN. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"kpp":{"type":"string","description":"KPP. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"ogrn":{"type":"string","description":"OGRN / OGRNIP. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"legal_address":{"type":"string","description":"Deprecated: use `legal_entity`; removal not before 2026-12-01."},"roles":{"type":"array","items":{"type":"string","enum":["shipper","carrier","forwarder","consignee","customer"]}},"relation_type":{"type":"string","enum":["own","external"],"description":"`own` — legal entity of the account itself"},"own":{"type":"boolean","description":"`relation_type == 'own'`. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"contact_name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"notes":{"type":"string"},"owner_account":{"type":"object","description":"Owner account { id, name }"},"legal_entity":{"$ref":"#/definitions/Api_V2_Entities_LegalEntity"},"edi_profiles":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_LegalEntityEdiProfile"},"description":"Use `legal_entity.edi_profiles`. Deprecated: use `legal_entity`; removal not before 2026-12-01."},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key. See /custom_field_definitions?owner_type=Counterparty"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_Counterparty model"},"Api_V2_Entities_LegalEntity":{"type":"object","properties":{"id":{"type":"string","description":"Legal entity UUID"},"name":{"type":"string","description":"Short name"},"full_name":{"type":"string","description":"Full legal name"},"inn":{"type":"string","description":"INN (10 digits — company, 12 — sole trader)"},"kpp":{"type":"string","description":"KPP, companies only; a branch has its own"},"ogrn":{"type":"string","description":"OGRN / OGRNIP"},"legal_address":{"type":"string"},"entity_kind":{"type":"string","enum":["legal","individual"]},"requisites_status":{"type":"string","enum":["verified","unverified"],"description":"`unverified` — entered manually, not yet confirmed by the source"},"liquidated":{"type":"boolean"},"managing_account":{"type":"object","description":"Account that keeps requisites and EDI profiles { id, name }"},"edi_profiles":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_LegalEntityEdiProfile"}}},"description":"Api_V2_Entities_LegalEntity model"},"Api_V2_Entities_LegalEntityEdiProfile":{"type":"object","properties":{"id":{"type":"string","description":"Profile UUID"},"operator_code":{"type":"string","enum":["kontur","tensor","taxcom","sbercorus","astral","ediweb","evotor","foraprom","itcom","crpt","tochka","ntssoft","esk","niias","ntc_stek","other"],"description":"EDI operator code"},"operator_name":{"type":"string","description":"EDI operator name"},"participant_id":{"type":"string","description":"Participant mailbox at the operator"},"primary":{"type":"boolean","description":"Primary profile of the legal entity (exactly one)"},"epd_readiness":{"type":"string","enum":["unknown","ready","not_ready"],"description":"Readiness to receive e-waybills"},"checked_at":{"type":"string","format":"date-time","description":"When readiness was checked"},"notes":{"type":"string"}}},"postV2AccountsAccountIdCounterparties":{"type":"object","properties":{"inn":{"type":"string","description":"INN"},"kpp":{"type":"string","description":"KPP — required when the company has several branches"},"name":{"type":"string","description":"Short name — only when the requisites source is unavailable"},"roles":{"type":"array","items":{"type":"string","enum":["shipper","carrier","forwarder","consignee","customer"]}},"relation_type":{"type":"string","enum":["own","external"]},"own":{"type":"boolean","description":"Deprecated: use `relation_type`; removal not before 2026-12-01"},"contact_name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"notes":{"type":"string"},"edi_profiles":{"type":"array","description":"EDI profiles of the legal entity — only its managing account or the organization admin, otherwise 403 for the whole request","items":{"type":"object","properties":{"id":{"type":"string","description":"Profile UUID — update or delete an existing profile"},"operator_code":{"type":"string","description":"EDI operator code","enum":["kontur","tensor","taxcom","sbercorus","astral","ediweb","evotor","foraprom","itcom","crpt","tochka","ntssoft","esk","niias","ntc_stek","other"]},"participant_id":{"type":"string","description":"Participant mailbox at the operator"},"primary":{"type":"boolean","description":"Make this profile primary"},"epd_readiness":{"type":"string","enum":["unknown","ready","not_ready"]},"checked_at":{"type":"string","format":"date-time"},"notes":{"type":"string"},"_destroy":{"type":"boolean","description":"Delete the profile"}}}},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"required":["inn","roles"],"description":"Create a counterparty"},"patchV2AccountsAccountIdCounterpartiesId":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string","enum":["shipper","carrier","forwarder","consignee","customer"]}},"relation_type":{"type":"string","enum":["own","external"]},"own":{"type":"boolean","description":"Deprecated: use `relation_type`; removal not before 2026-12-01"},"contact_name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"notes":{"type":"string"},"edi_profiles":{"type":"array","description":"EDI profiles of the legal entity — only its managing account or the organization admin, otherwise 403 for the whole request","items":{"type":"object","properties":{"id":{"type":"string","description":"Profile UUID — update or delete an existing profile"},"operator_code":{"type":"string","description":"EDI operator code","enum":["kontur","tensor","taxcom","sbercorus","astral","ediweb","evotor","foraprom","itcom","crpt","tochka","ntssoft","esk","niias","ntc_stek","other"]},"participant_id":{"type":"string","description":"Participant mailbox at the operator"},"primary":{"type":"boolean","description":"Make this profile primary"},"epd_readiness":{"type":"string","enum":["unknown","ready","not_ready"]},"checked_at":{"type":"string","format":"date-time"},"notes":{"type":"string"},"_destroy":{"type":"boolean","description":"Delete the profile"}}}},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"description":"Update a counterparty"},"Api_V2_Entities_Contract":{"type":"object","properties":{"id":{"type":"string","description":"Contract UUID"},"kind":{"type":"string","enum":["transport_expedition","carriage","carriage_organization","handling_storage","vehicle_rent_with_crew","vehicle_rent","other"]},"name":{"type":"string","description":"Document name; defaults to the kind"},"number":{"type":"string","description":"`null` — no number"},"date":{"type":"string","format":"date"},"registration_id":{"type":"string","description":"Registration ID in the state system"},"our_legal_entity":{"type":"object","description":"Our side. Legal entity { id, name, inn, kpp }"},"counterparty_legal_entity":{"type":"object","description":"Other side. Legal entity { id, name, inn, kpp }"},"our_side":{"type":"string","enum":["customer","executor"]},"our_side_label":{"type":"string","description":"Our side named by the kind"},"valid_from":{"type":"string","format":"date"},"valid_until":{"type":"string","format":"date","description":"`null` — open-ended"},"auto_prolongation":{"type":"boolean"},"status":{"type":"string","enum":["active","terminated"]},"terminated_on":{"type":"string","format":"date"},"state":{"type":"string","enum":["pending","effective","expiring","expired","terminated"],"description":"State today"},"terminates_on":{"type":"string","format":"date","description":"Future termination date, otherwise `null`"},"is_default":{"type":"boolean","description":"Default contract of the pair and kind"},"currency":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"payment_delay_days":{"type":"integer","format":"int32"},"payment_terms":{"type":"string"},"format_notes":{"type":"string","description":"Notes that go to e-documents"},"notes":{"type":"string"},"external_refs":{"type":"array","items":{"type":"object"},"description":"External keys of the account { id, system, external_id }"},"files":{"type":"array","items":{"type":"object"},"description":"Files { id, filename, content_type, byte_size, url }; `url` — download with the API key and rights"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key. See /custom_field_definitions?owner_type=Contract"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_Contract model"},"Api_V2_Entities_AccountLocation":{"type":"object","properties":{"id":{"type":"string","description":"Relation UUID — the resource id"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"owner_account":{"type":"object","description":"Owner account { id, name }"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key. See /custom_field_definitions"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"contact_name":{"type":"string","description":"Contact person on site"},"contact_phone":{"type":"string"},"working_hours":{"type":"string"},"access_notes":{"type":"string","description":"How to drive in"},"location":{"$ref":"#/definitions/Api_V2_Entities_Location"},"external_refs":{"type":"array","items":{"type":"object"},"description":"External keys of the account { id, system, external_id }; empty for a relation of another account"},"counterparty_ids":{"type":"array","items":{"type":"string"},"description":"Counterparties of the account linked to the location (UUIDs); empty for a relation of another account; only those the role may read"}},"description":"Api_V2_Entities_AccountLocation model"},"Api_V2_Entities_Location":{"type":"object","properties":{"id":{"type":"string","description":"Location UUID — one per key in the organization"},"name":{"type":"string"},"kind":{"type":"string","enum":["warehouse","distribution_center","terminal","store","production","site","customs","parking","other"]},"gln":{"type":"string","description":"GLN, 13 digits — a key by itself"},"address_country":{"type":"string","description":"ISO 3166-1 alpha-2"},"address_text":{"type":"string","description":"Address as one line"},"address_status":{"type":"string","enum":["verified","unverified"],"description":"`verified` — chosen from the address source, with the FIAS/GAR code; API input is `unverified`"},"address_source":{"type":"string","enum":["dadata","manual","import"]},"address_gar_id":{"type":"string","description":"FIAS/GAR code of a verified address"},"address_postal_code":{"type":"string","description":"Part of a verified address"},"address_region_code":{"type":"string","description":"Part of a verified address"},"address_area":{"type":"string","description":"Part of a verified address"},"address_city":{"type":"string","description":"Part of a verified address"},"address_settlement":{"type":"string","description":"Part of a verified address"},"address_street":{"type":"string","description":"Part of a verified address"},"address_house":{"type":"string","description":"Part of a verified address"},"address_block":{"type":"string","description":"Part of a verified address"},"address_flat":{"type":"string","description":"Part of a verified address"},"latitude":{"type":"number"},"longitude":{"type":"number"},"address_comment":{"type":"string","description":"How to find the place"},"time_zone":{"type":"string","description":"IANA time zone; null — not determined"},"owner_legal_entity":{"type":"object","description":"Legal entity owning the site { id, name, inn }"},"status":{"type":"string","enum":["active","closed"]},"managing_account":{"type":"object","description":"Managing account { id, name }"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"postV2AccountsAccountIdCounterpartiesIdLocations":{"type":"object","properties":{"location_id":{"type":"string","description":"Location — relation UUID"}},"required":["location_id"],"description":"Link a location to the counterparty"},"Api_V2_Entities_SignatoryOption":{"type":"object","properties":{"id":{"type":"string","description":"Signatory UUID"},"legal_entity_id":{"type":"string","description":"Legal entity the signatory signs for"},"full_name":{"type":"string"},"position":{"type":"string"},"basis":{"type":"string","enum":["executive","poa_electronic","poa_paper"],"description":"executive — no power of attorney; poa_electronic — MCHD; poa_paper"},"status":{"type":"string","enum":["active","inactive"]}},"description":"Api_V2_Entities_SignatoryOption model"},"Api_V2_Entities_SignatoryCheck":{"type":"object","properties":{"status":{"type":"string","enum":["ok","warning","blocked"],"description":"blocked — the title cannot be signed; warning — show the problems"},"signer_status":{"type":"integer","format":"int32","description":"СтатПодп 1–6; null — not for this legal entity"},"power_of_attorney":{"$ref":"#/definitions/Api_V2_Entities_SignatoryCheck_Power","description":"Basis; null when none"},"problems":{"type":"array","items":{"type":"object"},"description":"{ code, severity, message }"}},"description":"Api_V2_Entities_SignatoryCheck model"},"Api_V2_Entities_SignatoryCheck_Power":{"type":"object","properties":{"id":{"type":"string","description":"Power of attorney UUID"},"kind":{"type":"string","enum":["electronic","paper"]},"number":{"type":"string"},"issued_on":{"type":"string","format":"date"},"valid_until":{"type":"string","format":"date"}}},"Api_V2_Entities_Signatory":{"type":"object","properties":{"id":{"type":"string","description":"Signatory UUID"},"legal_entity_id":{"type":"string"},"last_name":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"full_name":{"type":"string"},"position":{"type":"string"},"inn":{"type":"string","description":"Individual INN; masked `********9012` unless you can update the signatory"},"snils":{"type":"string","description":"SNILS digits; masked `***-***-*** 12` unless you can update the signatory"},"basis":{"type":"string","enum":["executive","poa_electronic","poa_paper"]},"status":{"type":"string","enum":["active","inactive"]},"linked_user_id":{"type":"string","description":"Kommand user who is the signatory"},"driver_id":{"type":"string","description":"Driver who is the signatory"},"notes":{"type":"string","description":"Only if you can update the signatory"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_Signatory model"},"postV2AccountsAccountIdCounterpartiesIdSignatories":{"type":"object","properties":{"last_name":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"position":{"type":"string","description":"Goes to titles as is; longer than 128 — `position_too_long` warning"},"inn":{"type":"string","description":"Individual INN, 12 digits"},"snils":{"type":"string","description":"SNILS, 11 digits; dashes and spaces are ignored"},"basis":{"type":"string","enum":["executive","poa_electronic","poa_paper"]},"status":{"type":"string","enum":["active","inactive"]},"linked_user_id":{"type":"string","description":"Kommand user of the organization who is the signatory"},"notes":{"type":"string"}},"required":["last_name","first_name","basis"],"description":"Create a signatory of the counterparty legal entity"},"patchV2AccountsAccountIdSignatoriesId":{"type":"object","properties":{"last_name":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"position":{"type":"string","description":"Goes to titles as is; longer than 128 — `position_too_long` warning"},"inn":{"type":"string","description":"Individual INN, 12 digits"},"snils":{"type":"string","description":"SNILS, 11 digits; dashes and spaces are ignored"},"basis":{"type":"string","enum":["executive","poa_electronic","poa_paper"]},"status":{"type":"string","enum":["active","inactive"]},"linked_user_id":{"type":"string","description":"Kommand user of the organization who is the signatory"},"notes":{"type":"string"}},"description":"Update a signatory"},"Api_V2_Entities_PowerOfAttorney":{"type":"object","properties":{"id":{"type":"string","description":"Power of attorney UUID"},"principal_legal_entity_id":{"type":"string","description":"Principal legal entity"},"signatory":{"type":"object","description":"Representative { id, full_name }"},"kind":{"type":"string","enum":["electronic","paper"]},"number":{"type":"string"},"poa_guid":{"type":"string","description":"MCHD GUID; only if you can update it"},"issued_on":{"type":"string","format":"date"},"valid_from":{"type":"string","format":"date"},"valid_until":{"type":"string","format":"date"},"storage_registry":{"type":"string","enum":["fns","operator","other"]},"storage_url":{"type":"string"},"revocation_check_url":{"type":"string"},"covers_title_purposes":{"type":"array","items":{"type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"]},"description":"Empty — not specified"},"powers":{"type":"array","items":{"type":"object"},"description":"From the MCHD file; only if you can update it"},"powers_text":{"type":"string","description":"Only if you can update it"},"parent_id":{"type":"string","description":"Parent power of attorney (redelegation)"},"retransfer":{"type":"string","enum":["none","once","subsequent","unknown"],"description":"Redelegation right (ПрПередов); unknown — not known"},"status":{"type":"string","enum":["active","revoked","superseded"]},"revoked_on":{"type":"string","format":"date"},"state":{"type":"string","enum":["pending","effective","expiring","expired","revoked"],"description":"State today"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_PowerOfAttorney model"},"postV2AccountsAccountIdCounterpartiesIdPowersOfAttorney":{"type":"object","properties":{"signatory_id":{"type":"string","description":"Representative — a signatory of the principal; fixed after creation"},"number":{"type":"string"},"issued_on":{"type":"string","format":"date"},"valid_from":{"type":"string","format":"date","description":"Empty — from the issue date"},"valid_until":{"type":"string","format":"date"},"storage_registry":{"type":"string","enum":["fns","operator","other"]},"storage_url":{"type":"string","description":"Empty — from the registry"},"revocation_check_url":{"type":"string","description":"Empty — from the registry"},"powers_text":{"type":"string","description":"Powers as text (paper)"},"covers_title_purposes":{"type":"array","description":"Titles it covers; empty — not specified","items":{"type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"]}},"parent_id":{"type":"string","description":"Parent power of attorney (redelegation) of the same principal"},"retransfer":{"type":"string","description":"Redelegation right (paper; an MCHD — from its file); unknown — not known","enum":["none","once","subsequent","unknown"]}},"required":["signatory_id","issued_on","valid_until"],"description":"Create a paper power of attorney"},"postV2AccountsAccountIdCounterpartiesIdPowersOfAttorneyImport":{"type":"object","properties":{"file":{"type":"file","description":"MCHD XML"},"signatory_id":{"type":"string","description":"Representative — a signatory of the principal"},"parent_id":{"type":"string","description":"Parent paper power of attorney of the same principal"}},"required":["file"],"description":"Import an MCHD file"},"patchV2AccountsAccountIdPowersOfAttorneyId":{"type":"object","properties":{"signatory_id":{"type":"string","description":"Representative — a signatory of the principal; fixed after creation"},"number":{"type":"string"},"issued_on":{"type":"string","format":"date"},"valid_from":{"type":"string","format":"date","description":"Empty — from the issue date"},"valid_until":{"type":"string","format":"date"},"storage_registry":{"type":"string","enum":["fns","operator","other"]},"storage_url":{"type":"string","description":"Empty — from the registry"},"revocation_check_url":{"type":"string","description":"Empty — from the registry"},"powers_text":{"type":"string","description":"Powers as text (paper)"},"covers_title_purposes":{"type":"array","description":"Titles it covers; empty — not specified","items":{"type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"]}},"parent_id":{"type":"string","description":"Parent power of attorney (redelegation) of the same principal"},"retransfer":{"type":"string","description":"Redelegation right (paper; an MCHD — from its file); unknown — not known","enum":["none","once","subsequent","unknown"]}},"description":"Update a power of attorney"},"postV2AccountsAccountIdPowersOfAttorneyIdRevoke":{"type":"object","properties":{"on":{"type":"string","format":"date","description":"Revocation date; required unless superseded"},"superseded":{"type":"boolean","default":false}},"description":"Revoke a power of attorney"},"Api_V2_Entities_SigningDefault":{"type":"object","properties":{"legal_entity_id":{"type":"string","description":"Legal entity UUID"},"purpose":{"type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"]},"signatory":{"$ref":"#/definitions/Api_V2_Entities_SignatoryOption"},"signatory_discarded":{"type":"boolean","description":"The signatory is in the trash: `pick` skips it"},"assigned_by_user_id":{"type":"string","description":"Who assigned it"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_SigningDefault model"},"putV2AccountsAccountIdSigningDefaults":{"type":"object","properties":{"legal_entity_id":{"type":"string","description":"Legal entity UUID"},"purpose":{"type":"string","description":"Title purpose","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"]},"signatory_id":{"type":"string","description":"Signatory UUID"}},"required":["legal_entity_id","purpose","signatory_id"],"description":"Set the default signatory for a legal entity and purpose"},"Api_V2_Entities_AccountVehicle":{"type":"object","properties":{"id":{"type":"string","description":"Relation UUID — the resource id"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"owner_account":{"type":"object","description":"Owner account { id, name }"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key. See /custom_field_definitions"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"vehicle":{"$ref":"#/definitions/Api_V2_Entities_Vehicle"},"driver_ids":{"type":"array","items":{"type":"string"},"description":"Drivers of the account linked to the vehicle (relation UUIDs, a hint for shipments); empty for a relation of another account; only those the role may read"}},"description":"Api_V2_Entities_AccountVehicle model"},"Api_V2_Entities_Vehicle":{"type":"object","properties":{"id":{"type":"string","description":"Vehicle UUID — one per registration number in the organization"},"kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"country":{"type":"string","description":"Registration country, ISO 3166-1 alpha-2"},"reg_number":{"type":"string","description":"Registration number as entered (upper case)"},"reg_number_normalized":{"type":"string","description":"Key: no spaces and dashes; for RU Latin look-alikes are Cyrillic"},"former_reg_numbers":{"type":"array","items":{"type":"string"},"description":"Previous normalized registration numbers"},"vin":{"type":"string"},"sts_number":{"type":"string","description":"Vehicle registration certificate number"},"body_type":{"type":"string"},"make":{"type":"string"},"model":{"type":"string"},"capacity_t":{"type":"number","description":"Payload, tonnes"},"volume_m3":{"type":"number","description":"Body volume, m³"},"carrier_legal_entity":{"type":"object","description":"Carrier { id, name, inn }"},"ownership_type":{"type":"string","enum":["1","2","3","4","5"],"description":"e-TTN ownership code: 1 own … 5 free use"},"ownership_basis_name":{"type":"string"},"ownership_basis_number":{"type":"string"},"ownership_basis_date":{"type":"string","format":"date"},"status":{"type":"string","enum":["in_service","repair","decommissioned"]},"managing_account":{"type":"object","description":"Managing account { id, name }"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"postV2AccountsAccountIdVehicles":{"type":"object","properties":{"vehicle":{"type":"object","description":"The vehicle: key and fields","properties":{"country":{"type":"string","description":"Registration country, default RU","enum":["RU","BY","KZ","KG","AM","UZ","TJ","TM","AZ","GE","MD","TR","CN","MN"]},"reg_number":{"type":"string","description":"Registration number — the key with the country"},"kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"vin":{"type":"string"},"sts_number":{"type":"string","description":"Vehicle registration certificate number"},"body_type":{"type":"string"},"make":{"type":"string"},"model":{"type":"string"},"capacity_t":{"type":"number","format":"float","description":"Payload, tonnes"},"volume_m3":{"type":"number","format":"float","description":"Body volume, m³"},"carrier_legal_entity_id":{"type":"string","description":"Carrier — a legal entity of the organization"},"ownership_type":{"type":"string","description":"e-TTN ownership code","enum":["1","2","3","4","5"]},"ownership_basis_name":{"type":"string"},"ownership_basis_number":{"type":"string"},"ownership_basis_date":{"type":"string","format":"date"},"status":{"type":"string","enum":["in_service","repair","decommissioned"]}}},"new_identity":{"type":"boolean","description":"Found by a former key, but it is another vehicle — create a new one"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"required":["vehicle"],"description":"Create a vehicle"},"patchV2AccountsAccountIdVehiclesId":{"type":"object","properties":{"vehicle":{"type":"object","description":"Fields of the vehicle","properties":{"country":{"type":"string","description":"Registration country, default RU","enum":["RU","BY","KZ","KG","AM","UZ","TJ","TM","AZ","GE","MD","TR","CN","MN"]},"reg_number":{"type":"string","description":"Registration number — the key with the country"},"kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"vin":{"type":"string"},"sts_number":{"type":"string","description":"Vehicle registration certificate number"},"body_type":{"type":"string"},"make":{"type":"string"},"model":{"type":"string"},"capacity_t":{"type":"number","format":"float","description":"Payload, tonnes"},"volume_m3":{"type":"number","format":"float","description":"Body volume, m³"},"carrier_legal_entity_id":{"type":"string","description":"Carrier — a legal entity of the organization"},"ownership_type":{"type":"string","description":"e-TTN ownership code","enum":["1","2","3","4","5"]},"ownership_basis_name":{"type":"string"},"ownership_basis_number":{"type":"string"},"ownership_basis_date":{"type":"string","format":"date"},"status":{"type":"string","enum":["in_service","repair","decommissioned"]}}},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"description":"Update a vehicle"},"Api_V2_Entities_AccountDriver":{"type":"object","properties":{"id":{"type":"string","description":"Relation UUID — the resource id"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"owner_account":{"type":"object","description":"Owner account { id, name }"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key. See /custom_field_definitions"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"driver":{"$ref":"#/definitions/Api_V2_Entities_Driver"},"vehicle_ids":{"type":"array","items":{"type":"string"},"description":"Vehicles of the account linked to the driver (relation UUIDs, a hint for shipments); empty for a relation of another account; only those the role may read"}},"description":"Api_V2_Entities_AccountDriver model"},"Api_V2_Entities_Driver":{"type":"object","properties":{"id":{"type":"string","description":"Driver UUID — one per license or INN in the organization"},"last_name":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"full_name":{"type":"string"},"phone":{"type":"string"},"employer_legal_entity":{"type":"object","description":"Employer { id, name, inn }"},"signing_method":{"type":"string","enum":["gosklyuch","operator_app","logist","unknown"]},"linked_user":{"type":"object","description":"Kommand user { id, name }"},"license_country":{"type":"string","description":"Single-record responses only — not in the list (personal data)."},"license_series":{"type":"string","description":"Single-record responses only — not in the list (personal data)."},"license_number":{"type":"string","description":"Single-record responses only — not in the list (personal data)."},"license_issued_on":{"type":"string","format":"date","description":"Single-record responses only — not in the list (personal data)."},"license_expires_on":{"type":"string","format":"date","description":"Issue date + 10 years. Single-record responses only — not in the list (personal data)."},"inn":{"type":"string","description":"Single-record responses only — not in the list (personal data)."},"managing_account":{"type":"object","description":"Managing account { id, name }"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"postV2AccountsAccountIdVehiclesIdDrivers":{"type":"object","properties":{"driver_id":{"type":"string","description":"Driver — relation UUID"}},"required":["driver_id"],"description":"Link a driver to the vehicle"},"postV2AccountsAccountIdDrivers":{"type":"object","properties":{"driver":{"type":"object","description":"The driver: key and fields","properties":{"license_country":{"type":"string","description":"License country, default RU","enum":["RU","BY","KZ","KG","AM","UZ","TJ","TM","AZ","GE","MD","TR","CN","MN"]},"license_series":{"type":"string"},"license_number":{"type":"string"},"inn":{"type":"string","description":"INN — a key when there is no license"},"last_name":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"license_issued_on":{"type":"string","format":"date"},"phone":{"type":"string"},"employer_legal_entity_id":{"type":"string","description":"Employer — a legal entity of the organization"},"signing_method":{"type":"string","enum":["gosklyuch","operator_app","logist","unknown"]},"linked_user_id":{"type":"string","description":"Kommand user of the organization"}}},"new_identity":{"type":"boolean","description":"Found by a former key, but it is another driver — create a new one"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"required":["driver"],"description":"Create a driver"},"patchV2AccountsAccountIdDriversId":{"type":"object","properties":{"driver":{"type":"object","description":"Fields of the driver","properties":{"license_country":{"type":"string","description":"License country, default RU","enum":["RU","BY","KZ","KG","AM","UZ","TJ","TM","AZ","GE","MD","TR","CN","MN"]},"license_series":{"type":"string"},"license_number":{"type":"string"},"inn":{"type":"string","description":"INN — a key when there is no license"},"last_name":{"type":"string"},"first_name":{"type":"string"},"middle_name":{"type":"string"},"license_issued_on":{"type":"string","format":"date"},"phone":{"type":"string"},"employer_legal_entity_id":{"type":"string","description":"Employer — a legal entity of the organization"},"signing_method":{"type":"string","enum":["gosklyuch","operator_app","logist","unknown"]},"linked_user_id":{"type":"string","description":"Kommand user of the organization"}}},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"description":"Update a driver"},"postV2AccountsAccountIdDriversIdVehicles":{"type":"object","properties":{"vehicle_id":{"type":"string","description":"Vehicle — relation UUID"}},"required":["vehicle_id"],"description":"Link a vehicle to the driver"},"postV2AccountsAccountIdLocations":{"type":"object","properties":{"location":{"type":"object","description":"The location: key and fields","properties":{"name":{"type":"string","description":"With the address — the key, unless there is a GLN"},"kind":{"type":"string","enum":["warehouse","distribution_center","terminal","store","production","site","customs","parking","other"]},"address_country":{"type":"string","description":"Default RU","enum":["RU","BY","KZ","KG","AM","UZ","TJ","TM","AZ","GE","MD","TR","CN","MN"]},"address_text":{"type":"string","description":"Address as one line — stored as entered, `unverified`"},"latitude":{"type":"number","format":"float"},"longitude":{"type":"number","format":"float"},"address_comment":{"type":"string","description":"How to find the place"},"gln":{"type":"string","description":"GLN, 13 digits with a valid check digit — a key by itself"},"time_zone":{"type":"string","description":"IANA time zone; default — by the address region (a Russian text address has none)"},"owner_legal_entity_id":{"type":"string","description":"Legal entity owning the site — of the organization"},"status":{"type":"string","enum":["active","closed"]}}},"new_identity":{"type":"boolean","description":"Found by a former key, but it is another location — create a new one"},"contact_name":{"type":"string","description":"Contact person on site"},"contact_phone":{"type":"string"},"working_hours":{"type":"string"},"access_notes":{"type":"string","description":"How to drive in"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"},"external_refs":{"type":"array","description":"External keys of the account for the location","items":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"]}}},"required":["location"],"description":"Create a location"},"Api_V2_Entities_LocationResolution":{"type":"object","properties":{"outcome":{"type":"string","enum":["own_account","archived_own","in_organization","not_found","keys_conflict"]},"id":{"type":"string","description":"Relation UUID — `own_account`, `archived_own`"},"former":{"type":"boolean","description":"Found by a former address of the location"},"current_key":{"type":"string","description":"The current address — when `former`"},"location":{"$ref":"#/definitions/Api_V2_Entities_Location"},"location_ids":{"type":"array","items":{"type":"string"},"description":"`keys_conflict` — the locations of the keys"}},"description":"Api_V2_Entities_LocationResolution model"},"postV2AccountsAccountIdLocationsIdExternalRefs":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"],"description":"Add an external key"},"patchV2AccountsAccountIdLocationsId":{"type":"object","properties":{"location":{"type":"object","description":"Fields of the location","properties":{"name":{"type":"string","description":"With the address — the key, unless there is a GLN"},"kind":{"type":"string","enum":["warehouse","distribution_center","terminal","store","production","site","customs","parking","other"]},"address_country":{"type":"string","description":"Default RU","enum":["RU","BY","KZ","KG","AM","UZ","TJ","TM","AZ","GE","MD","TR","CN","MN"]},"address_text":{"type":"string","description":"Address as one line — stored as entered, `unverified`"},"latitude":{"type":"number","format":"float"},"longitude":{"type":"number","format":"float"},"address_comment":{"type":"string","description":"How to find the place"},"gln":{"type":"string","description":"GLN, 13 digits with a valid check digit — a key by itself"},"time_zone":{"type":"string","description":"IANA time zone; default — by the address region (a Russian text address has none)"},"owner_legal_entity_id":{"type":"string","description":"Legal entity owning the site — of the organization"},"status":{"type":"string","enum":["active","closed"]}}},"contact_name":{"type":"string","description":"Contact person on site"},"contact_phone":{"type":"string"},"working_hours":{"type":"string"},"access_notes":{"type":"string","description":"How to drive in"},"active":{"type":"boolean","description":"`false` — the account no longer works with it"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"description":"Update a location"},"postV2AccountsAccountIdLocationsIdCounterparties":{"type":"object","properties":{"counterparty_id":{"type":"string","description":"Counterparty — relation UUID"}},"required":["counterparty_id"],"description":"Link a counterparty to the location"},"postV2AccountsAccountIdContractsIdTerminate":{"type":"object","properties":{"terminated_on":{"type":"string","format":"date","description":"Defaults to today"}},"description":"Terminate a contract"},"postV2AccountsAccountIdContracts":{"type":"object","properties":{"kind":{"type":"string","description":"Defaults to `transport_expedition`","enum":["transport_expedition","carriage","carriage_organization","handling_storage","vehicle_rent_with_crew","vehicle_rent","other"]},"name":{"type":"string","description":"Document name; empty — by the kind"},"number":{"type":"string","description":"Number; empty or «б/н» — no number"},"date":{"type":"string","format":"date"},"registration_id":{"type":"string","description":"Registration ID in the state system"},"our_legal_entity_id":{"type":"string","description":"Our legal entity — own in the account; the only one is substituted when omitted"},"counterparty_legal_entity_id":{"type":"string","description":"Other side — a legal entity of the account counterparties"},"our_side":{"type":"string","description":"Our side: see `our_side_label` for its name by the kind","enum":["customer","executor"]},"valid_from":{"type":"string","format":"date","description":"Defaults to the date"},"valid_until":{"type":"string","format":"date","description":"Empty — open-ended"},"auto_prolongation":{"type":"boolean"},"is_default":{"type":"boolean","description":"`true` makes a non-default contract the default of its pair and kind: the former one loses the mark. For the default itself `true` changes nothing: moved by kind or sides into a pair that has a default, it loses the mark (`default_dropped` warning). `false` — remove the mark"},"currency":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"payment_delay_days":{"type":"integer","format":"int32"},"payment_terms":{"type":"string"},"format_notes":{"type":"string","description":"Notes that go to e-documents"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key"}},"required":["date","counterparty_legal_entity_id","our_side"],"description":"Create a contract"},"patchV2AccountsAccountIdContractsId":{"type":"object","properties":{"kind":{"type":"string","description":"Defaults to `transport_expedition`","enum":["transport_expedition","carriage","carriage_organization","handling_storage","vehicle_rent_with_crew","vehicle_rent","other"]},"name":{"type":"string","description":"Document name; empty — by the kind"},"number":{"type":"string","description":"Number; empty or «б/н» — no number"},"date":{"type":"string","format":"date"},"registration_id":{"type":"string","description":"Registration ID in the state system"},"our_legal_entity_id":{"type":"string","description":"Our legal entity — own in the account; the only one is substituted when omitted"},"counterparty_legal_entity_id":{"type":"string","description":"Other side — a legal entity of the account counterparties"},"our_side":{"type":"string","description":"Our side: see `our_side_label` for its name by the kind","enum":["customer","executor"]},"valid_from":{"type":"string","format":"date","description":"Defaults to the date"},"valid_until":{"type":"string","format":"date","description":"Empty — open-ended"},"auto_prolongation":{"type":"boolean"},"is_default":{"type":"boolean","description":"`true` makes a non-default contract the default of its pair and kind: the former one loses the mark. For the default itself `true` changes nothing: moved by kind or sides into a pair that has a default, it loses the mark (`default_dropped` warning). `false` — remove the mark"},"currency":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"payment_delay_days":{"type":"integer","format":"int32"},"payment_terms":{"type":"string"},"format_notes":{"type":"string","description":"Notes that go to e-documents"},"notes":{"type":"string"},"custom_fields":{"type":"object","description":"Custom fields keyed by the machine key (merge, `null` clears)"}},"description":"Update a contract"},"postV2AccountsAccountIdContractsIdExternalRefs":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"],"description":"Add an external key"},"postV2AccountsAccountIdContractsIdFiles":{"type":"object","properties":{"file":{"type":"file","description":"File (multipart/form-data)"}},"required":["file"],"description":"Upload a file to the contract"},"Api_V2_Entities_CargoTemplate":{"type":"object","properties":{"id":{"type":"string","description":"Cargo template UUID"},"code":{"type":"string","description":"Code, unique per owner in the account"},"cargo_name":{"type":"string"},"owner":{"type":"object","description":"Owner legal entity { id, name, inn, kpp }; `null` — no owner or hidden from the key"},"owner_hidden":{"type":"boolean","description":"The owner is set but the key does not see its counterparty"},"tnved_code":{"type":"string","description":"HS heading, 4 digits"},"tnved_heading":{"type":"string","description":"HS heading name"},"cargo_state":{"type":"string"},"packing_method":{"type":"string"},"package_type_code":{"type":"string","description":"UN/ECE Rec. 21 code, `00` — no package"},"package_type_label":{"type":"string"},"bulk":{"type":"boolean"},"oversized":{"type":"boolean"},"dangerous":{"type":"boolean"},"gov_tracked":{"type":"boolean"},"container":{"type":"boolean"},"temperature_controlled":{"type":"boolean"},"no_transshipment":{"type":"boolean"},"food":{"type":"boolean"},"net_kg":{"type":"string","format":"decimal"},"gross_kg":{"type":"string","format":"decimal"},"volume_m3":{"type":"string","format":"decimal"},"density":{"type":"string","format":"decimal"},"length_m":{"type":"string","format":"decimal"},"width_m":{"type":"string","format":"decimal"},"height_m":{"type":"string","format":"decimal"},"declared_value":{"type":"string","format":"decimal"},"pallets":{"type":"integer","format":"int32","description":"Pallets per place"},"currency_code":{"type":"string","description":"ISO 4217"},"markings":{"type":"array","items":{"type":"string"}},"dangerous_goods":{"type":"array","items":{"type":"object"},"description":"Dangerous goods (ЭТрН СвОпГрузТип)"},"containers":{"type":"array","items":{"type":"object"},"description":"{ count, ids }"},"gov_system":{"type":"object","description":"{ name, unit, info, ids }"},"climate":{"type":"object","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"accompanying_docs":{"type":"array","items":{"type":"object"},"description":"{ name, number, date, registration_id, notes }"},"other_info":{"type":"string"},"notes":{"type":"string"},"external_refs":{"type":"array","items":{"type":"object"},"description":"External keys of the account { id, system, external_id }"},"status":{"type":"string","enum":["active","archived"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_CargoTemplate model"},"postV2AccountsAccountIdCargoTemplates":{"type":"object","properties":{"cargo_name":{"type":"string","description":"Cargo name; «Контейнер» for a container"},"code":{"type":"string","description":"Code, unique per owner in the account"},"owner_legal_entity_id":{"type":"string","description":"Owner — a legal entity of the account counterparties"},"tnved_code":{"type":"string","description":"HS code; a longer code is cut to the 4-digit heading"},"cargo_state":{"type":"string","description":"Free text (ЭТрН СостГруз)"},"packing_method":{"type":"string","description":"Free text (ЭТрН СпУпак)"},"package_type_code":{"type":"string","description":"UN/ECE Rec. 21, `00` — no package; see `package_type_label` in responses","enum":["00","1A","1B","1D","1F","1G","1W","2C","3A","3H","43","44","4A","4B","4C","4D","4F","4G","4H","5H","5L","5M","6H","6P","7A","7B","8A","8B","8C","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AL","AM","AP","AT","AV","B4","BA","BB","BC","BD","BE","BF","BG","BH","BI","BJ","BK","BL","BM","BN","BO","BP","BQ","BR","BS","BT","BU","BV","BW","BX","BY","BZ","CA","CB","CC","CD","CE","CF","CG","CH","CI","CJ","CK","CL","CM","CN","CO","CP","CQ","CR","CS","CT","CU","CV","CW","CX","CY","CZ","DA","DB","DC","DG","DH","DI","DJ","DK","DL","DM","DN","DP","DR","DS","DT","DU","DV","DW","DX","DY","EC","ED","EE","EF","EG","EH","EI","EN","FC","FD","FE","FI","FL","FO","FP","FR","FT","FX","GB","GI","GL","GR","GY","GZ","HA","HB","HC","HG","HN","HR","IA","IB","IC","ID","IE","IF","IG","IH","IK","IN","IZ","JB","JC","JG","JR","JT","JY","KG","KI","LE","LG","LT","LU","LV","LZ","MA","MB","MC","ME","MR","MS","MT","MW","MX","NE","NF","NG","NS","NT","NU","NV","OT","OU","P2","PA","PB","PC","PD","PE","PF","PG","PH","PI","PJ","PK","PL","PN","PO","PP","PR","PT","PU","PV","PX","PY","PZ","QA","QB","QC","QD","QF","QG","QH","QJ","QK","QL","QM","QN","QP","QQ","QR","QS","RD","RG","RJ","RK","RL","RO","RT","RZ","SA","SB","SC","SD","SE","SH","SI","SK","SL","SM","SO","SP","SS","ST","SU","SV","SW","SX","SY","SZ","T1","TB","TC","TD","TE","TG","TI","TK","TL","TN","TO","TR","TS","TT","TU","TV","TW","TY","TZ","UC","UN","VA","VG","VI","VK","VL","VO","VP","VQ","VR","VS","VY","WA","WB","WC","WD","WF","WG","WH","WJ","WK","WL","WM","WN","WP","WQ","WR","WS","WT","WU","WV","WW","WX","WY","WZ","XA","XB","XC","XD","XF","XG","XH","XJ","XK","YA","YB","YC","YD","YF","YH","YJ","YK","YL","YM","YN","YP","YQ","YR","YS","YT","YV","YW","YX","YY","YZ","ZA","ZB","ZC","ZD","ZF","ZG","ZH","ZJ","ZK","ZL","ZM","ZN","ZP","ZQ","ZR","ZS","ZT","ZU","ZV","ZW","ZX","ZY","ZZ"]},"bulk":{"type":"boolean"},"net_kg":{"type":"number","format":"double"},"gross_kg":{"type":"number","format":"double"},"volume_m3":{"type":"number","format":"double"},"density":{"type":"number","format":"double","description":"kg/m³; above 999.99 is kept but not sent to the e-waybill"},"pallets":{"type":"integer","format":"int32","description":"Pallets per place"},"length_m":{"type":"number","format":"double"},"width_m":{"type":"number","format":"double"},"height_m":{"type":"number","format":"double"},"oversized":{"type":"boolean"},"dangerous":{"type":"boolean","description":"Requires `dangerous_goods`"},"gov_tracked":{"type":"boolean","description":"Requires `gov_system`"},"container":{"type":"boolean","description":"Requires `containers`"},"food":{"type":"boolean","description":"Food products: the carrier gets the food vehicle requirement in the e-order"},"declared_value":{"type":"number","format":"double"},"currency_code":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"other_info":{"type":"string"},"dangerous_goods":{"type":"array","description":"Dangerous goods: un_number, shipping_name, hazard_class, classification_code, packing_group, labels, tunnel_code, …","items":{"type":"json"}},"gov_system":{"type":"json","description":"{ name, unit, info, ids }"},"markings":{"type":"array","items":{"type":"string"}},"containers":{"type":"array","description":"{ count, ids }","items":{"type":"json"}},"climate":{"type":"json","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"no_transshipment":{"type":"boolean"},"accompanying_docs":{"type":"array","description":"{ name, number, date, registration_id, notes }","items":{"type":"json"}},"notes":{"type":"string"}},"required":["cargo_name"],"description":"Create a cargo template"},"Api_V2_Entities_CargoTemplateOption":{"type":"object","properties":{"id":{"type":"string","description":"Cargo template UUID"},"code":{"type":"string"},"cargo_name":{"type":"string"},"cargo_summary":{"type":"string","description":"Name · gross per place · dimensions · package"},"package_type_code":{"type":"string","description":"UN/ECE Rec. 21 code, `00` — no package"},"gross_kg":{"type":"string","format":"decimal","description":"Gross per place"},"owner":{"type":"object","description":"Owner legal entity { id, name, inn, kpp }; `null` — no owner or hidden from the key"},"owner_hidden":{"type":"boolean","description":"The owner is set but the key does not see its counterparty"}},"description":"Api_V2_Entities_CargoTemplateOption model"},"patchV2AccountsAccountIdCargoTemplatesId":{"type":"object","properties":{"cargo_name":{"type":"string","description":"Cargo name; «Контейнер» for a container"},"code":{"type":"string","description":"Code, unique per owner in the account"},"owner_legal_entity_id":{"type":"string","description":"Owner — a legal entity of the account counterparties"},"tnved_code":{"type":"string","description":"HS code; a longer code is cut to the 4-digit heading"},"cargo_state":{"type":"string","description":"Free text (ЭТрН СостГруз)"},"packing_method":{"type":"string","description":"Free text (ЭТрН СпУпак)"},"package_type_code":{"type":"string","description":"UN/ECE Rec. 21, `00` — no package; see `package_type_label` in responses","enum":["00","1A","1B","1D","1F","1G","1W","2C","3A","3H","43","44","4A","4B","4C","4D","4F","4G","4H","5H","5L","5M","6H","6P","7A","7B","8A","8B","8C","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AL","AM","AP","AT","AV","B4","BA","BB","BC","BD","BE","BF","BG","BH","BI","BJ","BK","BL","BM","BN","BO","BP","BQ","BR","BS","BT","BU","BV","BW","BX","BY","BZ","CA","CB","CC","CD","CE","CF","CG","CH","CI","CJ","CK","CL","CM","CN","CO","CP","CQ","CR","CS","CT","CU","CV","CW","CX","CY","CZ","DA","DB","DC","DG","DH","DI","DJ","DK","DL","DM","DN","DP","DR","DS","DT","DU","DV","DW","DX","DY","EC","ED","EE","EF","EG","EH","EI","EN","FC","FD","FE","FI","FL","FO","FP","FR","FT","FX","GB","GI","GL","GR","GY","GZ","HA","HB","HC","HG","HN","HR","IA","IB","IC","ID","IE","IF","IG","IH","IK","IN","IZ","JB","JC","JG","JR","JT","JY","KG","KI","LE","LG","LT","LU","LV","LZ","MA","MB","MC","ME","MR","MS","MT","MW","MX","NE","NF","NG","NS","NT","NU","NV","OT","OU","P2","PA","PB","PC","PD","PE","PF","PG","PH","PI","PJ","PK","PL","PN","PO","PP","PR","PT","PU","PV","PX","PY","PZ","QA","QB","QC","QD","QF","QG","QH","QJ","QK","QL","QM","QN","QP","QQ","QR","QS","RD","RG","RJ","RK","RL","RO","RT","RZ","SA","SB","SC","SD","SE","SH","SI","SK","SL","SM","SO","SP","SS","ST","SU","SV","SW","SX","SY","SZ","T1","TB","TC","TD","TE","TG","TI","TK","TL","TN","TO","TR","TS","TT","TU","TV","TW","TY","TZ","UC","UN","VA","VG","VI","VK","VL","VO","VP","VQ","VR","VS","VY","WA","WB","WC","WD","WF","WG","WH","WJ","WK","WL","WM","WN","WP","WQ","WR","WS","WT","WU","WV","WW","WX","WY","WZ","XA","XB","XC","XD","XF","XG","XH","XJ","XK","YA","YB","YC","YD","YF","YH","YJ","YK","YL","YM","YN","YP","YQ","YR","YS","YT","YV","YW","YX","YY","YZ","ZA","ZB","ZC","ZD","ZF","ZG","ZH","ZJ","ZK","ZL","ZM","ZN","ZP","ZQ","ZR","ZS","ZT","ZU","ZV","ZW","ZX","ZY","ZZ"]},"bulk":{"type":"boolean"},"net_kg":{"type":"number","format":"double"},"gross_kg":{"type":"number","format":"double"},"volume_m3":{"type":"number","format":"double"},"density":{"type":"number","format":"double","description":"kg/m³; above 999.99 is kept but not sent to the e-waybill"},"pallets":{"type":"integer","format":"int32","description":"Pallets per place"},"length_m":{"type":"number","format":"double"},"width_m":{"type":"number","format":"double"},"height_m":{"type":"number","format":"double"},"oversized":{"type":"boolean"},"dangerous":{"type":"boolean","description":"Requires `dangerous_goods`"},"gov_tracked":{"type":"boolean","description":"Requires `gov_system`"},"container":{"type":"boolean","description":"Requires `containers`"},"food":{"type":"boolean","description":"Food products: the carrier gets the food vehicle requirement in the e-order"},"declared_value":{"type":"number","format":"double"},"currency_code":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"other_info":{"type":"string"},"dangerous_goods":{"type":"array","description":"Dangerous goods: un_number, shipping_name, hazard_class, classification_code, packing_group, labels, tunnel_code, …","items":{"type":"json"}},"gov_system":{"type":"json","description":"{ name, unit, info, ids }"},"markings":{"type":"array","items":{"type":"string"}},"containers":{"type":"array","description":"{ count, ids }","items":{"type":"json"}},"climate":{"type":"json","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"no_transshipment":{"type":"boolean"},"accompanying_docs":{"type":"array","description":"{ name, number, date, registration_id, notes }","items":{"type":"json"}},"notes":{"type":"string"}},"description":"Update a cargo template"},"postV2AccountsAccountIdCargoTemplatesIdExternalRefs":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"],"description":"Add an external key"},"Api_V2_Entities_Order":{"type":"object","properties":{"id":{"type":"string","description":"Order UUID"},"number":{"type":"string","description":"Our number «З-2026-000123»"},"client_number":{"type":"string","description":"Number of the customer"},"status":{"type":"string","enum":["draft","accepted","planning","planned","in_transit","delivered","closed","cancelled"]},"status_label":{"type":"string"},"cancel_reason":{"type":"string"},"customer":{"type":"object","description":"Customer { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"customer_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"our_legal_entity":{"type":"object","description":"Our legal entity { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"our_legal_entity_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"payer":{"type":"object","description":"Payer { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"payer_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"readdress":{"type":"object","description":"Who may readdress the cargo (СвПА) { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"readdress_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"readdress_phone":{"type":"string"},"contract":{"type":"object","description":"Contract { id, kind, number, date }; `null` — none, hidden from the key or in the trash"},"contract_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"manager":{"type":"object","description":"Manager { id, name }"},"vehicle_kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"min_capacity_t":{"type":"string","format":"decimal"},"min_volume_m3":{"type":"string","format":"decimal"},"loading_methods":{"type":"array","items":{"type":"string","enum":["rear","side","top"]}},"climate":{"type":"object","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"no_transshipment":{"type":"boolean"},"delivery_due_on":{"type":"string","format":"date"},"price_amount":{"type":"string","format":"decimal"},"price_currency":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"vat_rate":{"type":"string","enum":["none","0","5","7","10","20","22"]},"price_basis":{"type":"string","enum":["per_trip","per_ton","per_km","negotiated"]},"transport_norms_note":{"type":"string"},"notes":{"type":"string"},"stops":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_OrderStop"}},"lines":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_OrderLine"}},"documents_count":{"type":"integer","format":"int32","description":"Future e-waybills by the plan"},"external_refs":{"type":"array","items":{"type":"object"},"description":"External keys of the account { id, system, external_id }"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_Order model"},"Api_V2_Entities_OrderStop":{"type":"object","properties":{"id":{"type":"string","description":"Stop UUID — pass it back to keep the stop"},"position":{"type":"integer","format":"int32","description":"From 1, by the order of the list"},"kind":{"type":"string","enum":["loading","unloading"]},"location":{"type":"object","description":"Location { id, name, address_text, time_zone }; `null` — none, hidden from the key or in the trash"},"location_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"party":{"type":"object","description":"Shipper (loading) or consignee (unloading) { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"party_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"loader":{"type":"object","description":"Who loads { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"loader_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"time_zone":{"type":"string","description":"IANA zone of the window: the location zone, unknown — the account zone; UTC if the location is hidden"},"window_from":{"type":"string","format":"date-time","description":"In the zone of `time_zone` with its offset"},"window_until":{"type":"string","format":"date-time","description":"In the zone of `time_zone` with its offset"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"}}},"Api_V2_Entities_OrderLine":{"type":"object","properties":{"id":{"type":"string","description":"Line UUID — pass it back to keep the line"},"position":{"type":"integer","format":"int32"},"from_stop_id":{"type":"string","description":"Stop UUID of this order"},"to_stop_id":{"type":"string","description":"Stop UUID of this order"},"cargo_template":{"type":"object","description":"Origin template { id, code, cargo_name }; `null` — none, hidden from the key or in the trash"},"cargo_template_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"places":{"type":"integer","format":"int32"},"cargo_name":{"type":"string"},"tnved_code":{"type":"string"},"cargo_state":{"type":"string"},"packing_method":{"type":"string"},"package_type_code":{"type":"string"},"package_type_label":{"type":"string"},"bulk":{"type":"boolean"},"oversized":{"type":"boolean"},"dangerous":{"type":"boolean"},"gov_tracked":{"type":"boolean"},"container":{"type":"boolean"},"no_transshipment":{"type":"boolean"},"food":{"type":"boolean"},"net_kg":{"type":"string","format":"decimal"},"gross_kg":{"type":"string","format":"decimal"},"volume_m3":{"type":"string","format":"decimal"},"density":{"type":"string","format":"decimal"},"length_m":{"type":"string","format":"decimal"},"width_m":{"type":"string","format":"decimal"},"height_m":{"type":"string","format":"decimal"},"declared_value":{"type":"string","format":"decimal"},"pallets":{"type":"integer","format":"int32","description":"Pallets per place"},"currency_code":{"type":"string"},"other_info":{"type":"string"},"markings":{"type":"array","items":{"type":"string"}},"dangerous_goods":{"type":"array","items":{"type":"object"}},"containers":{"type":"array","items":{"type":"object"}},"gov_system":{"type":"object"},"climate":{"type":"object","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"accompanying_docs":{"type":"array","items":{"type":"object"}}}},"postV2AccountsAccountIdOrders":{"type":"object","properties":{"client_number":{"type":"string","description":"Number of the customer; a twin of the customer — warning"},"customer_legal_entity_id":{"type":"string","description":"Customer — a counterparty of the account with the role customer or shipper"},"our_legal_entity_id":{"type":"string","description":"Our legal entity; the only own one is substituted"},"payer_legal_entity_id":{"type":"string","description":"Defaults to the customer"},"contract_id":{"type":"string","description":"Omitted — picked by the pair (warnings `contract_reselected`, `contract_missing`)"},"manager_user_id":{"type":"string","description":"A user of the account; defaults to the author"},"vehicle_kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"min_capacity_t":{"type":"string","description":"Decimal: `200.5`, `200,5` and `1 200,5` are accepted"},"min_volume_m3":{"type":"string","description":"Decimal: `200.5`, `200,5` and `1 200,5` are accepted"},"loading_methods":{"type":"array","items":{"type":"string","enum":["rear","side","top"]}},"climate":{"type":"json","description":"{ temp_min, temp_max, humidity_min, humidity_max }; defaults to the lines"},"no_transshipment":{"type":"boolean"},"delivery_due_on":{"type":"string","format":"date"},"price_amount":{"type":"string","description":"Decimal: `200.5`, `200,5` and `1 200,5` are accepted"},"price_currency":{"type":"string","description":"Defaults to the contract currency","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"vat_rate":{"type":"string","enum":["none","0","5","7","10","20","22"]},"price_basis":{"type":"string","enum":["per_trip","per_ton","per_km","negotiated"]},"transport_norms_note":{"type":"string"},"readdress_legal_entity_id":{"type":"string"},"readdress_phone":{"type":"string"},"notes":{"type":"string"},"stops":{"type":"array","description":"Stops by order — the FULL list when passed (omitted ones are removed), omitted key — stops stay. Item: `id` (keep a stop), `kind` (loading/unloading), `location_id`, `party_legal_entity_id`, `loader_legal_entity_id`, `window_from`, `window_until` (without an offset — the location time), `contact_name`, `contact_phone`, `instructions`. Errors — `stops[0].window_until`","items":{"type":"json"}},"lines":{"type":"array","description":"Cargo lines — the FULL list when passed. Item: `id`, `cargo_template_id` (copies the description), `places`, `from_stop_id`/`to_stop_id` or `from_stop_index`/`to_stop_index` (place in `stops`, from 0), cargo description fields as in cargo templates. One loading and one unloading — the route is substituted. Errors — `lines[1].to_stop_id`","items":{"type":"json"}}},"required":["customer_legal_entity_id"],"description":"Create an order"},"patchV2AccountsAccountIdOrdersId":{"type":"object","properties":{"client_number":{"type":"string","description":"Number of the customer; a twin of the customer — warning"},"customer_legal_entity_id":{"type":"string","description":"Customer — a counterparty of the account with the role customer or shipper"},"our_legal_entity_id":{"type":"string","description":"Our legal entity; the only own one is substituted"},"payer_legal_entity_id":{"type":"string","description":"Defaults to the customer"},"contract_id":{"type":"string","description":"Omitted — picked by the pair (warnings `contract_reselected`, `contract_missing`)"},"manager_user_id":{"type":"string","description":"A user of the account; defaults to the author"},"vehicle_kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"min_capacity_t":{"type":"string","description":"Decimal: `200.5`, `200,5` and `1 200,5` are accepted"},"min_volume_m3":{"type":"string","description":"Decimal: `200.5`, `200,5` and `1 200,5` are accepted"},"loading_methods":{"type":"array","items":{"type":"string","enum":["rear","side","top"]}},"climate":{"type":"json","description":"{ temp_min, temp_max, humidity_min, humidity_max }; defaults to the lines"},"no_transshipment":{"type":"boolean"},"delivery_due_on":{"type":"string","format":"date"},"price_amount":{"type":"string","description":"Decimal: `200.5`, `200,5` and `1 200,5` are accepted"},"price_currency":{"type":"string","description":"Defaults to the contract currency","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"vat_rate":{"type":"string","enum":["none","0","5","7","10","20","22"]},"price_basis":{"type":"string","enum":["per_trip","per_ton","per_km","negotiated"]},"transport_norms_note":{"type":"string"},"readdress_legal_entity_id":{"type":"string"},"readdress_phone":{"type":"string"},"notes":{"type":"string"},"stops":{"type":"array","description":"Stops by order — the FULL list when passed (omitted ones are removed), omitted key — stops stay. Item: `id` (keep a stop), `kind` (loading/unloading), `location_id`, `party_legal_entity_id`, `loader_legal_entity_id`, `window_from`, `window_until` (without an offset — the location time), `contact_name`, `contact_phone`, `instructions`. Errors — `stops[0].window_until`","items":{"type":"json"}},"lines":{"type":"array","description":"Cargo lines — the FULL list when passed. Item: `id`, `cargo_template_id` (copies the description), `places`, `from_stop_id`/`to_stop_id` or `from_stop_index`/`to_stop_index` (place in `stops`, from 0), cargo description fields as in cargo templates. One loading and one unloading — the route is substituted. Errors — `lines[1].to_stop_id`","items":{"type":"json"}}},"description":"Update an order"},"postV2AccountsAccountIdOrdersIdCancel":{"type":"object","properties":{"reason":{"type":"string","description":"Reason of the cancellation"}},"required":["reason"],"description":"Cancel an order"},"postV2AccountsAccountIdOrdersIdExternalRefs":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"],"description":"Add an external key"},"postV2AccountsAccountIdTripsFromOrders":{"type":"object","properties":{"order_ids":{"type":"array","description":"Order UUIDs of the account","items":{"type":"string"}},"with_request":{"type":"boolean","description":"Also create a draft request","default":false}},"required":["order_ids"],"description":"Plan orders into a trip"},"Api_V2_Entities_Trip":{"type":"object","properties":{"id":{"type":"string","description":"Trip UUID"},"number":{"type":"string","description":"Our number «П-2026-000123»"},"status":{"type":"string","enum":["plan","confirmed","in_transit","delivered","closed","cancelled","no_show"]},"status_label":{"type":"string"},"cancel_reason":{"type":"string"},"our_legal_entity":{"type":"object","description":"Our legal entity { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"our_legal_entity_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"manager":{"type":"object","description":"Manager { id, name }"},"vehicle_kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"min_capacity_t":{"type":"string","format":"decimal"},"min_volume_m3":{"type":"string","format":"decimal"},"loading_methods":{"type":"array","items":{"type":"string","enum":["rear","side","top"]}},"climate":{"type":"object","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"no_transshipment":{"type":"boolean"},"notes":{"type":"string"},"stops":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_TripStop"}},"cargo_lines":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_TripCargoLine"}},"assignments":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_TripAssignment"}},"active_request":{"type":"object","description":"Sent or confirmed request { id, number, status, carrier_legal_entity_id }; `null` — none or the key does not read requests"},"active_request_hidden":{"type":"boolean","description":"There is one, but the key does not read it"},"carrier_requests":{"type":"array","items":{"type":"object"},"description":"Requests of the trip { id, number, status } — to the key that reads requests"},"external_refs":{"type":"array","items":{"type":"object"},"description":"External keys of the account { id, system, external_id }"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_Trip model"},"Api_V2_Entities_TripStop":{"type":"object","properties":{"id":{"type":"string","description":"Stop UUID — pass it back to keep the stop"},"position":{"type":"integer","format":"int32","description":"From 1, by the order of the list"},"kind":{"type":"string","enum":["loading","unloading"]},"location":{"type":"object","description":"Location { id, name, address_text, time_zone }; `null` — none, hidden from the key or in the trash"},"location_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"party":{"type":"object","description":"Shipper (loading) or consignee (unloading) { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"party_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"loader":{"type":"object","description":"Who loads { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"loader_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"time_zone":{"type":"string","description":"IANA zone of the window: the location zone, unknown — the account zone; UTC if the location is hidden"},"window_from":{"type":"string","format":"date-time","description":"In the zone of `time_zone` with its offset"},"window_until":{"type":"string","format":"date-time","description":"In the zone of `time_zone` with its offset"},"contact_name":{"type":"string"},"contact_phone":{"type":"string"},"instructions":{"type":"string"}}},"Api_V2_Entities_TripCargoLine":{"type":"object","properties":{"id":{"type":"string","description":"Cargo line UUID — pass it back to keep the line"},"position":{"type":"integer","format":"int32"},"from_stop_id":{"type":"string","description":"Stop UUID of this trip"},"to_stop_id":{"type":"string","description":"Stop UUID of this trip"},"order":{"type":"object","description":"Source order { id, number, order_line_id }; `null` — none, hidden from the key or in the trash"},"order_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"planned_places":{"type":"integer","format":"int32"},"mass_method":{"type":"string","enum":["01","02","03"]},"distributable":{"type":"boolean"},"divisible":{"type":"boolean"},"cargo_name":{"type":"string"},"tnved_code":{"type":"string"},"cargo_state":{"type":"string"},"packing_method":{"type":"string"},"package_type_code":{"type":"string"},"package_type_label":{"type":"string"},"bulk":{"type":"boolean"},"oversized":{"type":"boolean"},"dangerous":{"type":"boolean"},"gov_tracked":{"type":"boolean"},"container":{"type":"boolean"},"no_transshipment":{"type":"boolean"},"food":{"type":"boolean"},"net_kg":{"type":"string","format":"decimal"},"gross_kg":{"type":"string","format":"decimal"},"volume_m3":{"type":"string","format":"decimal"},"density":{"type":"string","format":"decimal"},"length_m":{"type":"string","format":"decimal"},"width_m":{"type":"string","format":"decimal"},"height_m":{"type":"string","format":"decimal"},"declared_value":{"type":"string","format":"decimal"},"pallets":{"type":"integer","format":"int32","description":"Pallets per place"},"currency_code":{"type":"string"},"other_info":{"type":"string"},"markings":{"type":"array","items":{"type":"string"}},"dangerous_goods":{"type":"array","items":{"type":"object"}},"containers":{"type":"array","items":{"type":"object"}},"gov_system":{"type":"object"},"climate":{"type":"object","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"accompanying_docs":{"type":"array","items":{"type":"object"}}}},"Api_V2_Entities_TripAssignment":{"type":"object","properties":{"id":{"type":"string","description":"Assignment UUID — pass it back to keep it"},"kind":{"type":"string","enum":["vehicle","trailer","driver"]},"position":{"type":"integer","format":"int32","description":"From 1 within the kind"},"vehicle":{"type":"object","description":"Vehicle { id, kind, reg_number, make, model }; `null` — none, hidden from the key or in the trash"},"vehicle_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"driver":{"type":"object","description":"Driver { id, name } — no license, INN or phone; `null` — none, hidden from the key or in the trash"},"driver_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"valid_from":{"type":"string","format":"date-time"},"valid_until":{"type":"string","format":"date-time"},"carrier_request_id":{"type":"string","description":"Request confirmed with this assignment; `null` — manual or the request is hidden"}}},"postV2AccountsAccountIdTripsIdCancel":{"type":"object","properties":{"reason":{"type":"string","description":"Reason of the cancellation"}},"required":["reason"],"description":"Cancel a trip"},"postV2AccountsAccountIdTrips":{"type":"object","properties":{"our_legal_entity_id":{"type":"string","description":"Our legal entity; the only own one is substituted"},"manager_user_id":{"type":"string","description":"A user of the account; defaults to the author"},"vehicle_kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"min_capacity_t":{"type":"string","description":"Decimal: `20.5`, `20,5` are accepted"},"min_volume_m3":{"type":"string","description":"Decimal: `20.5`, `20,5` are accepted"},"loading_methods":{"type":"array","items":{"type":"string","enum":["rear","side","top"]}},"climate":{"type":"json","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"no_transshipment":{"type":"boolean"},"notes":{"type":"string"},"stops":{"type":"array","description":"Stops — the FULL list when passed (omitted ones are removed), omitted key — stops stay. Item: `id` (keep a stop), `kind` (loading/unloading), `location_id`, `party_legal_entity_id`, `loader_legal_entity_id`, `window_from`, `window_until` (without an offset — the location time), `contact_name`, `contact_phone`, `instructions`. Errors — `stops[0].window_until`","items":{"type":"json"}},"cargo_lines":{"type":"array","description":"Cargo lines — the FULL list when passed. Item: `id`, `order_line_id` (a line of an order the key plans), `planned_places`, `from_stop_id`/`to_stop_id` or `from_stop_index`/`to_stop_index` (place in `stops`, from 0), `mass_method`, `distributable`, `divisible`, cargo description fields as in cargo templates. Errors — `cargo_lines[1].planned_places`","items":{"type":"json"}},"assignments":{"type":"array","description":"Vehicles and drivers — the FULL list when passed. Item: `id`, `kind` (vehicle/trailer/driver), `vehicle_id` or `driver_id` (of the account, readable by the key), `valid_from`, `valid_until`. Errors — `assignments[0].driver_id`","items":{"type":"json"}}},"description":"Create a trip"},"patchV2AccountsAccountIdTripsId":{"type":"object","properties":{"our_legal_entity_id":{"type":"string","description":"Our legal entity; the only own one is substituted"},"manager_user_id":{"type":"string","description":"A user of the account; defaults to the author"},"vehicle_kind":{"type":"string","enum":["tractor","truck","trailer","semitrailer"]},"min_capacity_t":{"type":"string","description":"Decimal: `20.5`, `20,5` are accepted"},"min_volume_m3":{"type":"string","description":"Decimal: `20.5`, `20,5` are accepted"},"loading_methods":{"type":"array","items":{"type":"string","enum":["rear","side","top"]}},"climate":{"type":"json","description":"{ temp_min, temp_max, humidity_min, humidity_max }"},"no_transshipment":{"type":"boolean"},"notes":{"type":"string"},"stops":{"type":"array","description":"Stops — the FULL list when passed (omitted ones are removed), omitted key — stops stay. Item: `id` (keep a stop), `kind` (loading/unloading), `location_id`, `party_legal_entity_id`, `loader_legal_entity_id`, `window_from`, `window_until` (without an offset — the location time), `contact_name`, `contact_phone`, `instructions`. Errors — `stops[0].window_until`","items":{"type":"json"}},"cargo_lines":{"type":"array","description":"Cargo lines — the FULL list when passed. Item: `id`, `order_line_id` (a line of an order the key plans), `planned_places`, `from_stop_id`/`to_stop_id` or `from_stop_index`/`to_stop_index` (place in `stops`, from 0), `mass_method`, `distributable`, `divisible`, cargo description fields as in cargo templates. Errors — `cargo_lines[1].planned_places`","items":{"type":"json"}},"assignments":{"type":"array","description":"Vehicles and drivers — the FULL list when passed. Item: `id`, `kind` (vehicle/trailer/driver), `vehicle_id` or `driver_id` (of the account, readable by the key), `valid_from`, `valid_until`. Errors — `assignments[0].driver_id`","items":{"type":"json"}}},"description":"Update a trip"},"postV2AccountsAccountIdTripsIdExternalRefs":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"],"description":"Add an external key"},"Api_V2_Entities_CarrierRequest":{"type":"object","properties":{"id":{"type":"string","description":"Request UUID"},"number":{"type":"string","description":"Our number «ЗП-2026-000123»"},"carrier_number":{"type":"string","description":"Number of the request at the carrier"},"status":{"type":"string","enum":["draft","sent","confirmed","rejected","withdrawn","cancelled"]},"status_label":{"type":"string"},"status_reason":{"type":"string","description":"Reason of a rejection"},"trip":{"type":"object","description":"Trip { id, number }; `null` — none, hidden from the key or in the trash"},"trip_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"carrier":{"type":"object","description":"Carrier { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"carrier_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"our_legal_entity":{"type":"object","description":"Our legal entity { id, name, inn, kpp }; `null` — none, hidden from the key or in the trash"},"our_legal_entity_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"contract":{"type":"object","description":"Contract { id, kind, number, date }; `null` — none, hidden from the key or in the trash"},"contract_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"basis":{"type":"string","enum":["contract","one_time"],"description":"Under a contract or a one-time order"},"rate_amount":{"type":"string","format":"decimal"},"rate_currency":{"type":"string","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"rate_vat_rate":{"type":"string","enum":["none","0","5","7","10","20","22"]},"rate_basis":{"type":"string","enum":["per_trip","per_ton","per_km","negotiated"]},"payment_terms":{"type":"string"},"notes":{"type":"string"},"signatory":{"type":"object","description":"Who signs the e-request { id, full_name, position }"},"confirmed_source":{"type":"string","enum":["manual","operator","carrier_link"]},"renewed_from_id":{"type":"string","description":"Request this one renews after a rejection"},"response_due_at":{"type":"string","format":"date-time"},"sent_at":{"type":"string","format":"date-time"},"responded_at":{"type":"string","format":"date-time"},"external_refs":{"type":"array","items":{"type":"object"},"description":"External keys of the account { id, system, external_id }"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_CarrierRequest model"},"postV2AccountsAccountIdCarrierRequestsIdConfirm":{"type":"object","properties":{"vehicle_id":{"type":"string","description":"Tractor or truck — Vehicle UUID"},"trailer_id":{"type":"string","description":"Trailer or semitrailer — Vehicle UUID"},"driver_id":{"type":"string","description":"Driver UUID"},"second_driver_id":{"type":"string","description":"Second driver UUID"},"carrier_number":{"type":"string","description":"Number of the request at the carrier"}},"description":"Confirm a request"},"postV2AccountsAccountIdCarrierRequestsIdReject":{"type":"object","properties":{"reason":{"type":"string","description":"Reason of the rejection"}},"required":["reason"],"description":"Reject a request"},"postV2AccountsAccountIdCarrierRequests":{"type":"object","properties":{"trip_id":{"type":"string","description":"Trip UUID of the account"},"carrier_legal_entity_id":{"type":"string","description":"Carrier — a counterparty with the role carrier"},"our_legal_entity_id":{"type":"string","description":"Our legal entity; defaults to the trip one or the only own one"},"contract_id":{"type":"string","description":"Omitted — picked by the pair (warnings); `null` — a one-time order"},"carrier_number":{"type":"string","description":"Number of the request at the carrier"},"rate_amount":{"type":"string","description":"Decimal: `50000.5`, `50 000,5` are accepted"},"rate_currency":{"type":"string","description":"Defaults to the contract one","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"rate_vat_rate":{"type":"string","enum":["none","0","5","7","10","20","22"]},"rate_basis":{"type":"string","enum":["per_trip","per_ton","per_km","negotiated"]},"payment_terms":{"type":"string"},"response_due_at":{"type":"string","format":"date-time","description":"Answer is awaited until, ISO 8601 (a space instead of `T` is accepted); without an offset — the account time zone; a date alone — the end of that day, 23:59:59 in the account time zone. Not a time — 422"},"signatory_id":{"type":"string","description":"Of our legal entity; defaults to the e-request default"},"notes":{"type":"string"}},"required":["trip_id"],"description":"Create a carrier request"},"patchV2AccountsAccountIdCarrierRequestsId":{"type":"object","properties":{"carrier_legal_entity_id":{"type":"string","description":"Carrier — a counterparty with the role carrier"},"our_legal_entity_id":{"type":"string","description":"Our legal entity; defaults to the trip one or the only own one"},"contract_id":{"type":"string","description":"Omitted — picked by the pair (warnings); `null` — a one-time order"},"carrier_number":{"type":"string","description":"Number of the request at the carrier"},"rate_amount":{"type":"string","description":"Decimal: `50000.5`, `50 000,5` are accepted"},"rate_currency":{"type":"string","description":"Defaults to the contract one","enum":["RUB","USD","EUR","CNY","KZT","BYN","UZS","KGS","AMD"]},"rate_vat_rate":{"type":"string","enum":["none","0","5","7","10","20","22"]},"rate_basis":{"type":"string","enum":["per_trip","per_ton","per_km","negotiated"]},"payment_terms":{"type":"string"},"response_due_at":{"type":"string","format":"date-time","description":"Answer is awaited until, ISO 8601 (a space instead of `T` is accepted); without an offset — the account time zone; a date alone — the end of that day, 23:59:59 in the account time zone. Not a time — 422"},"signatory_id":{"type":"string","description":"Of our legal entity; defaults to the e-request default"},"notes":{"type":"string"}},"description":"Update a carrier request"},"postV2AccountsAccountIdCarrierRequestsIdExternalRefs":{"type":"object","properties":{"system":{"type":"string","enum":["onec","tms","wms","csv","other"]},"external_id":{"type":"string"}},"required":["system","external_id"],"description":"Add an external key"},"Api_V2_Entities_TmsDocument":{"type":"object","properties":{"id":{"type":"string","description":"Document UUID"},"kind":{"type":"string","enum":["ezz"]},"kind_label":{"type":"string"},"direction":{"type":"string","enum":["outgoing","incoming"]},"number":{"type":"string"},"format_version":{"type":"string"},"document_guid":{"type":"string"},"operator_code":{"type":"string"},"date":{"type":"string","format":"date"},"status":{"type":"string","enum":["draft","sent","delivered","signed","rejected","annulled"]},"status_label":{"type":"string"},"carrier_request":{"type":"object","description":"Request { id, number }"},"trip":{"type":"object","description":"Trip { id, number }; `null` — none, hidden from the key or in the trash"},"trip_hidden":{"type":"boolean","description":"Set, but the key does not read it or it is in the trash"},"parent_document_id":{"type":"string","description":"Document this one answers or corrects"},"titles":{"type":"array","items":{"$ref":"#/definitions/Api_V2_Entities_TmsTitle"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"description":"Api_V2_Entities_TmsDocument model"},"Api_V2_Entities_TmsTitle":{"type":"object","properties":{"id":{"type":"string","description":"Title UUID"},"purpose":{"type":"string","enum":["shipper","carrier_acceptance","readdressing","replacement","consignee","carrier_delivery","pud_carrier","pud_shipper","ezz_shipper","ezz_carrier"]},"purpose_label":{"type":"string"},"schema_version":{"type":"string"},"file_name":{"type":"string"},"file":{"type":"boolean","description":"The file can be downloaded"},"signatory":{"type":"object","description":"Who signs { id, full_name, position }"},"operator_status":{"type":"string","description":"`accepted`, `not_delivered:\u003ccode\u003e`; `null` — queued"},"operator_status_label":{"type":"string"},"gis_status":{"type":"string"},"sent_at":{"type":"string","format":"date-time"},"signed_at":{"type":"string","format":"date-time"},"operator_status_at":{"type":"string","format":"date-time"},"gis_status_at":{"type":"string","format":"date-time"}}},"Api_V2_Entities_CommentThread":{"type":"object","properties":{"id":{"type":"string","description":"Thread UUID"},"subject_type":{"type":"string","description":"Subject class name, e.g. Document"},"subject_id":{"type":"string","description":"Subject UUID"},"anchor":{"type":"string","description":"subject — object discussion, inline — anchored in text"},"resolved_at":{"type":"string","format":"date-time","description":"Resolution timestamp (null if open)"},"resolved_by":{"type":"object","description":"User who resolved (null if open)"},"comments":{"type":"array","description":"Messages, oldest first"},"created_at":{"type":"string","format":"date-time"},"last_comment_at":{"type":"string","format":"date-time","description":"Timestamp of the latest message"}},"description":"Api_V2_Entities_CommentThread model"},"postV2AccountsAccountIdComments":{"type":"object","properties":{"subject_type":{"type":"string","description":"Subject class name"},"subject_id":{"type":"string","description":"Subject UUID"},"text":{"type":"string","description":"Message text (plain)"}},"required":["subject_type","subject_id","text"],"description":"Start a discussion"},"Api_V2_Entities_Folder":{"type":"object","properties":{"id":{"type":"string","description":"UUID папки"},"name":{"type":"string","description":"Название папки"},"description":{"type":"string","description":"Описание папки (обычный текст)"},"parent_id":{"type":"string","description":"UUID родительской папки (null если корневая)"},"documents_count":{"type":"integer","format":"int32","description":"Количество документов в папке"},"children_count":{"type":"integer","format":"int32","description":"Количество дочерних папок"},"discarded_at":{"type":"string","format":"date-time","description":"Метка времени мягкого удаления (null если активна)"},"owner":{"type":"object","description":"Создатель папки"},"created_at":{"type":"string","format":"date-time","description":"Дата создания (ISO 8601)"},"updated_at":{"type":"string","format":"date-time","description":"Дата последнего изменения (ISO 8601)"}},"description":"Api_V2_Entities_Folder model"},"postV2AccountsAccountIdFolders":{"type":"object","properties":{"name":{"type":"string","description":"Название папки (обязательно)"},"description":{"type":"string","description":"Описание папки (обычный текст)"},"parent_id":{"type":"string","description":"UUID родительской папки. Если не указан, папка создаётся в корне"}},"required":["name"],"description":"Create a folder"},"patchV2AccountsAccountIdFoldersId":{"type":"object","properties":{"name":{"type":"string","description":"Новое название папки"},"description":{"type":"string","description":"Новое описание папки"},"parent_id":{"type":"string","description":"UUID нового родителя. Передайте `null` для перемещения в корень"}},"description":"Update a folder"},"postV2AccountsAccountIdVideoInstructionsUploadUrl":{"type":"object","properties":{"file_name":{"type":"string"},"file_size":{"type":"integer","format":"int32","minimum":1,"maximum":2000000000},"content_type":{"type":"string","enum":["video/mp4","video/webm","video/quicktime"]},"document_id":{"type":"string","description":"UUID документа, к которому прикрепляется видео"}},"required":["file_name","file_size","content_type","document_id"],"description":"Get presigned upload URL for video file"},"postV2AccountsAccountIdVideoInstructions":{"type":"object","properties":{"video_id":{"type":"string","description":"UUID returned from /upload_url"},"language":{"type":"string","enum":["ru-RU","en-US"],"default":"ru-RU"},"prompt_version":{"type":"string","default":"v1"}},"required":["video_id"],"description":"Create video instruction (starts pipeline)"},"postV2AccountsAccountIdVideoInstructionsIdRegenerate":{"type":"object","properties":{"prompt_version":{"type":"string","default":"v1"}},"description":"Regenerate steps with optional new prompt version / LLM engine"}}}