# Документация Context4 Публичная продуктовая и техническая документация. Относительные ссылки разрешаются относительно https://context4.me. Примеры не доказывают успешное выполнение; не раскрывайте учётные данные в чате. ## Адреса этого стенда - Документация: https://context4.me/docs.md - Индекс для агента: https://context4.me/docs/agent-index.json - Консоль и подключения: https://console.context4.me/integrations - MCP: https://context4.me/mcp - HTTP API: https://context4.me/v1 - Composio base URL: https://context4.me/compat/context4/v1 - OpenAPI: https://context4.me/docs/openapi.json - Каталог HTTP/MCP: https://context4.me/docs/api-index.json - Маршруты Composio: https://context4.me/docs/compat-routes.json - Коннекторы: https://context4.me/docs/connectors.json # Подключение для агента Источник: https://context4.me/docs/agent-setup ## MCP - Сервер: `https://context4.me/mcp`. - Транспорт: Streamable HTTP. - Вход человека: браузерный OAuth, без выпуска API-ключа Context4. - [Discovery ресурса](https://context4.me/.well-known/oauth-protected-resource/mcp), [discovery OAuth](https://context4.me/.well-known/oauth-authorization-server). - [Консоль и аккаунты](https://console.context4.me/integrations). Начни с этой страницы. Остальные материалы открывай по текущему шагу. Документация и запись MCP не доказывают доступ к данным. ## 1. Определи клиент Определи приложение из надёжного контекста среды, не по модели. Если неизвестно, один раз спроси: ChatGPT, Claude, Codex, Claude Code, Hermes, OpenClaw или другой MCP-клиент? Для облачного клиента localhost-документация и локальный MCP недоступны. Остановись и объясни необходимость доступного HTTPS-стенда. Не придумывай домен и не подменяй сервер производственным молча. ## 2. Скиллы и настройка клиента Проверь существующие скиллы и инструменты Context4. Переиспользуй подходящий MCP. Не перезаписывай другую конфигурацию или изменённые файлы без согласия. Для штатной работы установи `context4` и `context4-setup`; для межсистемных задач добавь `context4-workflows`. [Манифест файлов и SHA-256](https://context4.me/docs/skills-index.json), [описание пакетов](https://context4.me/docs/skills.md). Прочитай весь пакет перед сохранением, включая references. Если клиент не умеет хранить скиллы, используй эту инструкцию в текущем чате и укажи отсутствие постоянной установки. Открой только свою пару ссылок: | Клиент | Подключение | Скиллы | | --- | --- | --- | | ChatGPT | [Плагин](https://context4.me/docs/connect-chatgpt.md) | [Установка](https://context4.me/docs/skills-chatgpt.md) | | Claude web/desktop | [Remote connector](https://context4.me/docs/connect-claude.md) | [Загрузка ZIP](https://context4.me/docs/skills-claude.md) | | Codex | [Прямой MCP](https://context4.me/docs/connect-codex.md) | [Файлы](https://context4.me/docs/skills-codex.md) | | Claude Code | [HTTP MCP](https://context4.me/docs/connect-claude-code.md) | [Файлы](https://context4.me/docs/skills-claude-code.md) | | Hermes | [MCP/OAuth](https://context4.me/docs/connect-hermes.md) | [Установка](https://context4.me/docs/skills-hermes.md) | | OpenClaw | [MCP/OAuth](https://context4.me/docs/connect-openclaw.md) | [Установка](https://context4.me/docs/skills-openclaw.md) | Если чат не может менять настройки клиента, покажи точные ручные шаги. Вход, workspace и согласие подтверждает пользователь. Дождись появления MCP-инструментов; при необходимости объясни перезапуск/новый чат. Установка скилла не создаёт OAuth grant. ## Другие MCP-клиенты Если клиент не перечислен, используй его штатную настройку удалённого Streamable HTTP MCP с адресом выше и OAuth discovery. Сверь способ хранения скиллов с документацией фактического клиента; стандартный пакет содержит SKILL.md и references. Не угадывай путь конфигурации или CLI-флаги. Если постоянные скиллы не поддерживаются, используй руководство текущего разговора и явно отметь ограничение. ## 3. Базовые инструменты Глобальный `/mcp` предоставляет пять метаинструментов. Используй схемы фактического клиента; [полный справочник](https://context4.me/docs/mcp-tools.md). | Инструмент | Назначение | | --- | --- | | `CONTEXT4_SEARCH_TOOLS` | Найти действие по сервису и задаче | | `CONTEXT4_GET_TOOL_SCHEMAS` | Получить точные аргументы найденных действий | | `CONTEXT4_MANAGE_CONNECTIONS` | Проверить аккаунты или получить Connect Link | | `CONTEXT4_WAIT_FOR_CONNECTIONS` | Дождаться готовности аккаунта | | `CONTEXT4_MULTI_EXECUTE_TOOL` | Выполнить поручение с проверенными аргументами | Не угадывай tool slugs и не используй инструменты другого продукта. COMPOSIO-алиасы допустимы только в сессии, которая реально их перечисляет. ## 4. Подключи рабочий аккаунт Если задача/сервис неизвестны, уточни их. Найди подходящее чтение, получи схему, проверь подключения. При нескольких аккаунтах спроси выбор. Если нужна авторизация, получи ссылку через `CONTEXT4_MANAGE_CONNECTIONS`, покажи пользователю и дождись фактической готовности через `CONTEXT4_WAIT_FOR_CONNECTIONS`, соблюдая retry hints. Не собирай authorization URL вручную и не проси секреты в чате. ## 5. Подтверди готовность чтением Выполни одно разрешённое чтение через `CONTEXT4_MULTI_EXECUTE_TOOL`. Проверь каждый результат. Успешный пустой ответ означает работающий запрос без подходящих данных. Pending, ошибка, найденная схема или показанная ссылка ещё не доказывают готовность. Если чтения нет, объясни ограничение; не создавай запись ради проверки. Кратко сообщи, какой сервис/аккаунт подключён, что проверено и какое поручение можно дать дальше. Запись, удаление и сообщения — только в пределах поручения пользователя. ## По необходимости [Провайдеры](https://context4.me/docs/agent-providers.md), [ошибки и MCP](https://context4.me/docs/ai-mcp.md), [подключения](https://context4.me/docs/connections.md), [отзыв доступа](https://context4.me/docs/access-and-disconnect.md), [все главы](https://context4.me/docs.md). Для серверной интеграции — [API](https://context4.me/docs/api-reference.md), [SDK/proxy](https://context4.me/docs/composio-sdk.md). Не загружай весь API-справочник ради обычного MCP-подключения. Для человека: [открыть HTML-инструкцию](https://context4.me/docs/agent-setup). ## Данные и правила использования Context4 бесплатен. Содержимое операций передаётся как прокси без постоянного хранения. Учётная запись и авторизация обрабатываются отдельно. [Как обрабатываются данные](https://context4.me/docs/data-handling.md) · [Privacy](https://context4.me/privacy) · [Terms](https://context4.me/terms) · [Поддержка и удаление](https://context4.me/support#delete). --- # Что такое Context4 Источник: https://context4.me/docs/product-overview Context4 — сервис, который подключает CRM и другие рабочие приложения к AI через MCP (Model Context Protocol). Он помогает командам и разработчикам находить рабочие данные и выполнять доступные действия из AI-клиента или собственного приложения. Context4 соединяет AI и приложения с внешними сервисами через управляемые подключения. Авторизация аккаунта хранится на стороне платформы; агент получает доступные действия и их схемы, выбирает аккаунт и выполняет задачу в границах ваших прав. ## Три способа работы | Задача | Интерфейс | С чего начать | | --- | --- | --- | | Поручать задачи AI | Удалённый MCP с браузерным входом | [Быстрый старт](https://context4.me/docs/quickstart.md) | | Встроить действия в приложение | Публичный HTTP API и совместимый Composio SDK | [Техническая документация](https://context4.me/docs/api-reference.md) | | Получать изменения объектов и выгрузки | Синхронизации источников | [Данные и синхронизация](https://context4.me/docs/syncs.md) | ## Что даёт платформа - Подключения аккаунтов, несколько аккаунтов одного сервиса и управляемый общий доступ. - Поиск инструментов, входные и выходные схемы, выполнение с учётом политик и квот. - Записи выполнений, состояния и попытки для проверки результата. - Каталог HTTP-методов провайдера и вызовы через подключённый аккаунт. - Доступные для конкретного источника синхронизации, схемы сущностей и исторические экспорты. Доступность проверяется по живому каталогу, состоянию подключения и правам. Страница сервиса в [каталоге](https://context4.me/apps) помогает выбрать интеграцию; исполняемые инструменты обнаруживаются после подключения. Context4 не обещает весь API каждого сервиса, одинаковые схемы или одинаковый режим синхронизации. ## От задачи к результату Опишите нужный результат и аккаунт. Агент находит подходящее действие, получает его схему, проверяет подключение и отправляет аргументы. После выполнения он проверяет состояние и реальные данные. Изменения, удаления и отправки сообщений поручайте явно: доступ к инструменту сам по себе не является разрешением на произвольные действия. Подробнее: [понятия](https://context4.me/docs/core-concepts.md), [подключения](https://context4.me/docs/connections.md), [права и отключение](https://context4.me/docs/access-and-disconnect.md), [сценарии](https://context4.me/docs/business-cases.md). ## Зачем AI нужен контекст вашей работы Без доступа к рабочим данным AI может объяснить, как вести продажи, но не знает, какие сделки открыты именно у вас. Контекст — данные выбранных аккаунтов: клиенты, задачи и другие доступные записи. Инструменты позволяют перейти от обсуждения к действию в сервисе, если у подключения есть нужные права. Например, [MCP-коннектор amoCRM](https://context4.me/apps/amocrm) позволяет разбирать доступные сделки и контакты, а [коннектор Битрикс24](https://context4.me/apps/bitrix24) — работать с его CRM и задачами. Поддержка конкретного действия описана на странице сервиса; окончательная доступность проверяется в вашем аккаунте. ## Как начать без собственной интеграции Выберите [ChatGPT](https://context4.me/connect/chatgpt) или [Claude Code](https://context4.me/connect/claude) в инструкциях подключения. Скопируйте промпт, пройдите настройку клиента и самостоятельно подтвердите доступ к рабочему сервису. Начните с чтения данных, затем поручайте изменения, которые готовы проверить. MCP — протокол, через который AI-клиент обращается к внешним инструментам. Context4 предоставляет такой доступ к рабочим сервисам, а не заменяет ваш AI и CRM. [Как устроены MCP и инструменты](https://context4.me/docs/ai-mcp.md). ## Как подключить CRM к ChatGPT или Claude Сначала подключите Context4 к AI по инструкции для [ChatGPT](https://context4.me/docs/connect-chatgpt.md) или [Claude](https://context4.me/docs/connect-claude.md). Затем выберите CRM в [каталоге сервисов](https://context4.me/apps) и авторизуйте нужный аккаунт. Наличие страницы в каталоге не заменяет подключение и проверку прав. ## Что AI сможет делать с рабочими данными Доступные действия определяются коннектором, подключённым аккаунтом и разрешениями. Перед изменением сделки, задачи или другого объекта проверьте действие и подтвердите его в AI-клиенте. [Как проверять выполнение](https://context4.me/docs/actions.md) и [как отозвать доступ](https://context4.me/docs/access-and-disconnect.md) описано отдельно. --- # Скиллы Context4 Источник: https://context4.me/docs/skills ## Готовые скиллы Для штатного подключения установите `context4` и `context4-setup`. Третий пакет добавляйте для задач между системами. | Скилл | Назначение | Файлы | Архив | | --- | --- | --- | --- | | `context4` | Сервисы, инструменты, аккаунты и результат | [SKILL.md](https://context4.me/skills/context4/SKILL.md) | [ZIP](https://context4.me/skills/context4/archive.zip) | | `context4-setup` | Клиент, MCP/плагин, вход и первое чтение | [SKILL.md](https://context4.me/skills/context4-setup/SKILL.md) | [ZIP](https://context4.me/skills/context4-setup/archive.zip) | | `context4-workflows` | Данные и поручения в нескольких системах | [SKILL.md](https://context4.me/skills/context4-workflows/SKILL.md) | [ZIP](https://context4.me/skills/context4-workflows/archive.zip) | Архивы содержат SKILL.md, references, лицензию и атрибуцию. [Манифест файлов и SHA-256](https://context4.me/docs/skills-index.json) позволяет агенту сохранить пакет пофайлово. MCP и ссылки привязаны к текущему стенду. ## Установка [ChatGPT](https://context4.me/docs/skills-chatgpt.md), [Claude](https://context4.me/docs/skills-claude.md), [Codex](https://context4.me/docs/skills-codex.md), [Claude Code](https://context4.me/docs/skills-claude-code.md), [Hermes](https://context4.me/docs/skills-hermes.md), [OpenClaw](https://context4.me/docs/skills-openclaw.md). Дайте агенту [общую инструкцию](https://context4.me/docs/agent-setup.md) и попросите установить скиллы. Он определит клиент, прочитает файлы и сохранит целиком. Изменённые существующие скиллы сначала сравниваются, а не перезаписываются. ## Скилл и MCP Скилл учит порядку работы. MCP предоставляет инструменты, OAuth — разрешения, подключение провайдера — аккаунт. Сохранение файла не авторизует сервис. Если клиент не поддерживает хранение скиллов, руководство можно использовать в текущем чате, но это не постоянная установка. ## Основа Composio Router адаптирован из [официального Composio skill](https://github.com/ComposioHQ/composio/tree/231122de19abd820eac91549382e407e2d2cbe06/skills/composio), MIT. Оригинал без изменений, лицензия и хеши сохранены отдельно в исходниках. В рабочих пакетах заменены инструменты, адреса и авторизация на реальные Context4. Composio CLI не устанавливается. Playbooks внутри Composio search — другой механизм, который мы не объявляем реализованным в Context4. --- # Провайдеры: инструкция агенту Источник: https://context4.me/docs/agent-providers ## От задачи к действию [Каталог сервисов](https://context4.me/apps) и [JSON-каталог](https://context4.me/docs/connectors.json) — справочные сведения. Разрешённые действия определяются текущим MCP discovery, а не наличием страницы на сайте. 1. Возьми сервис и задачу из поручения. Не подключай все системы заранее. 2. Найди действия через `CONTEXT4_SEARCH_TOOLS`, получи схемы через `CONTEXT4_GET_TOOL_SCHEMAS`. 3. Проверь аккаунт и права. При неоднозначности спроси выбор; для входа получи реальный Connect Link и дождись готовности. 4. Используй возвращённые поля и ID. ID контакта CRM не является ID получателя другого сервиса. ## Специфика - [amoCRM](https://context4.me/apps/amocrm): сделки, контакты и задачи через найденные действия и их схемы. - [Битрикс24](https://context4.me/apps/bitrix24): отдельные права портала; аргументы не копируются из amoCRM. - [Wazzup](https://context4.me/apps/wazzup): получатель/канал из схемы; отправка только по поручению. - Телефония, финансы и остальные сервисы: [каталог](https://context4.me/apps) и JSON выше. Реализация не означает доступ текущего пользователя. - Soon/request-only не считай исполняемыми. Если действия нет, объясни ограничение, не придумывай API. Для допустимого HTTP-вызова без готового инструмента — [proxy](https://context4.me/docs/proxy-requests.md), [endpoint discovery](https://context4.me/docs/api-endpoints.md). Документация API не выдаёт ключи или дополнительные права. --- # Начало работы Источник: https://context4.me/docs/quickstart ## Отправьте промпт вашему AI [Скопируйте промпт](https://context4.me/connect) и отправьте в обычный чат. В нём ссылка на [общую инструкцию агента](https://context4.me/docs/agent-setup.md): адрес MCP, базовые инструменты и порядок подключения. Агент выберет инструкцию своего клиента и поможет установить скиллы Context4. ## Подтвердите доступ Агент настроит MCP или плагин доступным ему способом. Вход в Context4, рабочее пространство и авторизацию CRM вы подтвердите в браузере. Пароли и ключи не отправляются в чат. Подключение AI и авторизация рабочего аккаунта — отдельные шаги. ## Дайте первое поручение Например: «Покажи открытые сделки в amoCRM и ответственных». Агент проверит фактический результат. Если данных нет, он так и скажет; если нужен доступ, покажет следующий шаг. ## Ручная настройка [ChatGPT](https://context4.me/docs/connect-chatgpt.md), [Claude](https://context4.me/docs/connect-claude.md), [Codex](https://context4.me/docs/connect-codex.md), [Claude Code](https://context4.me/docs/connect-claude-code.md), [Hermes](https://context4.me/docs/connect-hermes.md), [OpenClaw](https://context4.me/docs/connect-openclaw.md). Установите [базовые скиллы Context4](https://context4.me/docs/skills.md). Для клиента указан его способ: файлы, загрузка ZIP или плагин. Сохранение скилла само по себе не авторизует сервис. Облачным клиентам нужны доступные HTTPS-адреса документации и MCP; локальный стенд доступен локальным агентам. [Помощь](https://context4.me/docs/troubleshooting.md). ## ChatGPT [Подключение ChatGPT и установка скиллов](https://context4.me/docs/connect-chatgpt.md). ## Claude [Подключение Claude и установка скиллов](https://context4.me/docs/connect-claude.md). ## Codex [Подключение Codex и установка скиллов](https://context4.me/docs/connect-codex.md). ## Claude Code [Подключение Claude Code и установка скиллов](https://context4.me/docs/connect-claude-code.md). ## Hermes [Подключение Hermes и установка скиллов](https://context4.me/docs/connect-hermes.md). ## OpenClaw [Подключение OpenClaw и установка скиллов](https://context4.me/docs/connect-openclaw.md). ## Данные и правила использования Context4 бесплатен. Содержимое операций передаётся как прокси без постоянного хранения. Учётная запись и авторизация обрабатываются отдельно. [Как обрабатываются данные](https://context4.me/docs/data-handling.md) · [Privacy](https://context4.me/privacy) · [Terms](https://context4.me/terms) · [Поддержка и удаление](https://context4.me/support#delete). --- # Основные понятия Источник: https://context4.me/docs/core-concepts ## Рабочее пространство Объединяет подключения, настройки и доступ участников. Перед действием проверьте, в каком пространстве вы работаете. ## Коннектор и подключение Коннектор описывает возможности сервиса. Подключение — авторизованный аккаунт в вашем рабочем пространстве. Это разные вещи. ## Действие и результат Инструмент имеет схему входа и результата. AI может ошибиться: проверяйте выбранный аккаунт и последствия изменений. ## Инструмент, endpoint и сессия Инструмент — действие с входной схемой и опубликованным идентификатором. Endpoint — HTTP-метод провайдера с путём, параметрами и JSON Schema; он обнаруживается отдельно и не появляется автоматически среди MCP tools. [Proxy](https://context4.me/docs/proxy-requests.md) описывает вызов endpoint через подключённый аккаунт. Сессия закрепляет доступный набор инструментов и настройки выполнения, включая TTL, budget и read-only policy. Выполнение — отдельная долговечная запись о конкретном вызове, его состоянии, попытках и результате. Ни существование сессии, ни принятие запроса не означают успех у провайдера. ## Конечный пользователь В серверной интеграции `user_id` связывает действия с конечным пользователем приложения. Это opaque reference, а не поле для email или персональных данных. Несколько пользователей одного workspace могут иметь отдельные аккаунты одного сервиса. Общий аккаунт доступен только при подходящих настройках sharing и ACL. --- # Подключения Источник: https://context4.me/docs/connections [Открыть консоль и подключения этого стенда](https://console.context4.me/integrations). ## Выберите сервис В [справочнике](https://context4.me/apps) показаны текущие реализации. Реальная доступность определяется опубликованным каталогом вашего рабочего пространства. ## Авторизуйте аккаунт Проверьте адрес сервиса и необходимые права перед подтверждением. OAuth-подключение выполняется через страницу поставщика; API-ключ вводится в защищённом процессе подключения. ## Проверьте состояние После возврата в Context4 проверьте статус подключения. При ошибке прочитайте сообщение и повторите после устранения причины. Не отправляйте секреты в поддержку. ## Несколько аккаунтов Если агент находит несколько подключений, укажите нужное по безопасному идентификатору и назначению. Не выбирайте первый аккаунт автоматически. Общий доступ задаётся явно и проверяется при выполнении, включая tenant и principal; подключение другого пользователя не становится доступным только потому, что оно видно в той же организации. ## Состояния `pending` означает незавершённое подключение, `active` — готовность аккаунта, `degraded` — ограниченную работоспособность, `failed` — ошибку, `revoked` — отзыв. Active не гарантирует право на каждый метод API поставщика. Для OAuth/credential flow используйте ссылку Context4 и вводите секреты только в предусмотренной форме. Серверная интеграция может использовать собственный OAuth auth config. Native API поддерживает обновление авторизации ещё не активировавшегося OAuth-подключения с проверкой версии; это не универсальная кнопка обновления любого аккаунта. [HTTP-контракты](https://context4.me/docs/api-connections.md) определяют точные условия и поля. --- # Действия и результаты Источник: https://context4.me/docs/actions ## Изучите инструмент Сверьте название, входную схему и назначение. Публичный каталог показывает только справочные сведения, а разрешённые действия определяет аккаунт. ## Выполните задачу Перед изменением данных проверьте рабочее пространство, аккаунт и аргументы. Не рассчитывайте на дополнительное подтверждение, если клиент его не предусматривает. ## Проверьте результат Операция имеет состояние и результат. Сравните результат с исходным сервисом; при повторе учитывайте идемпотентность выбранного действия. ## От принятого запроса к завершению У выполнения есть состояния `requested`, `queued`, `running`, `retrying`, `succeeded`, `failed`, `rejected` и `cancelled`; точный enum текущего контракта смотрите в [схеме Execution](https://context4.me/docs/api-schemas-1.md#execution). Проверяйте отказ admission отдельно от сбоя провайдера. Ответ с результатом может содержать короткоживущую подписанную ссылку для большого payload. Перед повтором изменения проверьте исход предыдущего вызова. Сеть может оборваться после применения записи у поставщика. Для поддерживающих это HTTP-методов используйте один idempotency key на одну логическую операцию; raw proxy и mirror требуют отдельной осторожности, поскольку повтор создаёт новый upstream-вызов. [Справочник выполнений](https://context4.me/docs/api-executions.md) описывает status, result, attempts и отмену. Отмена операции не обещает откат уже выполненного изменения во внешнем сервисе. --- # Данные и синхронизация Источник: https://context4.me/docs/syncs [Открыть консоль и подключения этого стенда](https://console.context4.me/integrations). ## Выберите тип данных Доступные типы перечислены на странице коннектора. Если тип не заявлен, не считайте его поддержанным. ## Настройте синхронизацию Используйте доступный режим и расписание в консоли. Наличие типа данных не означает одинаковую задержку или полноту во всех сервисах. ## Проверьте состояние Перед использованием данных проверьте состояние и актуальность синхронизации. Ошибка источника не должна интерпретироваться как отсутствие записей. ## Что проверять перед созданием Получите доступные syncable entities коннектора и delivery capabilities. Схема сущности, доступность чтения истории, режим и расписание зависят от источника. Для API-источника discovery provider schema сохраняет ревизию метаданных; оно не выводит схему из случайных записей. Для базы данных schema discovery возвращает объявленные таблицы и поля; пустая база может иметь корректную пустую схему. ## Источники и история Context4 различает синхронизации объектов и события без хранения объекта. Provider-event subscriptions могут существовать без Sync; событие не означает, что доступно чтение истории этого сервиса. Исторический export — отдельный ресурс с состоянием и отменой. Его доступность и границы определяются источником. Сейчас schema discovery, database polling и CDC поддерживают PostgreSQL и SQL Server. Варианты MySQL и MongoDB присутствуют в публичных схемах, но отложены: discovery возвращает `400 validation_failed`, создание синхронизации на таком источнике отклоняется как not found. Для database polling используйте read-only credentials и поддерживаемый режим; режим чтения определяет, будут ли видны удаления. Брокерная доставка, snapshot и replay не означают одинаковую гарантию для всех провайдеров. Проверяйте фактический run status и source limitations. Точные настройки, состояния, schema hash и поля: [синхронизации](https://context4.me/docs/api-syncs.md), [источники](https://context4.me/docs/api-sources.md), [события](https://context4.me/docs/api-events.md). --- # Доступ и отключение Источник: https://context4.me/docs/access-and-disconnect [Открыть консоль и подключения этого стенда](https://console.context4.me/integrations). ## Предоставляйте необходимый минимум Подключайте только аккаунты, которыми вправе управлять. Проверьте разрешения участников и инструменты перед использованием. ## Отзовите доступ Отключите подключение в Context4 и отзовите разрешения в настройках поставщика. При раскрытии ключа выполните ротацию. ## Обработка данных Содержимое запросов и ответов передаётся транзитом без постоянного хранения в Context4. Отключение и удаление служебных данных учётной записи — разные действия; данные, уже полученные внешним AI, регулируются его правилами. См. [схему обработки](https://context4.me/docs/data-handling.md), [политику обработки](https://context4.me/privacy) и [условия](https://context4.me/terms). ## Три независимых доступа | Доступ | Что отзывать | | --- | --- | | AI-клиент к Context4 | OAuth grant или его token family | | Приложение к Context4 API | API-ключ в консоли | | Context4 к внешнему сервису | Подключение и разрешение на стороне провайдера | Отзыв одного из них не заменяет проверку остальных. Например, отключение AI-клиента не удаляет подключённый CRM-аккаунт и не удаляет учётную запись Context4. Удаление участника или архивирование workspace прекращает последующий OAuth MCP-доступ. ## Общие аккаунты Предоставляйте общий аккаунт только нужному кругу пользователей. При compat-выполнении с указанным `user_id` платформа проверяет tenant, principal, sharing и deny-first ACL. Исключение: явный `connected_account_id` без `user_id` проверяется в границах tenant API-ключа, без principal-проверки и sharing/deny-first ACL. У сессии могут быть дополнительные ограничения. Право управлять организацией не следует выводить из одного технического API scope. --- # Как обрабатываются данные Источник: https://context4.me/docs/data-handling ## Как проходит запрос ```text Ваш AI → Context4 → выбранный рабочий сервис Ваш AI ← Context4 ← ответ сервиса ``` Context4 выполняет разрешённую операцию как прокси. Содержимое запроса и ответа обрабатывается в памяти во время выполнения и передачи результата. Постоянное хранилище содержимого, история чата, архив CRM и резервные копии ответов не создаются. Payload и секреты не включаются в журналы, очереди и кэш. ## Что нужно для подключения Учётная запись, права рабочего пространства, настройки подключений и необходимые токены авторизации существуют отдельно от содержимого операций. Они нужны для входа и обращения к сервисам от вашего имени. Они не дают права использовать данные для рекламы или обучения моделей. ## Что получает ваш AI Результат инструмента получает AI-клиент, который вы выбрали и авторизовали. Его собственные правила хранения и удаления продолжают действовать. Context4 не может удалить данные из уже состоявшегося разговора в другом приложении. Не считайте отсутствие хранения в прокси гарантией отсутствия обработки у всех участников. ## Корпоративные системы До подключения получите необходимые полномочия владельца системы и основания для передачи выбранному AI. Возможность войти и OAuth-согласие не заменяют эти основания. Если данные передаются в другую страну, отдельно проверьте применимые требования. При необходимости оформите договор обработки до передачи. ## Отключение и удаление Отключение прекращает использование секретов соответствующего подключения. MCP-разрешение AI-клиента, API-ключ Context4 и разрешение CRM отзываются отдельно. Для удаления учётной записи и служебных данных напишите в [поддержку](https://context4.me/support#delete). Правила данных исходного сервиса и AI-клиента действуют отдельно. Полный контракт: [политика конфиденциальности](https://context4.me/privacy) и [условия использования](https://context4.me/terms). [Все способы отзыва](https://context4.me/docs/access-and-disconnect.md). --- # Ошибки и поддержка Источник: https://context4.me/docs/troubleshooting ## Авторизация не завершилась Проверьте выбранный аккаунт и доступность интеграции у поставщика. Приватная интеграция может не поддерживать подключение другой организации. ## Действие недоступно Проверьте опубликованные инструменты рабочего пространства, права и версию. Наличие реализации в публичном справочнике не даёт доступ автоматически. ## Обратитесь в поддержку Опишите шаги и сообщение об ошибке, укажите безопасный идентификатор операции. Не отправляйте пароли, токены и содержимое конфиденциальных записей. [Открыть поддержку](https://context4.me/support). --- # Подключение ChatGPT Источник: https://context4.me/docs/connect-chatgpt ## Что понадобится - Аккаунт ChatGPT с доступом к Plugins и разрешением на установку плагина или тестового MCP-подключения. В организации это может потребовать разрешения администратора. - Учётная запись Context4 и рабочее пространство, к которому у вас есть доступ. - Аккаунт нужного рабочего сервиса с правом читать данные и выполнять выбранные действия. Для корпоративного аккаунта нужны полномочия владельца системы. Context4 полностью бесплатен. Подписка ChatGPT и тариф исходного сервиса определяются их поставщиками. ## Подключите Context4 **Способ подключения — плагин Context4.** MCP в Codex и установка CLI не добавляют плагин в ChatGPT. 1. Откройте Plugins в ChatGPT. Если Context4 доступен в вашем каталоге, откройте его карточку и установите. Подтверждённой публичной ссылки на опубликованную карточку Context4 здесь пока нет. 2. Для тестового подключения, если оно разрешено аккаунтом, используйте Plugins → плюс → Add custom MCP server. В интерфейсе Apps этот пункт может называться Create. Укажите Context4, MCP URL ниже и OAuth. 3. Перейдите к браузерной авторизации Context4, войдите, выберите рабочее пространство и подтвердите запрошенный доступ. Если вход отменён или запрещён — подключение не завершено. 4. Включите Context4 среди инструментов разговора. Если нужного пункта нет, уточните доступ у администратора. Агент не может включить отсутствующую функцию сообщением в чате. MCP-сервер текущего окружения: ```text https://context4.me/mcp ``` Облачному ChatGPT нужен доступный публичный HTTPS-сервер: localhost и локальные адреса вашего компьютера ему недоступны. [Официальная инструкция OpenAI](https://help.openai.com/en/articles/12584461-connecting-custom-mcp-servers-in-chatgpt). ## Какие разрешения запрашиваются MCP OAuth использует scope `mcp:tools`: работу с доступными инструментами выбранного рабочего пространства. Он не даёт доступ ко всем вашим сервисам автоматически. [Discovery OAuth](https://context4.me/.well-known/oauth-authorization-server) и [описание MCP-авторизации](https://context4.me/docs/mcp-oauth.md) содержат технические детали. Для каждой CRM или другого сервиса авторизация отдельная: посмотрите его экран согласия и описание коннектора. Права могут разрешать чтение, создание, изменение или отправку. Подключайте только необходимое. Пароль или ключ исходного сервиса вводите в предусмотренном процессе подключения, а не в AI-чат. ## Подключите рабочий сервис Попросите AI найти нужный коннектор и проверить существующие подключения. Если доступа нет, он должен предложить предусмотренную авторизацию. Откройте выданную ссылку, проверьте адрес, аккаунт и разрешения и подтвердите сами. [Консоль подключений](https://console.context4.me/integrations). Если инструмент недоступен, AI должен объяснить ограничение, а не выдавать демонстрационный ответ за реальные данные. ## Первый запрос > Покажи доступные сделки в amoCRM и помоги понять, что сейчас в работе. Используй реальные данные подключения; если доступа нет, помоги подключить аккаунт. Проверьте, что ответ получен после реального вызова инструмента. Для действия сформулируйте отдельное поручение: > Создай задачу позвонить клиенту завтра. Сначала уточни у меня сделку, ответственного и время. Создание возможно только при наличии соответствующего инструмента и прав. [Как проверять выполнение](https://context4.me/docs/actions.md). ## Скиллы Установите `context4` и `context4-setup`; для межсистемных задач добавьте `context4-workflows`. [Инструкция для ChatGPT](https://context4.me/docs/skills-chatgpt.md). Архив навыков не заменяет плагин, доступную функцию ChatGPT или OAuth. ## Отключение и удаление Отключите Context4 в ChatGPT и отзовите его MCP-разрешение. Если нужно прекратить доступ к CRM, отдельно отключите её в Context4 и отзовите разрешение в самой CRM. Удаление плагина не выполняет все эти действия автоматически. Содержимое операций проходит транзитом без хранения в Context4; служебные данные учётной записи и авторизации обрабатываются отдельно. Для удаления аккаунта обратитесь в [поддержку](https://context4.me/support#delete). Удаление данных, уже полученных ChatGPT, регулируется правилами OpenAI. [Обработка данных](https://context4.me/docs/data-handling.md) · [Все способы отзыва](https://context4.me/docs/access-and-disconnect.md) · [Privacy](https://context4.me/privacy) · [Terms](https://context4.me/terms). --- # Скиллы для Codex Источник: https://context4.me/docs/skills-codex ## Сохранение в проект Сохраните полные папки в `.agents/skills//`. Персональная область для всех проектов: `~/.agents/skills//`. Сначала скачайте и прочитайте пакеты: ```sh context4_skill_tmp="$(mktemp -d)" for skill in context4 context4-setup; do curl --fail --location "https://context4.me/skills/$skill/archive.zip" --output "$context4_skill_tmp/$skill.zip" unzip -l "$context4_skill_tmp/$skill.zip" done # Прочитайте SKILL.md и references перед установкой. mkdir -p .agents/skills for skill in context4 context4-setup; do unzip -n "$context4_skill_tmp/$skill.zip" -d .agents/skills done ``` `unzip -n` не перезаписывает файлы. Если папка уже есть, сравните версии: пропуск не означает успешное обновление. В новом разговоре проверьте появление `context4` и `context4-setup`. Для межсистемных задач аналогично добавьте `context4-workflows`. [MCP](https://context4.me/docs/connect-codex.md) настраивается отдельно. [Все файлы](https://context4.me/docs/skills-index.json). Если у агента нет доступа к файлам, сохраните вручную или используйте инструкцию в текущем чате без заявления о постоянной установке. [Официальная спецификация](https://developers.openai.com/codex/skills/). --- # Подключение Claude Источник: https://context4.me/docs/connect-claude Это **Claude в браузере или desktop**, а не Claude Code. [Claude Code подключается отдельно](https://context4.me/docs/connect-claude-code.md). ## Что понадобится - Аккаунт Claude с доступом к Connectors и правом добавлять remote connector; в организации проверьте правила администратора. - Учётная запись Context4, выбранное рабочее пространство и аккаунт рабочего сервиса с необходимыми правами. - Полномочия на передачу данных выбранному AI, если подключается корпоративная система. Context4 бесплатен. Подписка Claude и тарифы рабочих сервисов определяются отдельно их поставщиками. ## Добавьте remote connector 1. Откройте Settings → Connectors в Claude. Если Context4 доступен в каталоге, используйте его карточку; при наличии custom connectors можно добавить свой remote connector. 2. Укажите название Context4 и точный MCP URL текущего окружения: ```text https://context4.me/mcp ``` 3. Начните подключение и пройдите браузерную авторизацию Context4. Войдите, выберите доступное рабочее пространство и подтвердите доступ. Отмена входа или запрет доступа не означают успешную настройку. 4. Включите Context4 в инструментах разговора и попросите проверить доступные подключения. Если функция недоступна, обратитесь к администратору. Облачному Claude нужен доступный публичный HTTPS-адрес. Локальное desktop extension — другой механизм. Команда `claude mcp add` относится к Claude Code и не выполняется сообщением в обычном Claude. [Официальная справка](https://support.claude.com/en/articles/11725091-when-to-use-desktop-and-web-connectors). ## Разрешения и рабочие аккаунты MCP OAuth scope `mcp:tools` даёт доступ к разрешённым инструментам выбранного workspace, а не ко всем сервисам сразу. [OAuth discovery](https://context4.me/.well-known/oauth-authorization-server) · [Техническая инструкция](https://context4.me/docs/mcp-oauth.md). CRM и другие сервисы подключаются отдельно: AI находит коннектор, проверяет существующий доступ и при необходимости возвращает ссылку авторизации. Вы проверяете аккаунт, получателя и scopes на экране согласия. Для API-ключа используйте защищённый процесс Context4, не отправляйте секрет в чат. [Открыть подключения](https://console.context4.me/integrations). ## Первое поручение > Покажи сделки из подключённой CRM, по которым нужно связаться с клиентом. Если нужных данных или прав нет, объясни, что доступно, и ничего не выдумывай. Набор полей и действий зависит от коннектора. Для записи данных используйте отдельный явный запрос: > Создай задачу позвонить клиенту завтра. Сначала уточни сделку, ответственного и время. AI должен использовать реальный инструмент и сообщить подтверждённый результат. [Проверка выполнения](https://context4.me/docs/actions.md). ## Скиллы Установите `context4` и `context4-setup`; для межсистемных задач добавьте `context4-workflows`. [Инструкция для Claude](https://context4.me/docs/skills-claude.md). Скиллы не заменяют remote connector и авторизацию. ## Отключение и данные Отключите коннектор в Claude и отзовите MCP-разрешение. Отдельно отключите рабочий аккаунт в Context4 и отзовите выданное разрешение или ключ в исходном сервисе. Удаление одного подключения не отзывает остальные. Context4 передаёт содержимое операций без постоянного хранения; учётная запись и данные авторизации обрабатываются отдельно. Для удаления аккаунта — [поддержка](https://context4.me/support#delete). Данные, уже полученные Claude, регулируются правилами Anthropic. [Обработка данных](https://context4.me/docs/data-handling.md) · [Отзыв доступа](https://context4.me/docs/access-and-disconnect.md) · [Privacy](https://context4.me/privacy) · [Terms](https://context4.me/terms). --- # Скиллы для Claude Code Источник: https://context4.me/docs/skills-claude-code ## Сохранение в проект Сохраните полные папки в `.claude/skills//`. Персональная область для всех проектов: `~/.claude/skills//`. Сначала скачайте и прочитайте пакеты: ```sh context4_skill_tmp="$(mktemp -d)" for skill in context4 context4-setup; do curl --fail --location "https://context4.me/skills/$skill/archive.zip" --output "$context4_skill_tmp/$skill.zip" unzip -l "$context4_skill_tmp/$skill.zip" done # Прочитайте SKILL.md и references перед установкой. mkdir -p .claude/skills for skill in context4 context4-setup; do unzip -n "$context4_skill_tmp/$skill.zip" -d .claude/skills done ``` `unzip -n` не перезаписывает файлы. Если папка уже есть, сравните версии: пропуск не означает успешное обновление. В новом разговоре проверьте появление `context4` и `context4-setup`. Для межсистемных задач аналогично добавьте `context4-workflows`. [MCP](https://context4.me/docs/connect-claude-code.md) настраивается отдельно. [Все файлы](https://context4.me/docs/skills-index.json). Если у агента нет доступа к файлам, сохраните вручную или используйте инструкцию в текущем чате без заявления о постоянной установке. [Официальная спецификация](https://code.claude.com/docs/en/skills). --- # Подключение Codex Источник: https://context4.me/docs/connect-codex **Достаточно прямого MCP. Плагин не обязателен.** Используйте настройки MCP в приложении. Если доступны терминал и Codex CLI: ```sh codex mcp get context4 codex mcp add context4 --url 'https://context4.me/mcp' codex mcp login context4 codex mcp get context4 ``` Если запись уже существует с нужным адресом, пропустите добавление. Отсутствие записи при первом `get` означает, что сервер ещё не настроен. При другом адресе уточните намерение пользователя. Вход выполните по ссылке клиента. Если инструменты не появились, обновите сессию или откройте новый чат. Плагин может стать дополнительным способом установки после публикации; прямой MCP остаётся доступным. [Официальная документация Codex MCP](https://developers.openai.com/codex/mcp). ## Установите скиллы Context4 Для штатного подключения установите `context4` и `context4-setup`. Для межсистемных задач добавьте `context4-workflows`. [Установка для Codex](https://context4.me/docs/skills-codex.md). Скиллы не заменяют MCP и авторизацию. [Общая инструкция агента](https://context4.me/docs/agent-setup.md). --- # Скиллы для Hermes Источник: https://context4.me/docs/skills-hermes ## Прямая ссылка Прочитайте [context4](https://context4.me/skills/context4/SKILL.md), [setup](https://context4.me/skills/context4-setup/SKILL.md) и references перед установкой. Hermes загружает SKILL.md и явно связанные файлы: ```sh hermes skills install 'https://context4.me/skills/context4/SKILL.md' hermes skills install 'https://context4.me/skills/context4-setup/SKILL.md' ``` Обычное расположение — `~/.hermes/skills/`. Начните новую сессию и проверьте доступность. Агент может сохранить полный пакет через `skill_manage`; не перезаписывайте изменения молча. Дополнительно: [context4-workflows](https://context4.me/skills/context4-workflows/SKILL.md). [MCP/OAuth](https://context4.me/docs/connect-hermes.md) — отдельная настройка. [Официальная установка](https://hermes-agent.nousresearch.com/docs/guides/work-with-skills/). Формат документирован, сквозная работа с Context4 пока не проверена. --- # Подключение Claude Code Источник: https://context4.me/docs/connect-claude-code Это отдельный клиент с терминалом. Команды для MCP этого стенда: ```sh claude mcp get context4 claude mcp add --transport http context4 'https://context4.me/mcp' ``` Переиспользуйте существующую подходящую запись. В Claude Code откройте `/mcp`, выберите Context4 и авторизуйтесь в браузере. При необходимости переподключите сервер и проверьте появление инструментов. Плагин из marketplace может быть альтернативой после публикации реального пакета Context4, но не обязателен для прямого MCP. [Claude Code MCP](https://code.claude.com/docs/en/mcp), [плагины](https://code.claude.com/docs/en/discover-plugins). Существующий адрес [/connect/claude](https://context4.me/connect/claude) относится именно к Claude Code. ## Установите скиллы Context4 Для штатного подключения установите `context4` и `context4-setup`. Для межсистемных задач добавьте `context4-workflows`. [Установка для Claude Code](https://context4.me/docs/skills-claude-code.md). Скиллы не заменяют MCP и авторизацию. [Общая инструкция агента](https://context4.me/docs/agent-setup.md). --- # Скиллы для OpenClaw Источник: https://context4.me/docs/skills-openclaw ## Локальный пакет Скачайте [context4 ZIP](https://context4.me/skills/context4/archive.zip) и [setup ZIP](https://context4.me/skills/context4-setup/archive.zip), распакуйте во временную папку, прочитайте SKILL.md и references. Из каталога с распакованными папками: ```sh openclaw skills install ./context4 --as context4 openclaw skills install ./context4-setup --as context4-setup ``` По умолчанию используется `skills/` workspace. `--global` устанавливает в `~/.openclaw/skills` для локальных агентов. Сохраните свои изменения и проверьте скиллы в новой сессии. Это локальные пакеты, а не опубликованная запись ClawHub. Дополнительно: [workflows ZIP](https://context4.me/skills/context4-workflows/archive.zip). [MCP](https://context4.me/docs/connect-openclaw.md) — отдельно. [Официальная установка](https://docs.openclaw.ai/tools/skills). Сквозная работа с Context4 пока не проверена. --- # Подключение Hermes Источник: https://context4.me/docs/connect-hermes Hermes Agent документирует remote MCP и OAuth. Это конфигурация MCP для Hermes Agent. В его файле `~/.hermes/config.yaml` добавьте сервер в существующий `mcp_servers`, сохранив остальные настройки. Готовая конфигурация для MCP этого стенда: ```yaml mcp_servers: context4: url: "https://context4.me/mcp" auth: oauth ``` Затем выполните: ```sh hermes mcp login context4 ``` Авторизуйтесь по ссылке клиента. Перезапустите Hermes или выполните `/reload-mcp`, затем проверьте появление инструментов. Сквозная работа Hermes с Context4 пока не подтверждена. При ошибке OAuth не заменяйте его передачей секретов в чат. [Официальная документация Hermes MCP](https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp). ## Установите скиллы Context4 Для штатного подключения установите `context4` и `context4-setup`. Для межсистемных задач добавьте `context4-workflows`. [Установка для Hermes](https://context4.me/docs/skills-hermes.md). Скиллы не заменяют MCP и авторизацию. [Общая инструкция агента](https://context4.me/docs/agent-setup.md). --- # Скиллы для Claude Источник: https://context4.me/docs/skills-claude ## Загрузите в аккаунт Это Claude web/desktop, не Claude Code. Скачайте и прочитайте [context4 ZIP](https://context4.me/skills/context4/archive.zip), [setup ZIP](https://context4.me/skills/context4-setup/archive.zip). Каждый архив содержит одну папку с SKILL.md и references. Откройте Customize → Skills → плюс → Create skill → Upload a skill. Загрузите и включите каждый пакет. Доступность зависит от аккаунта, code execution и правил организации. Агент готовит файлы и объясняет шаги; не объявляет загрузку выполненной без фактического действия. Дополнительно: [workflows ZIP](https://context4.me/skills/context4-workflows/archive.zip). Скиллы не создают [remote connector](https://context4.me/docs/connect-claude.md). Облачному Claude нужны доступные HTTPS-адреса. Если загрузка запрещена, используйте [инструкцию](https://context4.me/docs/agent-setup.md) в текущем разговоре, отметив отсутствие установки. [Официальная инструкция](https://support.claude.com/en/articles/12512180-use-skills-in-claude). --- # Подключение OpenClaw Источник: https://context4.me/docs/connect-openclaw Используйте встроенный MCP. Обязательный сторонний bridge не нужен. В Settings → MCP добавьте Context4 с адресом `https://context4.me/mcp`, транспортом Streamable HTTP и OAuth. Выполните Sign in под пользователем с правами управления сервером. В конфигурации серверы находятся в `mcp.servers`, OAuth выбирается через `auth: "oauth"`. Полный формат сверяйте с документацией вашей версии; сохраните остальные серверы и правила разрешённых инструментов. Обновите подключение и проверьте инструменты в агенте. Если установленная версия не поддерживает нужный MCP/OAuth, сообщите об этом пользователю. Сквозная совместимость OpenClaw с Context4 пока не проверена. [Официальная документация OpenClaw MCP](https://docs.openclaw.ai/tools/mcp). ## Установите скиллы Context4 Для штатного подключения установите `context4` и `context4-setup`. Для межсистемных задач добавьте `context4-workflows`. [Установка для OpenClaw](https://context4.me/docs/skills-openclaw.md). Скиллы не заменяют MCP и авторизацию. [Общая инструкция агента](https://context4.me/docs/agent-setup.md). --- # Скиллы для ChatGPT Источник: https://context4.me/docs/skills-chatgpt ## ChatGPT web Для штатного подключения нужен плагин Context4 с MCP и базовыми скиллами. [Исходный пакет плагина](https://context4.me/skills/plugin.zip) содержит plugin.json, mcp.json и три skill-папки с адресами стенда. Это пакет для подготовки и тестирования, а не опубликованная install-ссылка. Скачивание ZIP не устанавливает плагин в ChatGPT. После публикации установите настоящий плагин из доступного каталога и подтвердите OAuth. Не придумывайте URL каталога и не пытайтесь установить web-плагин записью в `.agents/skills` на компьютере. [Ручная настройка MCP-плагина](https://context4.me/docs/connect-chatgpt.md) добавляет MCP, но не доказывает установку скиллов. До поддерживаемой установки пакета используйте [общую инструкцию](https://context4.me/docs/agent-setup.md) как руководство текущего чата. ## ChatGPT desktop Официальный формат поддерживает standalone skills в desktop. Если среда умеет создавать скиллы, дайте агенту [индекс файлов](https://context4.me/docs/skills-index.json) и попросите сохранить `context4` и `context4-setup` через поддерживаемый skill creator/installer. Проверьте появление в Skills. Не переносите эту возможность на web автоматически. [Официальный формат OpenAI](https://developers.openai.com/codex/skills/). Облачному ChatGPT нужны публичные HTTPS-адреса MCP и документации; localhost недоступен. --- # Техническая документация Источник: https://context4.me/docs/api-reference Публичная поверхность Context4 состоит из HTTP API `/v1`, удалённого `/mcp`, протокола OAuth для MCP и адаптера Composio по `/compat/context4/v1`. Это разные способы доступа к общим подключениям и выполнению с проверкой прав, политик и квот. ## HTTP API [Общие правила и авторизация](https://context4.me/docs/api.md) объясняют ключи, ошибки, пагинацию и повторы. [Полный OpenAPI JSON](https://context4.me/docs/openapi.json) содержит 66 операций на 45 путях и 61 именованную схему; справочник ниже генерируется из этого же публичного контракта. | Раздел | Содержание | | --- | --- | | [Инструменты и идентификация](https://context4.me/docs/api-tools.md) | Каталог, схема инструмента, текущая область доступа | | [Выполнения](https://context4.me/docs/api-executions.md) | Создание, список, состояние, попытки и отмена | | [Подключения](https://context4.me/docs/api-connections.md) | Аккаунты, auth configs, сохранённые схемы провайдера | | [Источники и сети](https://context4.me/docs/api-sources.md) | Базы данных, credentials, discovery, сеть и схемы | | [Сессии](https://context4.me/docs/api-sessions.md) | Создание, чтение, изменение и список инструментов | | [Синхронизации](https://context4.me/docs/api-syncs.md) | Настройки, запуски, записи, replay и экспорты | | [События](https://context4.me/docs/api-events.md) | Каталог событий и подписки провайдеров | | [HTTP провайдера](https://context4.me/docs/api-endpoints.md) | Discovery и mirror-вызовы | | [JSON Schema](https://context4.me/docs/api-schemas-1.md) | Полные структуры запросов и ответов, четыре части | ## AI и MCP [Подключение и протокол](https://context4.me/docs/ai-mcp.md), [пять метаинструментов с точными схемами](https://context4.me/docs/mcp-tools.md), [OAuth](https://context4.me/docs/mcp-oauth.md). Инструменты сервисов загружаются из живого каталога; полный универсальный список действий для всех аккаунтов не существует. ## Прямой HTTP и SDK [Proxy-запросы](https://context4.me/docs/proxy-requests.md) объясняют пути, query, тело, авторизацию и ограничения. [Composio SDK](https://context4.me/docs/composio-sdk.md) описывает совместимые версии и отличие от нативных контрактов. Публичная документация описывает клиентские интерфейсы. Внутренние ingress, service-to-service контроллеры, служебные проверки и операторские настройки не являются клиентским API. ## Машиночитаемая справка [OpenAPI JSON](https://context4.me/docs/openapi.json), [индекс HTTP и MCP со схемами](https://context4.me/docs/api-index.json), [реестр compat-маршрутов](https://context4.me/docs/compat-routes.json), [инструкции для AI](https://context4.me/llms.txt), [полная документация одним текстом](https://context4.me/llms-full.txt). Каждую главу можно получить как Markdown, добавив `.md` к её адресу. [Публичный каталог коннекторов и действий в JSON](https://context4.me/docs/connectors.json) содержит версии, способы авторизации и ключи действий. Это снимок каталога, а не подтверждение доступа в текущем аккаунте: схемы и доступность проверяйте через discovery. --- # Авторизация и правила API Источник: https://context4.me/docs/api ## Адрес и авторизация Адрес API этого стенда: `https://context4.me/v1`. [Консоль и подключения](https://console.context4.me/integrations). Переменная `CONTEXT4_API_KEY` содержит ваш секретный ключ серверного окружения; документация его не подставляет. ```bash curl "https://context4.me/v1/identity" \ -H "Authorization: Bearer $CONTEXT4_API_KEY" ``` Ключ выпускается в консоли и показывается один раз. Его формат — `ctx4__`. Ключ ограничен областью организации и рабочего пространства и набором полномочий. Чужой tenant-ресурс возвращает `404 not_found`. Нужное полномочие каждого метода указано в [справочнике](https://context4.me/docs/api-reference.md). | Полномочие | Назначение | | --- | --- | | `tools:read` | Инструменты и каталог HTTP-методов | | `executions:read`, `executions:write` | Чтение и создание выполнений; proxy тоже требует write | | `connections:read`, `connections:write` | Подключения, auth configs и источники | | `connections:manage` | Дополнительное право управлять чужими подключениями внутри tenant; требует connections:write | | `tool-sessions:read`, `tool-sessions:write` | Сессии инструментов | | `syncs:read`, `syncs:write` | Синхронизации и экспорты | | `events:read`, `events:write` | События и подписки | Отсутствующее полномочие даёт `403 capability_missing`. Обычный ключ не получает право изменять чужое подключение только из-за наличия `connections:write`. MCP OAuth не делегирует `connections:manage`. Интерфейс предназначен для серверного использования. CORS на `/v1`, `/mcp` и compat не включён. Не помещайте bearer-ключ в браузерный код, URL или публичный репозиторий. ## Тела и идентификаторы запросов JSON передавайте с `Content-Type: application/json`. Лимит входного тела — 65 536 байт. Заголовки и request line ограничены listener; длинный vendor URL может быть отклонён ещё до маршрутизации. `X-Request-Id` необязателен: допустимы 1–128 символов по шаблону `[A-Za-z0-9][A-Za-z0-9._:-]{0,127}`. Без него сервер создаёт UUID. Некорректное значение отклоняется с `422`; ответ содержит новый безопасный request id. Сохраняйте `X-Request-Id` и execution id для диагностики. ## Идемпотентность и повторы Передавайте `Idempotency-Key`, когда он объявлен в параметрах метода. Значение: 8–128 символов `[A-Za-z0-9._:-]`. Повтор того же запроса с тем же ключом возвращает исходный результат; изменённое тело с прежним ключом даёт `409 idempotency_conflict`. Для новой намеренной операции выбирайте новый ключ. `202` при создании execution означает принятие или сохранённый отказ, а не успешное изменение у провайдера. Читайте `status`, `denial_code` и адрес из `Location`, затем опрашивайте execution. Не повторяйте запись автоматически после таймаута: она могла примениться. Текущий `idempotency_conflict` не различает ещё выполняющийся запрос и несовпадающее тело; `Retry-After` для него не обещан. Сверьте исходный запрос и состояние операции. Mirror API и raw proxy не являются идемпотентными: каждый вызов может отправить новый запрос провайдеру. ## Пагинация Списки используют непрозрачный `cursor` и `next_cursor`. Передавайте полученный курсор неизменным до `null`; не конструируйте его из ID. Общий `limit` — 1–100, по умолчанию 20; точные параметры и ограничения конкретного метода приведены в справочнике. Курсор ограничен 400 символами. Фильтры сохраняйте одинаковыми между страницами. Vendor-пагинация — отдельный контракт провайдера: смотрите `paging` в описании endpoint. Существование курсора Context4 не означает автоматический сбор всех страниц upstream. ## Ошибки и лимиты Ошибка платформы возвращается как `application/problem+json` с `type`, `code`, `title`, `status`, `request_id`. Точные enum и поля: [Problem](https://context4.me/docs/api-schemas-1.md#problem). Внутренние причины и credentials клиенту не передаются. | HTTP | Действие клиента | | --- | --- | | 400 | Исправьте параметры или тело; проверьте схему | | 401 | Проверьте ключ, срок и отзыв | | 403 | Проверьте полномочия, владельца, политику и ограничения сессии | | 404 | Проверьте ID и область доступа | | 409 | Проверьте конфликт версии, аккаунта или idempotency key | | 429 | Соблюдайте `Retry-After`, если он возвращён | | 500 | Сохраните request id для поддержки | | 503 | Проверьте доступность сервиса; повтор записи требует проверки исхода | `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` описывают минутное окно API-ключа; reset — число секунд до сброса. При недоступности Redis изменения закрываются с `503`; чтение может продолжиться без rate-limit заголовков. Квота выполнения и лимит HTTP-запросов — отдельные проверки. --- # AI и MCP Источник: https://context4.me/docs/ai-mcp ## Подключение Адрес MCP этого стенда: `https://context4.me/mcp`. Для облачного клиента он должен быть доступен по HTTPS. Клиент с поддержкой remote HTTP MCP обнаружит OAuth, откроет браузерный вход и запросит доступ к выбранному рабочему пространству. API-ключ Context4 для этого сценария не нужен. [Быстрый старт](https://context4.me/docs/quickstart.md) начинается с готового промпта на странице [подключения](https://context4.me/connect). Не создавайте вручную provider authorization URL. Ссылка приходит от Context4. Вход в Context4 и подключение аккаунта провайдера — разные разрешения. Провайдер может требовать собственный ключ, OAuth consent или credentials в защищённой форме. Автоматизации могут использовать API-ключ в `Authorization: Bearer`, `x-consumer-api-key` или `x-api-key` согласно настройке клиента. Секрет не включается в URL. HTTP ресурс поддерживает `POST`, `GET`, `DELETE /mcp`; транспорт — Streamable HTTP. ## Рабочая последовательность агента 1. `CONTEXT4_SEARCH_TOOLS`: найти действие по задаче; проверить connection status и теги. 2. `CONTEXT4_GET_TOOL_SCHEMAS`: получить точные input/output schemas найденных `tool_slug`. 3. `CONTEXT4_MANAGE_CONNECTIONS` с `action: list`: проверить аккаунты. С `action: connect` получить существующее активное подключение либо hosted Connect Link. 4. Показать пользователю полученную ссылку. При наличии `connection_id` вызвать `CONTEXT4_WAIT_FOR_CONNECTIONS`; повторять по `retry_after_ms`, пока статус не станет active либо терминальным отказом. 5. `CONTEXT4_MULTI_EXECUTE_TOOL`: передать 1–20 инструментов с аргументами из схем; явно указать `connection_id`, если аккаунтов несколько. 6. Проверить каждый элемент `results`: `succeeded`, `pending` или `error`. Пустые данные сообщить как пустые; pending не выдавать за успех. Полный набор и схемы: [MCP-инструменты](https://context4.me/docs/mcp-tools.md). Поиск ранжирует совпадения и не является полным перечнем интеграций. Теги `read-only`, `destructive`, `idempotent`, `open-world`, `curated` помогают отбору; все `tags` должны присутствовать, любое совпадение `exclude_tags` исключает результат. ## Сессии и динамические инструменты Глобальный `/mcp` показывает пять стабильных метаинструментов. Адрес сессии `/mcp?session=` возвращается при создании сессии и показывает её snapshot инструментов, разрешённые feature flags метаинструменты и `context4.get_execution`. Схемы provider-инструментов зависят от закреплённой версии каталога; используйте фактический `tools/list`. `context4.get_execution` принимает объект с единственным обязательным строковым `execution_id`; дополнительные поля схема не объявляет. Он позволяет получить состояние и терминальный результат pending-вызова. SDK session mode также публикует включённые алиасы `COMPOSIO_SEARCH_TOOLS`, `COMPOSIO_GET_TOOL_SCHEMAS`, `COMPOSIO_MANAGE_CONNECTIONS`, `COMPOSIO_WAIT_FOR_CONNECTIONS`, `COMPOSIO_MULTI_EXECUTE_TOOL`. Они направляются в те же обработчики. Если session flag workbench включён, могут перечисляться `COMPOSIO_REMOTE_WORKBENCH` и `COMPOSIO_REMOTE_BASH_TOOL`: они возвращают `not_supported`, поскольку удалённый sandbox в этом развёртывании не реализован. Наличие имени в списке не является обещанием работающего shell. Сессия `readOnly` разрешает только инструменты с тегом `read-only`; инструмент без тега считается записью. Поиск и метаисполнение внутри такой сессии наследуют ограничение. TTL, отзыв и call budget сессии проверяются также при выполнении. ## Результаты и ошибки MCP-ответ содержит `structuredContent` и текстовый JSON в `content`. Неизвестное имя или некорректные аргументы дают error result с `isError: true`; транспортный успех сам по себе не означает успех инструмента. Ошибки внутри пачки проверяются отдельно в каждом `results`. `connection_required` требует подключения, `connection_ambiguous` — выбора аккаунта, `authorization_pending` — ожидания, `invalid_arguments` — сверки схемы. При `permission_denied` и `rate_limited` устраните ограничение; при `execution_pending` используйте execution id и указанный интервал. `execution_failed` не доказывает, что внешняя запись не применялась. Права на чтение не разрешают агенту делать тестовую запись. Первую проверку выполняйте безопасным доступным чтением. Удаления, изменения и сообщения выполняются только по явному поручению пользователя. --- # Справочник MCP-инструментов Источник: https://context4.me/docs/mcp-tools MCP этого стенда: `https://context4.me/mcp`. Это полный стабильный набор глобального `/mcp`. Инструменты конкретных сервисов обнаруживаются через поиск и получение схем; их список зависит от каталога и прав. Правила подключения и обработки ошибок — [AI и MCP](https://context4.me/docs/ai-mcp.md). Строгие входные схемы отвергают неизвестные поля. У `arguments` дополнительно проверяется сериализуемость и предел 65 536 символов JSON; пользовательская проверка Zod не представима стандартным JSON Schema. ## CONTEXT4_SEARCH_TOOLS Search Context4 for provider tools needed for a task. Results include connection readiness. ### Входная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "query": { "type": "string", "minLength": 2, "maxLength": 500 }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "limit": { "default": 10, "type": "integer", "minimum": 1, "maximum": 20 }, "tags": { "maxItems": 5, "type": "array", "items": { "type": "string", "enum": [ "read-only", "destructive", "idempotent", "open-world", "curated" ] } }, "exclude_tags": { "maxItems": 5, "type": "array", "items": { "type": "string", "enum": [ "read-only", "destructive", "idempotent", "open-world", "curated" ] } } }, "required": [ "query" ], "additionalProperties": false } ``` ### Выходная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "tools": { "type": "array", "items": { "type": "object", "properties": { "tool_slug": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "name": { "type": "string", "minLength": 1, "maxLength": 160 }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "tags": { "maxItems": 5, "type": "array", "items": { "type": "string", "enum": [ "read-only", "destructive", "idempotent", "open-world", "curated" ] } }, "connection_status": { "type": "string", "enum": [ "connected", "connection_required", "multiple_connections" ] } }, "required": [ "tool_slug", "connector_id", "name", "description", "connection_status" ], "additionalProperties": false } }, "next_cursor": { "type": [ "string", "null" ] } }, "required": [ "tools", "next_cursor" ], "additionalProperties": false } ``` ## CONTEXT4_GET_TOOL_SCHEMAS Get exact input and output schemas for tool slugs returned by tool search. ### Входная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "tool_slugs": { "minItems": 1, "maxItems": 20, "type": "array", "items": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" } } }, "required": [ "tool_slugs" ], "additionalProperties": false } ``` ### Выходная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "tools": { "type": "array", "items": { "type": "object", "properties": { "tool_slug": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "name": { "type": "string", "minLength": 1, "maxLength": 160 }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "input_schema": {}, "output_schema": { "anyOf": [ {}, { "type": "null" } ] } }, "required": [ "tool_slug", "connector_id", "name", "description", "input_schema", "output_schema" ], "additionalProperties": false } }, "missing": { "type": "array", "items": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" } } }, "required": [ "tools", "missing" ], "additionalProperties": false } ``` ## CONTEXT4_MANAGE_CONNECTIONS List connected accounts or create a hosted authorization link. ### Входная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "oneOf": [ { "type": "object", "properties": { "action": { "type": "string", "const": "list" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] } }, "required": [ "action", "connector_id" ], "additionalProperties": false }, { "type": "object", "properties": { "action": { "type": "string", "const": "connect" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "display_name": { "type": "string", "minLength": 2, "maxLength": 120 }, "return_path": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^\\/(?!\\/)[A-Za-z0-9/_.-]*$" } }, "required": [ "action", "connector_id" ], "additionalProperties": false } ] } ``` ### Выходная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "listed" }, "connections": { "type": "array", "items": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "display_name": { "type": "string", "minLength": 1, "maxLength": 120 }, "status": { "type": "string", "enum": [ "pending", "active", "degraded", "revoked", "failed" ] } }, "required": [ "connection_id", "connector_id", "display_name", "status" ], "additionalProperties": false } } }, "required": [ "status", "connections" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "authorization_required" }, "connection_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "connect_url": { "type": "string", "maxLength": 2048, "format": "uri" }, "expires_at": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" }, "instruction": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": [ "status", "connection_id", "connect_url", "expires_at", "instruction" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "credentials_required" }, "connect_url": { "type": "string", "maxLength": 2048, "format": "uri" }, "instruction": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": [ "status", "connect_url", "instruction" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "active" }, "connection": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "display_name": { "type": "string", "minLength": 1, "maxLength": 120 }, "status": { "type": "string", "enum": [ "pending", "active", "degraded", "revoked", "failed" ] } }, "required": [ "connection_id", "connector_id", "display_name", "status" ], "additionalProperties": false } }, "required": [ "status", "connection" ], "additionalProperties": false } ] } ``` ## CONTEXT4_WAIT_FOR_CONNECTIONS Wait for a hosted authorization flow to become active. ### Входная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "timeout_seconds": { "default": 30, "type": "integer", "minimum": 1, "maximum": 60 } }, "required": [ "connection_id" ], "additionalProperties": false } ``` ### Выходная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "status": { "type": "string", "enum": [ "active", "pending", "failed", "revoked", "degraded" ] }, "connection": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "connector_id": { "anyOf": [ { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$" }, { "type": "string", "minLength": 2, "maxLength": 80, "pattern": "^[a-z][a-z0-9-]*$" } ] }, "display_name": { "type": "string", "minLength": 1, "maxLength": 120 }, "status": { "type": "string", "enum": [ "pending", "active", "degraded", "revoked", "failed" ] } }, "required": [ "connection_id", "connector_id", "display_name", "status" ], "additionalProperties": false }, "retry_after_ms": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] } }, "required": [ "status", "connection", "retry_after_ms" ], "additionalProperties": false } ``` ## CONTEXT4_MULTI_EXECUTE_TOOL Execute up to 20 discovered tools through tenant-scoped connections. ### Входная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "tools": { "minItems": 1, "maxItems": 20, "type": "array", "items": { "type": "object", "properties": { "tool_slug": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" }, "arguments": {}, "connection_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "tool_slug", "arguments" ], "additionalProperties": false } } }, "required": [ "tools" ], "additionalProperties": false } ``` ### Выходная схема ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "results": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "succeeded" }, "tool_slug": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" }, "execution_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "result": {} }, "required": [ "status", "tool_slug", "execution_id", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "pending" }, "tool_slug": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" }, "execution_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "retry_after_ms": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "status", "tool_slug", "execution_id", "retry_after_ms" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "error" }, "tool_slug": { "type": "string", "minLength": 3, "maxLength": 240, "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$" }, "error_code": { "type": "string", "enum": [ "authentication_required", "permission_denied", "connection_required", "connection_ambiguous", "connection_default_required", "workspace_changed", "authorization_pending", "tool_not_found", "invalid_arguments", "rate_limited", "execution_pending", "execution_failed", "internal_error" ] }, "message": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": [ "status", "tool_slug", "error_code", "message" ], "additionalProperties": false } ] } } }, "required": [ "results" ], "additionalProperties": false } ``` --- # OAuth для MCP Источник: https://context4.me/docs/mcp-oauth ## Адреса этого стенда - MCP resource: `https://context4.me/mcp`. - [Discovery ресурса](https://context4.me/.well-known/oauth-protected-resource/mcp). - [Discovery OAuth](https://context4.me/.well-known/oauth-authorization-server). Полные адреса authorize, token, register и revoke берите из discovery этого стенда. Consent и provider authorization URLs возвращает сервер: не собирайте их вручную из примеров. ## Публичные маршруты | Метод и путь | Назначение | Вход и результат | | --- | --- | --- | | `GET https://context4.me/.well-known/oauth-protected-resource/mcp` | Discovery ресурса | Metadata с authorization server и MCP resource | | `GET https://context4.me/.well-known/oauth-authorization-server` | Discovery OAuth | Endpoint URLs, scope и поддерживаемые grants | | `POST https://context4.me/oauth/register` | Регистрация клиента | JSON с redirect URIs; client id, public client без секрета | | `GET https://context4.me/oauth/authorize` | Начало authorization code | Query `client_id`, `redirect_uri`, `response_type=code`, `scope=mcp:tools`, `resource`, `code_challenge`, `code_challenge_method=S256`, `state`; браузерный redirect | | `GET https://context4.me/oauth/consent` | Страница подтверждения | Продолжение браузерного consent в выбранном workspace | | `POST https://context4.me/oauth/token` | Code exchange и refresh | Form-urlencoded; токены и срок действия | | `POST https://context4.me/oauth/revoke` | Отзыв семейства токенов | Form-urlencoded `token`: access или refresh token | | `POST https://context4.me/mcp`, `GET https://context4.me/mcp`, `DELETE https://context4.me/mcp` | MCP resource | MCP messages и lifecycle, bearer access token | Клиент строит URLs по discovery. Не придумывайте authorization URL из примера. Resource этого стенда — `https://context4.me/mcp`; для публичного клиента требуется доступный HTTPS. Public client использует `token_endpoint_auth_method=none` и PKCE S256. ## Регистрация и redirect Redirect URI должен точно совпадать с зарегистрированным. Разрешены HTTPS и callback на loopback native-клиента. Wildcard, fragment, credentials в URL и HTTP вне loopback отклоняются. Публичный MCP resource должен иметь стабильный HTTPS адрес. ## Обмен кода При `grant_type=authorization_code` нужны `code`, `client_id`, `redirect_uri`, `code_verifier`, `resource`. Code verifier — строка 43–128 символов. Код одноразовый, срок — пять минут. При `grant_type=refresh_token` нужны `refresh_token`, `client_id`, `resource`. Access token непрозрачный, срок — 15 минут. Refresh token меняется при обновлении; срок family — 30 дней. Повтор использованного refresh token отзывает family. Храните свежий refresh token атомарно. OAuth-ошибки используют `{error, error_description}`, а не общий Problem API; token-ответы не кэшируются. Ошибку consent или code exchange нельзя обходить повтором provider-записи. ## Что разрешает grant Grant даёт MCP-доступ к workspace, сохраняя действующие права и ограничения. Он не создаёт новый аккаунт провайдера. Существующее активное подключение может переиспользоваться; при нескольких агент просит выбрать. Каждый OAuth MCP-запрос проверяет актуальное membership и workspace. Отзыв токена, удаление участника, изменение его membership epoch, архивирование workspace и истечение grant прекращают доступ. Отзыв MCP OAuth не равен отзыву provider credentials: [раздел доступа](https://context4.me/docs/access-and-disconnect.md). --- # Proxy-запросы к провайдеру Источник: https://context4.me/docs/proxy-requests ## Выбор интерфейса | Вариант | Когда использовать | Граница | | --- | --- | --- | | Mirror `/v1/api/` | Вызов HTTP-метода из каталога endpoint | Только опубликованные метод и шаблон; JSON Schema проверяется | | Composio `tools/execute/proxy` | Raw-вызов API подключённого сервиса без tool wrapper | Относительный путь внутри API этого коннектора; без схемы инструмента | | Session proxy | Raw-вызов внутри SDK-сессии | Дополнительно TTL, статус, budget и закреплённый аккаунт сессии | Proxy позволяет обращаться к методам провайдера, для которых нет отдельного инструмента. Это не произвольный HTTP-доступ к любому адресу. Провайдер, credentials и базовый адрес определяются подключением и конфигурацией коннектора. Для некоторых коннекторов origin берётся из подключения и проходит egress-проверку. ## Обнаружение mirror endpoint 1. Получите `GET /v1/connectors/{connectorId}/endpoints` с `tools:read`. Фильтры: `q`, `group`, `include_removed`, `cursor`, `limit`. 2. Выберите endpoint и запросите `GET /v1/connectors/{connectorId}/endpoint?method=GET&path=...`. `path` — шаблон из каталога; кодируйте его как query value. 3. Прочитайте `input_schema`, `output_schema`, `risk`, `sensitive`, `idempotent`, `paging` и `descriptor_digest`. Входная схема содержит точные vendor-поля; формат зависит от провайдера. 4. Заполните параметры и вызовите его `call_url` методом из описания. [Полный контракт discovery и mirror](https://context4.me/docs/api-endpoints.md). Endpoint ID имеет вид метода и шаблона пути. Удалённая запись может присутствовать в списке с `include_removed=true`; выполнить её нельзя. Endpoint не становится автоматически MCP-инструментом. ## Mirror: запрос и ответ ```bash curl "https://context4.me/v1/api/amocrm/api/v4/leads/7" \ -H "Authorization: Bearer $CONTEXT4_API_KEY" \ -H "Context4-Connection-Id: $CONTEXT4_CONNECTION_ID" ``` Это пример формы GET, который применим, если данный endpoint есть в вашем каталоге и аккаунт имеет доступ к сделке. Origin и ключи берутся из вашего окружения. Тело отсутствует у bodyless-метода; для JSON-записи передавайте vendor JSON напрямую. Mirror поддерживает GET, POST, PUT, PATCH, DELETE; HEAD даёт `405` и ничего не исполняет. Путь зеркалирует путь провайдера после `/v1/api/{connectorId}/`. Можно передавать `/` буквально либо закодировать весь vendorPath одним сегментом. Slash внутри одного значения параметра передаётся как `%2F`, а при кодировании всего пути — `%252F`. Он допустим только в параметре известного шаблона; `.` и `..` части запрещены. Query и объявленные vendor-заголовки проверяются входной схемой. Массивы передаются повторёнными именами или разделителем согласно descriptor; неизвестный query и повтор скалярного параметра отклоняются. Нельзя предполагать, что любой входящий заголовок будет отправлен провайдеру. Вызов требует `executions:write`, включая GET. `Context4-Connection-Id` обязателен; чужой коннектор или отозванное подключение даёт platform conflict. Неизвестный endpoint даёт `404` до upstream-запроса, неверные vendor-параметры — `400` до создания execution. Ответ сохраняет HTTP-статус и JSON-тело провайдера, допустимые `etag`/`retry-after`. `Context4-Origin: provider` отличает его от platform-ошибки, `Context4-Execution-Id` связывает вызов с выполнением. Ошибка платформы имеет `Context4-Origin: platform` и problem JSON. Не считайте любой 403 ошибкой политики: проверьте origin. Каталог mirror включает операции, которые можно передать JSON в обе стороны. Multipart, form body, произвольные bytes и redirect-only download не обещаны. Недоступный provider, таймаут или не-JSON ответ могут дать `503`. Каждый mirror-вызов — новый запрос, даже с повторённым Idempotency-Key. ## Raw Composio proxy `POST /compat/context4/v1/api/v3.1/tools/execute/proxy` принимает: ```json { "connected_account_id": "UUID выбранного подключения", "endpoint": "/api/v4/leads", "method": "GET", "parameters": [ { "name": "limit", "type": "query", "value": 10 } ] } ``` Подставьте реальный UUID. `method`: GET, POST, PUT, DELETE, PATCH, HEAD. `endpoint` — относительный путь от API base коннектора с начальным `/`. `parameters` — массив объектов с `name`, `type` (`header` или `query`) и строковым/числовым `value`; `in` принимается вместо `type`. Необязательный `body` — JSON. Повтор имени в этом legacy массиве заменяет предыдущее значение; для vendor-массивов предпочтителен mirror с явной схемой сериализации. Результат — JSON-конверт `{status, data, headers}`. HTTP-статус самого compat-запроса отличается от upstream `status`. Policy refusal даёт 403, quota — 429, недоступный аккаунт — 404; permanent input/provider rejection отображается как validation error, transient failure — 503. Если передан `user_id`, выбранный аккаунт проверяется на возможность использования этим principal. Необязательный `borrowers` сужает набор владельцев до перечисленных и самого principal; он не отменяет tenant-границу. При нескольких аккаунтах выбирайте `connected_account_id` явно. Session proxy использует закреплённый аккаунт и ограничения сессии. ## Границы безопасности и повторов Запрещены абсолютный URL, `//host`, traversal, обратный slash, raw fragment и управляющие символы. Raw proxy не принимает encoded slash как обход шаблона. Credentials подключённого сервиса подставляются сервером: не передавайте provider token через proxy. Caller-заголовки `Authorization`, `Proxy-Authorization`, `Cookie`, `Cookie2`, `x-api-key` запрещены. Заголовки управления транспортом (`base-url-override`, `connection-id`, `provider-config-key`, `retries`, `retry-on`, `decompress`, `forward-headers-on-redirect`, `nango-*`) также отклоняются. Hop-by-hop заголовки удаляются. Context4 bearer используется для входа в Context4 и не становится credential провайдера. Raw proxy обходит схему tool wrapper, сохраняя tenant, policy, quota, rate limit и audit. Это не обещание доступа к любому endpoint независимо от возможностей коннектора и его транспорта. Проверяйте документацию самого провайдера и доступность операции. После таймаута записи сверяйте исход: отсутствие ответа не доказывает отсутствие эффекта. --- # Composio SDK Источник: https://context4.me/docs/composio-sdk Для интеграции через SDK используйте Composio с base URL `https://context4.me/compat/context4/v1` и API-ключом Context4. Отдельный Context4 SDK не требуется. SDK добавляет свой путь `/api/v3.1/...`; не добавляйте его к base URL второй раз. ## Поддерживаемые группы версий | Группа | Версии | | --- | --- | | Legacy | `@composio/core@0.13.1`, `@composio/client@0.1.0-alpha.74` | | Tool Router | `@composio/core@0.14.0` | | Sessions/Mastra | `@composio/client@0.1.0-alpha.76`, `@composio/core@0.17.0`, `@composio/mastra@0.10.3`, strict MastraProvider | Совместимость конкретной группы не означает полную совместимость с любым будущим SDK. [Реестр всех compat HTTP-маршрутов](https://context4.me/docs/compat-api-reference.md) показывает методы, пути, полномочия и статусы. Нативные запросы `/v1` описаны отдельным [OpenAPI](https://context4.me/docs/openapi.json); не переносите между ними имена полей автоматически. ## Discovery и выполнение Каталог инструментов, toolkit/auth configs, жизненный цикл connected account, Tool Router sessions, session tools и direct execute используют контракты SDK. `user_id` — непрозрачный идентификатор конечного пользователя; не помещайте туда email или персональные данные. Explicit account должен быть доступен данному principal и tenant. Auth-config UUID фильтруется точно, несколько ID образуют union, пересечённый с toolkit-фильтром. Обычное direct execute принимает SDK `arguments`, выбранный `connected_account_id` и при необходимости `user_id`. Tool slug получайте из discovery. Не подменяйте имена угаданным действием, если точный slug не найден. Сначала получите входную схему; сама доступность account не гарантирует право на действие. Создание session без `Idempotency-Key` создаёт новую сессию при каждом запросе. Явный ключ повторяет исходную, сохраняя TTL и policy. Explicit idempotency key у direct execute сохраняет helper session на 24-часовое окно replay; тот же account и arguments возвращают исходный `log_id`. Изменённые аргументы конфликтуют. Без явного ключа выполнение независимо, lifetime helper — 15 минут. Session search и execute ограничены session snapshot, флагами и read-only policy. Динамический MCP URL возвращается сессией; копируйте его из результата. [Справочник MCP](https://context4.me/docs/ai-mcp.md) объясняет aliases и polling. ## Конверт и отрицательное подтверждение Проверяйте SDK-поля `successful`, `error`, `data` и `log_id`; HTTP 200 не является достаточным признаком успеха действия. Состояние и payload нативного Execution имеют другую форму. Иногда terminal failure содержит `data.failure_effect: not_applied` и `data.execution_id`: это сохранённое подтверждение отсутствия применения. Сейчас оно ограничено single-attempt UPDATE lead amoCRM с явным отказом 400. Отсутствие поля ничего не доказывает: таймауты, неизвестный ответ и составные операции могут иметь внешний эффект. Не выводите «можно безопасно повторить» только из кода ошибки. ## Proxy, файлы и ограничения [Raw proxy](https://context4.me/docs/proxy-requests.md) использует `endpoint`, `method`, `parameters`, необязательный `body` и выбранный connected account. У session proxy также действуют session gates. Файловый API предоставляет upload request/list и session mount URLs; содержимое загружается на возвращённый presigned URL, а не как произвольное большое тело public API. Доступность mounts зависит от конфигурации развёртывания. Compat trigger discovery — намеренная заглушка: список пуст, retrieve даёт not-found, create/delete — `501 trigger_compat_not_implemented`. Нативные provider-event subscriptions и syncs не превращают её в Composio trigger parity. Workbench/bash могут перечисляться при включённом флаге, но отвечают `not_supported`. Custom tools и подключение внешнего MCP-toolkit не следует считать завершёнными только из-за наличия конфигурационного ресурса. Внешние endpoint-автоматизации first-party workflow engine используют отдельный платформенный контракт. Для клиентского приложения публичный вход в raw endpoint catalog — [native discovery и mirror](https://context4.me/docs/api-endpoints.md). --- # Инструменты и идентификация Источник: https://context4.me/docs/api-tools Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## listTools `GET /v1/tools` URL этого стенда: `https://context4.me/v1/tools`. Параметры в фигурных скобках заменяются фактическими ID из API. List published tools Полномочие: `tools:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connector_id` | query | нет | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `search` | query | нет | {"type":"string","minLength":1,"maxLength":120} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Published tools (flattened connector actions) | `application/json` [ToolListResponse](https://context4.me/docs/api-schemas-1.md#toollistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getTool `GET /v1/tools/{toolId}` URL этого стенда: `https://context4.me/v1/tools/{toolId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one tool with its JSON schemas Полномочие: `tools:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `toolId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}\\.[a-z0-9][a-z0-9_.]{1,78}$","example":"bitrix24.contact.create"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Tool detail with pinned input/output schemas | `application/json` [ToolDetail](https://context4.me/docs/api-schemas-1.md#tooldetail) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getIdentity `GET /v1/identity` URL этого стенда: `https://context4.me/v1/identity`. Параметры в фигурных скобках заменяются фактическими ID из API. Get the authenticated credential's tenant Полномочие: `connections:read`. Дополнительных параметров в контракте нет. ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Verified organization and workspace; no credential material | `application/json` [PublicIdentity](https://context4.me/docs/api-schemas-1.md#publicidentity) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Бизнес-сценарии: два сервиса, одна задача Источник: https://context4.me/docs/business-cases CRM знает, кому вы обещали перезвонить. Телефония — состоялся ли разговор. Финансовый сервис — какие платежи учтены. Когда AI получает данные из двух систем, он может подготовить следующий шаг с учётом обеих сторон. Ниже сначала приведены внешние примеры, затем — четыре сценария для реализации через Context4. Это инструкции для настройки агента, а не отчёты о выполненных внедрениях Context4. Экономию времени и рост продаж по ним мы не измеряли. ## Что уже делают компании **Онлайн-школа WowSpeak: amoCRM + Wazzup.** В опубликованном Wazzup кейсе школа использует статус и дату возврата клиента в CRM для автоматических сообщений. Через Wazzup также отправляются анкеты и напоминания об уроках. Это пример совместной работы данных о продаже и канала общения; внедрение выполнено средствами описанной в кейсе интеграции. [Кейс WowSpeak у Wazzup](https://wazzup24.ru/blog/kejs-wowspeak/). **ActivSports: amoCRM + Wazzup24.** Интегратор Aspire описывает подключение Wazzup24 к amoCRM для общения с клиентами через WhatsApp из CRM. Источник подтверждает конкретную компанию и связку систем. Результаты этого проекта не являются результатами Context4. [Кейс внедрения Aspire](https://startup.aspire.agency/work/2024-activsports-wazzup24-amocrm). Есть и документированные поставщиками рабочие процессы, для которых мы не заявляем отдельного клиента: - MANGO OFFICE описывает передачу пропущенных звонков в Битрикс24 и контроль их обработки. [Интеграция Битрикс24 и MANGO OFFICE](https://developers.mango-office.ru/support/4_integratsii/1_vse-integratsii/16_bitrix24/3_obrabotka_zvonkov/04_1_4_kontrol_za_obrabotkoy_propuschennogo_zvonka/obzor/). - Финтабло документирует передачу сделок из CRM и сопоставление полей. Это отдельный продукт «Коннектор Финтабло», а не функция Context4. [Инструкция Финтабло](https://help.fintablo.ru/article/30329). - Linear документирует создание задач из ошибок Sentry и связь между ними. Это штатная интеграция поставщиков. [Документация Linear](https://linear.app/docs/sentry). ## Перед запуском сценария Подключите оба сервиса и проверьте доступные инструменты в своём аккаунте. Все перечисленные здесь коннекторы представлены в публичном каталоге Context4 в статусе **beta**. Наличие действия в каталоге не гарантирует доступ в конкретном подключении. В последовательностях ниже указаны **ключи действий**, например `crm.lead.get`. Это не универсальные имена MCP-инструментов: агент должен выбрать соответствующее подключение, найти действие и прочитать его текущую входную схему. Одинаковый ключ в разных сервисах означает разные инструменты. Для регулярной работы вашему агенту или приложению нужны расписание либо внешний запуск, хранилище соответствий и журнал выполненных шагов. Описанные сценарии сами по себе их не создают. Сохраняйте ID записей вместе с ID подключения: одинаковые номера в разных аккаунтах не означают одну сущность. Изменения, отправку сообщений и звонки выполняйте в пределах явно согласованного поручения. Если пользователь ещё не разрешил конкретное действие или правило автоматизации, покажите результат чтения и предложенные изменения до выполнения. Context4 не следует считать гарантией отдельного окна подтверждения в каждом AI-клиенте. ## 1. Напомнить клиенту о следующем шаге: amoCRM + Wazzup **Задача бизнеса.** Клиент дошёл до согласованного этапа сделки, но менеджеру приходится отдельно искать номер и подходящий шаблон сообщения. **Данные двух систем.** amoCRM даёт сделку, связанный контакт и его телефон. Wazzup даёт доступные каналы, их состояние и шаблоны с разрешёнными каналами. Агент выбирает сообщение по этапу сделки и проверяет, что его можно отправить выбранным каналом. ### Последовательность для агента 1. В amoCRM выполните `crm.lead.get` для выбранной сделки. Получите связанный контакт через `crm.contact.get`. Если ID контакта не вернулся, используйте заранее проверенное соответствие или уточните его; не выбирайте человека по одному имени. 2. В Wazzup выполните `messaging.channel.list` и `messaging.template.list`. Выберите рабочий канал и подходящий шаблон по возвращённым данным, проверьте его статус и список каналов. 3. Сопоставьте телефон контакта с `chatId`. Для этого коннектора `chatId` — телефон в международном формате, только цифры; ID контакта amoCRM сюда не подходит. Сохраните соответствие «подключение amoCRM + ID контакта → подключение Wazzup + channelId + chatId». 4. Подготовьте текст с учётом полей сделки. Покажите получателя, канал, шаблон и подставляемые значения. После разрешения выполните `messaging.message.send_template`: `templateId` берётся из `templateGuid` выбранного шаблона, значения — из согласованных данных. 5. Сохраните возвращённый `messageId` и состояние операции. Ответ `accepted` означает принятие запроса, а не подтверждённую доставку или прочтение. **Защита от повторов.** До отправки проверяйте в журнале ключ «подключение + сделка + этап/повод + версия шаблона». Заблокируйте одновременную обработку одного ключа. Не считайте `crmMessageId` доказательством гарантированной дедупликации. Если отправка прошла, а сохранение результата не удалось, сначала проверьте операцию и Wazzup; при неизвестном исходе не отправляйте сообщение автоматически повторно. **Ожидаемый результат.** Согласованное сообщение для нужной сделки уходит через проверенный канал без ручного копирования номера. В текущем наборе действий Wazzup нет чтения истории переписки или статуса доставки: этот сценарий не может доказать, что клиент давно не отвечал или прочитал сообщение. Правила канала и доступность шаблона проверяются отдельно. **Поручение агенту:** «Для этой сделки amoCRM подготовь напоминание через Wazzup. Прочитай контакт, каналы и шаблоны. Покажи номер, шаблон и значения; отправь после моего согласования. Если исход прошлой отправки неизвестен, остановись». ## 2. Подготовить работу по оплатам: amoCRM + Финтабло **Задача бизнеса.** Менеджер видит сумму продажи в CRM, но перед разговором должен проверить учтённые платежи и обязательства. **Данные двух систем.** amoCRM даёт сделку, контакт и ответственного. Финтабло — связанную финансовую сделку, обязательства и операции. Получается список вопросов по оплате с привязкой к владельцу продажи. ### Последовательность для агента 1. В amoCRM выполните `crm.lead.get`, затем `crm.company.get` или `crm.contact.get` для связанной стороны, если её ID известен. 2. Найдите проверенное соответствие «подключение amoCRM + ID сделки → подключение Финтабло + ID сделки», а также соответствие контрагента. При первичной настройке можно прочитать `deal.list` и `partner.list` в Финтабло и предложить кандидатов человеку. Одинаковое название компании недостаточно; сверяйте реквизиты, если они доступны, и сохраняйте подтверждённые ID. 3. В Финтабло вызовите `deal.get`, `obligation.list` и `transaction.list` для финансовой сделки. Для операций разделяйте план и факт по `isPlan`, учитывайте направление, валюту, период и все страницы ответа. 4. Составьте сводку: сумма сделки в CRM, данные финансовой сделки, неоплаченные обязательства и фактические поступления за выбранный период. Не складывайте обязательства и операции как независимые долги: они могут относиться к одной оплате. Различие сумм вынесите на сверку, не исправляйте его автоматически. 5. В amoCRM проверьте `crm.task.list`. После разрешения создайте через `crm.task.create` задачу ответственному: проверить конкретное расхождение или связаться с клиентом. Срок и тип задачи должны быть согласованы; для проверки результата используйте `crm.task.get`. **Защита от повторов.** Ключ журнала — «CRM-сделка + финансовая сделка + период сверки + тип задачи». Сохраните ID созданной задачи; перед повтором прочитайте её и список задач. Если чтение Финтабло оборвалось на странице, завершите чтение до выводов. Если задача создалась, а ответ потерялся, сначала найдите её, затем решайте вопрос повтора. **Ожидаемый результат.** Менеджер получает основанную на двух системах подготовку к разговору и конкретную задачу. Это не банковская выписка в реальном времени и не доказательство просрочки: актуальность загрузки, условия договора, возвраты, налоги и валютные различия нужно учитывать отдельно. Сценарий не меняет финансовый учёт и не объявляет продажу оплаченной только по совпадению суммы. **Поручение агенту:** «Сверь эту сделку amoCRM с подтверждённой сделкой Финтабло за указанный период. Отдели плановые платежи от фактических. Покажи расхождения и предложи задачу менеджеру, не меняя учётные записи». ## 3. Вернуть пропущенный звонок в работу: Битрикс24 + MANGO OFFICE **Задача бизнеса.** Пропущенный звонок есть в телефонии, а руководителю нужно понять, кто из известных клиентов остался без следующего шага. **Данные двух систем.** MANGO OFFICE возвращает записи звонков, номера и время ответа. Битрикс24 даёт контакт, его сделки, ответственного и существующие задачи. Агент проверяет звонок в контексте клиентской работы. ### Последовательность для агента 1. В MANGO OFFICE выполните `telephony.history.request` за согласованный период не длиннее 28 дней. Сохраните `key`. Получайте отчёт через `telephony.history.result`, соблюдая `pollAfterMs`; `pending` ещё не означает отсутствие звонков. 2. Из готового отчёта выделите входящие без ответа по правилам полей поставщика. Не считайте любой код завершения пропуском; учитывайте последующие отвеченные звонки того же клиента в выбранном периоде. Сохраните `entry_id` и номера. 3. В Битрикс24 найдите контакт через `crm.contact.list`, затем прочитайте `crm.contact.get` и связанные сделки через `crm.deal.list` / `crm.deal.get`. Сопоставляйте нормализованный внешний номер, затем сохраняйте ID контакта. Если номер общий или найдено несколько контактов, передайте выбор человеку. 4. Через `task.task.list` проверьте, есть ли уже задача на этот звонок. Покажите найденный контакт, сделку, время звонка, ответственного и предложенный срок. После разрешения выполните `task.task.create`, сохранив в описании ссылку на клиента и `entry_id` звонка. 5. Проверьте задачу через `task.task.get` и сохраните её ID. Если пользователь отдельно поручил именно позвонить, сначала прочитайте `telephony.employee.list` и согласуйте сотрудника с его `extension`, затем используйте `telephony.call.callback` с точным номером клиента и `command_id`. **Защита от повторов.** Для задачи используйте ключ «подключение MANGO + entry_id + тип следующего шага». Для звонка ведите отдельную запись попытки: принятый запрос нельзя автоматически повторять как обычное чтение. При потере ответа сверяйте операцию и телефонию. Если отчёт истёк (`absent-or-expired`), запросите его заново за тот же период и исключите уже обработанные `entry_id`. **Ожидаемый результат.** Известные пропущенные обращения получают проверяемый следующий шаг и ответственного. Созданная задача ещё не означает, что клиенту перезвонили; `submitted` у обратного звонка означает отправку команды, а не состоявшийся разговор. Проверяйте полноту отчёта: ограниченный ответ не доказывает отсутствие других звонков. Уже настроенная штатная интеграция может создавать задачи самостоятельно — учитывайте её, чтобы не дублировать работу. **Поручение агенту:** «Сопоставь пропущенные входящие MANGO OFFICE за этот период с контактами, сделками и задачами Битрикс24. Покажи обращения без следующего шага. Не создавай задачи и не звони до согласования списка». ## 4. Передать ошибку в работу без дубликата: Sentry + Linear **Задача бизнеса.** Ошибка видна в мониторинге, но перед новой задачей нужно выяснить, не занимается ли ею уже команда разработки. **Данные двух систем.** Sentry даёт ID ошибки, события, частоту и контекст сбоя в пределах ответа. Linear — существующие задачи, их состояние, команду и обсуждение. Агент объединяет технические признаки ошибки с текущим планом работ. ### Последовательность для агента 1. В Sentry выполните `issue.triage_pack` для выбранной ошибки. Сохраните организацию, проект, числовой ID и ссылку на issue. Не переносите секреты или лишние персональные данные события в задачу. 2. В Linear выполните `issue.search` по сохранённому ID/ссылке Sentry и ключевым признакам ошибки. Для кандидатов используйте `issue.overview`, чтобы прочитать задачу и комментарии. Совпадение заголовков ещё не подтверждает одну причину. 3. Если соответствие уже подтверждено, покажите дополнение к существующей задаче. После разрешения добавьте его через `comment.create`. Если задачи нет, выполните `team.list`, согласуйте команду и содержание, затем вызовите `issue.create`. 4. В описании или комментарии укажите ссылку на Sentry, наблюдаемые факты и период наблюдения. Разделите факты и гипотезы. Сохраните соответствие «организация Sentry + ID ошибки → workspace Linear + ID задачи». 5. Проверьте результат через `issue.get` или `comment.list` в Linear. Покажите пользователю ссылку на созданную либо дополненную задачу. **Защита от повторов.** До записи захватывайте в своём журнале ключ «организация Sentry + ID ошибки + команда Linear». Для комментария добавьте период или ID последнего обработанного события. Если создание удалось, а журнал не обновился, сначала ищите задачу по ссылке Sentry. При неизвестном исходе не создавайте вторую автоматически. **Ожидаемый результат.** Команда получает задачу с контекстом реального сбоя либо дополнение к существующей задаче. Создание ссылки в тексте не включает штатную двустороннюю интеграцию Linear–Sentry. Эти шаги не обещают автоматического закрытия Sentry при завершении Linear и не доказывают первопричину без дальнейшего расследования. **Поручение агенту:** «Прочитай эту ошибку Sentry и найди связанную задачу Linear. Покажи, что уже известно в обеих системах. Предложи комментарий или новую задачу, отдели факты от гипотез и дождись согласования записи». ## Как проверить первый запуск Начните с одной известной записи. Проверьте, что агент прочитал данные **обоих** сервисов, показал способ сопоставления и сообщил о неоднозначностях. После разрешённой записи откройте результат в исходном сервисе. Повторный запуск должен находить уже выполненный шаг, а сбой второго сервиса — оставлять понятное состояние для продолжения. Далее изучите [подключение сервисов](https://context4.me/docs/connections.md), [действия и результаты](https://context4.me/docs/actions.md) и [работу через AI и MCP](https://context4.me/docs/ai-mcp.md). --- # Выполнения Источник: https://context4.me/docs/api-executions Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## createExecution `POST /v1/executions` URL этого стенда: `https://context4.me/v1/executions`. Параметры в фигурных скобках заменяются фактическими ID из API. Create an execution (asynchronous, idempotent) Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | ### Тело запроса Обязательно. [CreateExecutionRequest](https://context4.me/docs/api-schemas-1.md#createexecutionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateExecutionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 202 | Execution accepted (queued) or persisted as rejected with a denial code; poll the Location header | `application/json` [Execution](https://context4.me/docs/api-schemas-1.md#execution) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden, session_expired, session_revoked, session_call_budget_exhausted) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (idempotency_conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } }, "Location": { "description": "Resource location (/v1/executions/{executionId})", "schema": { "type": "string" } } } ``` ## listExecutions `GET /v1/executions` URL этого стенда: `https://context4.me/v1/executions`. Параметры в фигурных скобках заменяются фактическими ID из API. List executions Полномочие: `executions:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `status` | query | нет | {"type":"string","enum":["requested","queued","running","retrying","succeeded","failed","rejected","cancelled"]} | | `connector_id` | query | нет | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `user_id` | query | нет | {"$ref":"#/components/schemas/ExecutionEndUserRef"} | | `from` | query | нет | {"type":"string","format":"date-time","example":"2026-07-16T12:00:00.000Z"} | | `to` | query | нет | {"type":"string","format":"date-time","example":"2026-07-16T12:00:00.000Z"} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Executions ordered by creation time (descending) | `application/json` [ExecutionListResponse](https://context4.me/docs/api-schemas-1.md#executionlistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getExecution `GET /v1/executions/{executionId}` URL этого стенда: `https://context4.me/v1/executions/{executionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one execution with its result Полномочие: `executions:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `executionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Execution view; terminal successes include the result | `application/json` [ExecutionWithResult](https://context4.me/docs/api-schemas-1.md#executionwithresult) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listExecutionAttempts `GET /v1/executions/{executionId}/attempts` URL этого стенда: `https://context4.me/v1/executions/{executionId}/attempts`. Параметры в фигурных скобках заменяются фактическими ID из API. List execution attempts Полномочие: `executions:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `executionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Append-only attempt records | `application/json` [AttemptListResponse](https://context4.me/docs/api-schemas-1.md#attemptlistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## cancelExecution `POST /v1/executions/{executionId}/cancel` URL этого стенда: `https://context4.me/v1/executions/{executionId}/cancel`. Параметры в фигурных скобках заменяются фактическими ID из API. Cancel a queued execution Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `executionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. [CancelExecutionRequest](https://context4.me/docs/api-schemas-1.md#cancelexecutionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelExecutionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The cancelled execution | `application/json` [Execution](https://context4.me/docs/api-schemas-1.md#execution) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict, execution_not_cancellable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Подключения и приложения OAuth Источник: https://context4.me/docs/api-connections Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## listConnections `GET /v1/connections` URL этого стенда: `https://context4.me/v1/connections`. Параметры в фигурных скобках заменяются фактическими ID из API. List connections Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `status` | query | нет | {"type":"string","enum":["pending","active","degraded","revoked","failed"]} | | `user_id` | query | нет | {"$ref":"#/components/schemas/EndUserRef"} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Connections in the key's workspace | `application/json` [ConnectionListResponse](https://context4.me/docs/api-schemas-1.md#connectionlistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## createConnection `POST /v1/connections` URL этого стенда: `https://context4.me/v1/connections`. Параметры в фигурных скобках заменяются фактическими ID из API. Initiate a connection (hosted auth link) Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | ### Тело запроса Обязательно. [CreateConnectionRequest](https://context4.me/docs/api-schemas-2.md#createconnectionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateConnectionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | Hosted authorization link for the end user | `application/json` [HostedAuthLink](https://context4.me/docs/api-schemas-2.md#hostedauthlink) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getConnection `GET /v1/connections/{connectionId}` URL этого стенда: `https://context4.me/v1/connections/{connectionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one connection Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Connection view (engine-free) | `application/json` [Connection](https://context4.me/docs/api-schemas-1.md#connection) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listAuthConfigs `GET /v1/auth-configs` URL этого стенда: `https://context4.me/v1/auth-configs`. Параметры в фигурных скобках заменяются фактическими ID из API. List auth configurations Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connector_id` | query | нет | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Auth configurations in the key's workspace | `application/json` [AuthConfigListResponse](https://context4.me/docs/api-schemas-2.md#authconfiglistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## createAuthConfig `POST /v1/auth-configs` URL этого стенда: `https://context4.me/v1/auth-configs`. Параметры в фигурных скобках заменяются фактическими ID из API. Create an auth configuration Полномочие: `connections:write`. Дополнительных параметров в контракте нет. ### Тело запроса Обязательно. [CreateAuthConfigRequest](https://context4.me/docs/api-schemas-2.md#createauthconfigrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAuthConfigRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | The created auth configuration | `application/json` [AuthConfig](https://context4.me/docs/api-schemas-2.md#authconfig) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getAuthConfig `GET /v1/auth-configs/{authConfigId}` URL этого стенда: `https://context4.me/v1/auth-configs/{authConfigId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one auth configuration Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `authConfigId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Auth configuration (secret-free) | `application/json` [AuthConfig](https://context4.me/docs/api-schemas-2.md#authconfig) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## updateAuthConfig `PATCH /v1/auth-configs/{authConfigId}` URL этого стенда: `https://context4.me/v1/auth-configs/{authConfigId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Update an auth configuration Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `authConfigId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. [UpdateAuthConfigRequest](https://context4.me/docs/api-schemas-2.md#updateauthconfigrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAuthConfigRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The updated auth configuration | `application/json` [AuthConfig](https://context4.me/docs/api-schemas-2.md#authconfig) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## deleteAuthConfig `DELETE /v1/auth-configs/{authConfigId}` URL этого стенда: `https://context4.me/v1/auth-configs/{authConfigId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Delete an auth configuration Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `authConfigId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 204 | Deleted | Тело не задано контрактом | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getProviderSchema `GET /v1/connections/{connectionId}/schemas/{entity}` URL этого стенда: `https://context4.me/v1/connections/{connectionId}/schemas/{entity}`. Параметры в фигурных скобках заменяются фактическими ID из API. Read the latest discovered provider entity schema Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `entity` | path | да | {"type":"string","minLength":1,"maxLength":80} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Latest tenant-scoped provider schema | `application/json` [ProviderSchema](https://context4.me/docs/api-schemas-3.md#providerschema) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## discoverProviderSchema `POST /v1/connections/{connectionId}/schemas/{entity}` URL этого стенда: `https://context4.me/v1/connections/{connectionId}/schemas/{entity}`. Параметры в фигурных скобках заменяются фактическими ID из API. Discover and persist provider entity metadata Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | | `connectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `entity` | path | да | {"type":"string","minLength":1,"maxLength":80} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Immutable provider schema revision | `application/json` [ProviderSchema](https://context4.me/docs/api-schemas-3.md#providerschema) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Базы данных и частные сети Источник: https://context4.me/docs/api-sources Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## setNetworkAttachmentConnectivity `PATCH /v1/network-attachments/{networkAttachmentId}/connectivity` URL этого стенда: `https://context4.me/v1/network-attachments/{networkAttachmentId}/connectivity`. Параметры в фигурных скобках заменяются фактическими ID из API. Disconnect or reconnect a private-network attachment Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `networkAttachmentId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "expected_version": { "type": "integer", "exclusiveMinimum": 0 }, "enabled": { "type": "boolean" } }, "required": [ "expected_version", "enabled" ], "additionalProperties": false } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Persisted connectivity intent; status reason reports operator acknowledgement | `application/json` [NetworkAttachment](https://context4.me/docs/api-schemas-2.md#networkattachment) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listNetworkAttachments `GET /v1/network-attachments` URL этого стенда: `https://context4.me/v1/network-attachments`. Параметры в фигурных скобках заменяются фактическими ID из API. List private-network attachments Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Tenant-scoped secret-free attachment views | `application/json` [NetworkAttachmentList](https://context4.me/docs/api-schemas-2.md#networkattachmentlist) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## createNetworkAttachment `POST /v1/network-attachments` URL этого стенда: `https://context4.me/v1/network-attachments`. Параметры в фигурных скобках заменяются фактическими ID из API. Create a typed direct, WireGuard, or OpenVPN attachment Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | ### Тело запроса Обязательно. [CreateNetworkAttachmentRequest](https://context4.me/docs/api-schemas-2.md#createnetworkattachmentrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateNetworkAttachmentRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | Created attachment; private credentials are never returned | `application/json` [NetworkAttachment](https://context4.me/docs/api-schemas-2.md#networkattachment) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getNetworkAttachment `GET /v1/network-attachments/{networkAttachmentId}` URL этого стенда: `https://context4.me/v1/network-attachments/{networkAttachmentId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one private-network attachment Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `networkAttachmentId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Secret-free attachment health and desired state | `application/json` [NetworkAttachment](https://context4.me/docs/api-schemas-2.md#networkattachment) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## updateNetworkAttachment `PATCH /v1/network-attachments/{networkAttachmentId}` URL этого стенда: `https://context4.me/v1/network-attachments/{networkAttachmentId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Replace the approved destination policy Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `networkAttachmentId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dns_servers": { "type": "array", "items": { "anyOf": [ { "type": "string", "format": "ip" }, { "type": "string", "format": "ip" } ] }, "maxItems": 3 }, "expected_version": { "type": "integer", "exclusiveMinimum": 0 }, "destinations": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 64 } }, "required": [ "expected_version", "destinations" ], "additionalProperties": false } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Updated desired generation | `application/json` [NetworkAttachment](https://context4.me/docs/api-schemas-2.md#networkattachment) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## revokeNetworkAttachment `DELETE /v1/network-attachments/{networkAttachmentId}` URL этого стенда: `https://context4.me/v1/network-attachments/{networkAttachmentId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Drain and revoke a private-network attachment Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `networkAttachmentId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `expected_version` | query | да | {"type":"integer","exclusiveMinimum":0} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Draining or ready-to-revoke attachment | `application/json` [NetworkAttachment](https://context4.me/docs/api-schemas-2.md#networkattachment) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## discoverSavedDatabases `POST /v1/data-source-connections/{dataSourceConnectionId}/discover-databases` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}/discover-databases`. Параметры в фигурных скобках заменяются фактическими ID из API. Discover databases using a stored, tenant-owned connection Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Bounded database catalog without returning credentials | `application/json` [DiscoverPostgresDatabasesResponse](https://context4.me/docs/api-schemas-2.md#discoverpostgresdatabasesresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## addDatabaseFromConnection `POST /v1/data-source-connections/{dataSourceConnectionId}/databases` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}/databases`. Параметры в фигурных скобках заменяются фактическими ID из API. Add a database using the stored server credential Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. [AddDatabaseFromConnectionRequest](https://context4.me/docs/api-schemas-2.md#adddatabasefromconnectionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddDatabaseFromConnectionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | Independent database connection with its own revocable secret | `application/json` [DataSourceConnection](https://context4.me/docs/api-schemas-2.md#datasourceconnection) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## discoverPostgresDatabases `POST /v1/data-source-connections/discover-databases` URL этого стенда: `https://context4.me/v1/data-source-connections/discover-databases`. Параметры в фигурных скобках заменяются фактическими ID из API. Discover PostgreSQL or SQL Server databases before creating a source Полномочие: `connections:write`. Дополнительных параметров в контракте нет. ### Тело запроса Обязательно. [DiscoverPostgresDatabasesRequest](https://context4.me/docs/api-schemas-2.md#discoverpostgresdatabasesrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DiscoverPostgresDatabasesRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Bounded database catalog with explicit session evidence | `application/json` [DiscoverPostgresDatabasesResponse](https://context4.me/docs/api-schemas-2.md#discoverpostgresdatabasesresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listDataSourceConnections `GET /v1/data-source-connections` URL этого стенда: `https://context4.me/v1/data-source-connections`. Параметры в фигурных скобках заменяются фактическими ID из API. List database and topic source connections Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Tenant-scoped secret-free source views | `application/json` [DataSourceConnectionList](https://context4.me/docs/api-schemas-2.md#datasourceconnectionlist) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## createDataSourceConnection `POST /v1/data-source-connections` URL этого стенда: `https://context4.me/v1/data-source-connections`. Параметры в фигурных скобках заменяются фактическими ID из API. Create a typed database or topic source connection Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | ### Тело запроса Обязательно. [CreateDataSourceConnectionRequest](https://context4.me/docs/api-schemas-3.md#createdatasourceconnectionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDataSourceConnectionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | Created source; credentials are never returned | `application/json` [DataSourceConnection](https://context4.me/docs/api-schemas-2.md#datasourceconnection) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getDataSourceConnection `GET /v1/data-source-connections/{dataSourceConnectionId}` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one database or topic source connection Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Secret-free source connection view | `application/json` [DataSourceConnection](https://context4.me/docs/api-schemas-2.md#datasourceconnection) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## revokeDataSourceConnection `DELETE /v1/data-source-connections/{dataSourceConnectionId}` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Revoke a database or topic source connection Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Revoked source connection | `application/json` [DataSourceConnection](https://context4.me/docs/api-schemas-2.md#datasourceconnection) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## replaceDataSourceCredential `POST /v1/data-source-connections/{dataSourceConnectionId}/credential` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}/credential`. Параметры в фигурных скобках заменяются фактическими ID из API. Replace the password credential of a source connection Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. [ReplaceDataSourceCredentialRequest](https://context4.me/docs/api-schemas-3.md#replacedatasourcecredentialrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplaceDataSourceCredentialRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Source with the new credential version; a degraded source returns to pending until an inspection succeeds | `application/json` [DataSourceConnection](https://context4.me/docs/api-schemas-2.md#datasourceconnection) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getDataSourceSchema `GET /v1/data-source-connections/{dataSourceConnectionId}/schema` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}/schema`. Параметры в фигурных скобках заменяются фактическими ID из API. Get the latest discovered source schema Полномочие: `connections:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Latest tenant-scoped source schema | `application/json` [SourceSchema](https://context4.me/docs/api-schemas-3.md#sourceschema) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## discoverDataSourceSchema `POST /v1/data-source-connections/{dataSourceConnectionId}/schema` URL этого стенда: `https://context4.me/v1/data-source-connections/{dataSourceConnectionId}/schema`. Параметры в фигурных скобках заменяются фактическими ID из API. Inspect a source, persist its schema, and activate the connection Полномочие: `connections:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | | `dataSourceConnectionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Discovered immutable source schema version | `application/json` [SourceSchema](https://context4.me/docs/api-schemas-3.md#sourceschema) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Сессии инструментов Источник: https://context4.me/docs/api-sessions Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## createToolSession `POST /v1/tool-sessions` URL этого стенда: `https://context4.me/v1/tool-sessions`. Параметры в фигурных скобках заменяются фактическими ID из API. Create a tool session (returns the per-session MCP URL) Полномочие: `tool-sessions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | да | {"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome | ### Тело запроса Обязательно. [CreateToolSessionRequest](https://context4.me/docs/api-schemas-3.md#createtoolsessionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateToolSessionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | The created session with its per-session MCP URL | `application/json` [ToolSessionWithMcp](https://context4.me/docs/api-schemas-3.md#toolsessionwithmcp) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getToolSession `GET /v1/tool-sessions/{toolSessionId}` URL этого стенда: `https://context4.me/v1/tool-sessions/{toolSessionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one tool session with its configuration Полномочие: `tool-sessions:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `toolSessionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The session view including its configuration | `application/json` [ToolSession](https://context4.me/docs/api-schemas-3.md#toolsession) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## patchToolSession `PATCH /v1/tool-sessions/{toolSessionId}` URL этого стенда: `https://context4.me/v1/tool-sessions/{toolSessionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Update session tool enablement (CAS) Полномочие: `tool-sessions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `toolSessionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. [PatchToolSessionRequest](https://context4.me/docs/api-schemas-3.md#patchtoolsessionrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchToolSessionRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The updated session view | `application/json` [ToolSession](https://context4.me/docs/api-schemas-3.md#toolsession) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listToolSessionTools `GET /v1/tool-sessions/{toolSessionId}/tools` URL этого стенда: `https://context4.me/v1/tool-sessions/{toolSessionId}/tools`. Параметры в фигурных скобках заменяются фактическими ID из API. Session-scoped tool discovery (pinned snapshot, exposed tools only) Полномочие: `tool-sessions:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `toolSessionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The session's exposed tools with pinned schemas | `application/json` [SessionToolListResponse](https://context4.me/docs/api-schemas-3.md#sessiontoollistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Синхронизация и экспорт Источник: https://context4.me/docs/api-syncs Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## getSyncDeliveryAuthority `GET /v1/syncs/{syncId}/delivery-authority` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/delivery-authority`. Параметры в фигурных скобках заменяются фактическими ID из API. Read the tenant-scoped delivery grant fence for a sync resource Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `entity` | query | да | {"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Persisted delivery grants and source lineage without credentials | `application/json` [SyncDeliveryAuthority](https://context4.me/docs/api-schemas-3.md#syncdeliveryauthority) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## createSync `POST /v1/syncs` URL этого стенда: `https://context4.me/v1/syncs`. Параметры в фигурных скобках заменяются фактическими ID из API. Create a sync binding a connection to a syncable entity Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | нет | {"type":"string"} Required when source_kind is database_poll; retries with the same key and payload return the original sync. Optional for other source kinds. | ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "source_kind": { "type": "string", "enum": [ "api_poll", "database_cdc", "database_poll", "topic" ] }, "database_poll": { "type": "object", "properties": { "schema": { "type": "string", "minLength": 1, "maxLength": 128 }, "table": { "type": "string", "minLength": 1, "maxLength": 128 }, "columns": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "minItems": 1, "maxItems": 256 }, "primary_key": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "minItems": 1, "maxItems": 16 }, "mode": { "type": "string", "enum": [ "full_scan", "rowversion", "timestamp" ] }, "watermark_column": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 128 }, "full_reconciliation_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 }, "timestamp_overlap_seconds": { "type": "integer", "minimum": 0, "maximum": 86400 }, "deletion_policy": { "type": "string", "enum": [ "preserve", "confirm_missing" ] } }, "required": [ "schema", "table", "columns", "primary_key" ], "additionalProperties": false }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "schedule_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 } }, "required": [ "connection_id", "entity" ], "additionalProperties": false } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | The created sync; acquisition and initial loading follow the provider capabilities | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited, quota_exceeded) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listSyncs `GET /v1/syncs` URL этого стенда: `https://context4.me/v1/syncs`. Параметры в фигурных скобках заменяются фактическими ID из API. List syncs in the workspace Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 25)"} Page size (1-100, default 25) | | `connection_id` | query | нет | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | One page of syncs with the continuation cursor | `application/json` [SyncList](https://context4.me/docs/api-schemas-3.md#synclist) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getSync `GET /v1/syncs/{syncId}` URL этого стенда: `https://context4.me/v1/syncs/{syncId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one sync Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The sync view | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## patchSync `PATCH /v1/syncs/{syncId}` URL этого стенда: `https://context4.me/v1/syncs/{syncId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Pause, resume, or update the schedule of a sync Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "action": { "type": "string", "enum": [ "pause", "resume" ] } }, "required": [ "action" ], "additionalProperties": false }, { "type": "object", "properties": { "action": { "type": "string", "enum": [ "update_schedule" ] }, "schedule_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 }, "full_reconciliation_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 }, "deletion_policy": { "type": "string", "enum": [ "preserve" ] }, "expected_config_revision": { "type": "integer", "exclusiveMinimum": 0 } }, "required": [ "action", "schedule_minutes", "expected_config_revision" ], "additionalProperties": false } ] } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The updated sync view | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## deleteSync `DELETE /v1/syncs/{syncId}` URL этого стенда: `https://context4.me/v1/syncs/{syncId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Delete a sync (record history stays pullable) Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The deleted sync view | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## testFireSync `POST /v1/syncs/test-fire` URL этого стенда: `https://context4.me/v1/syncs/test-fire`. Параметры в фигурных скобках заменяются фактическими ID из API. Synchronously probe a bounded record sample without persisting anything Полномочие: `syncs:write`. Дополнительных параметров в контракте нет. ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "sample_limit": { "type": "integer", "minimum": 1, "maximum": 50 } }, "required": [ "connection_id", "entity" ], "additionalProperties": false } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Normalized sample records plus the estimated total volume | `application/json` [SyncTestFire](https://context4.me/docs/api-schemas-3.md#synctestfire) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable, provider_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## triggerSyncRun `POST /v1/syncs/{syncId}/trigger` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/trigger`. Параметры в фигурных скобках заменяются фактическими ID из API. Enqueue a manual run Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `Idempotency-Key` | header | нет | {"type":"string"} Required when the sync source_kind is database_poll; retries with the same key return the original run. Optional for other source kinds. | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 202 | The sync view with the planned run enqueued | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict). The source does not support a manual refresh, or a run is already active | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listSyncRuns `GET /v1/syncs/{syncId}/runs` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/runs`. Параметры в фигурных скобках заменяются фактическими ID из API. Run history with per-change-type counters and error causes Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 25)"} Page size (1-100, default 25) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | One page of runs with the continuation cursor | `application/json` [SyncRunList](https://context4.me/docs/api-schemas-3.md#syncrunlist) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## pullSyncRecords `GET /v1/syncs/{syncId}/records` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/records`. Параметры в фигурных скобках заменяются фактическими ID из API. Cursor-paged record change stream (the pull door onto the broker stream) Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 25)"} Page size (1-100, default 25) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | One page of record changes ordered by modification cursor | `application/json` [SyncRecordList](https://context4.me/docs/api-schemas-4.md#syncrecordlist) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## replaySyncRecords `POST /v1/syncs/{syncId}/replay` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/replay`. Параметры в фигурных скобках заменяются фактическими ID из API. Replay dead-lettered record deliveries for a sync Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The number of records reset for republication | `application/json` [SyncReplay](https://context4.me/docs/api-schemas-4.md#syncreplay) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listSyncableEntities `GET /v1/connectors/{connectorId}/syncable-entities` URL этого стенда: `https://context4.me/v1/connectors/{connectorId}/syncable-entities`. Параметры в фигурных скобках заменяются фактическими ID из API. Entities the catalog declares syncable for a connector Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Syncable entities with strategy and default schedule | `application/json` [SyncableEntityList](https://context4.me/docs/api-schemas-4.md#syncableentitylist) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getSyncDeliveryCapabilities `GET /v1/sync-delivery-capabilities` URL этого стенда: `https://context4.me/v1/sync-delivery-capabilities`. Параметры в фигурных скобках заменяются фактическими ID из API. Delivery limits and semantics a consumer must satisfy Полномочие: `syncs:read`. Дополнительных параметров в контракте нет. ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Byte limits, envelope versions and delete semantics this deployment honours | `application/json` [SyncDeliveryCapabilities](https://context4.me/docs/api-schemas-4.md#syncdeliverycapabilities) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## createSyncExport `POST /v1/syncs/{syncId}/exports` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/exports`. Параметры в фигурных скобках заменяются фактическими ID из API. Open an immutable historical export over a captured frontier Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "destination": { "type": "string", "enum": [ "file", "bounded-replay-topic" ] }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "idempotency_key": { "type": "string", "minLength": 1, "maxLength": 200 }, "range": { "type": "object", "properties": { "after_cursor": { "type": [ "string", "null" ], "pattern": "^(0|[1-9][0-9]{0,18})$" }, "through_cursor": { "type": [ "string", "null" ], "pattern": "^(0|[1-9][0-9]{0,18})$" } }, "required": [ "after_cursor", "through_cursor" ], "additionalProperties": false } }, "required": [ "entity", "idempotency_key" ], "additionalProperties": false } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 201 | Export session with its captured frontier and publication barrier | `application/json` [SyncExportSession](https://context4.me/docs/api-schemas-4.md#syncexportsession) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable, provider_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## cancelSyncExport `POST /v1/syncs/{syncId}/exports/{exportId}/cancel` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/exports/{exportId}/cancel`. Параметры в фигурных скобках заменяются фактическими ID из API. Request cancellation of a running export Полномочие: `syncs:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `exportId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 202 | Cancellation recorded; the session reaches `cancelled` once the runner stops | `application/json` [SyncExportSession](https://context4.me/docs/api-schemas-4.md#syncexportsession) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getSyncExport `GET /v1/syncs/{syncId}/exports/{exportId}` URL этого стенда: `https://context4.me/v1/syncs/{syncId}/exports/{exportId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Read an export session's state and progress Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `syncId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | | `exportId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Export session state, progress and terminal outcome | `application/json` [SyncExportSession](https://context4.me/docs/api-schemas-4.md#syncexportsession) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## listSyncProviders `GET /v1/sync-providers` URL этого стенда: `https://context4.me/v1/sync-providers`. Параметры в фигурных скобках заменяются фактическими ID из API. List published Sync providers Полномочие: `syncs:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Published providers with Sync entities; empty pages may have a continuation cursor | `application/json` [SyncProviderListResponse](https://context4.me/docs/api-schemas-4.md#syncproviderlistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # События провайдеров Источник: https://context4.me/docs/api-events Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## listProviderEventTypes `GET /v1/provider-event-types` URL этого стенда: `https://context4.me/v1/provider-event-types`. Параметры в фигурных скобках заменяются фактическими ID из API. List supported provider notification types and fields Полномочие: `events:read`. Дополнительных параметров в контракте нет. ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Provider event catalog | `application/json` {"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"connector_id":{"type":"string"},"entity":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"field_types":{"type":"object","additionalProperties":{"type":"string","enum":["string","number","boolean"]}},"hydration_available":{"type":"boolean"}},"required":["connector_id","entity","event_types","fields","field_types","hydration_available"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false} | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## subscribeProviderEvents `POST /v1/provider-event-subscriptions` URL этого стенда: `https://context4.me/v1/provider-event-subscriptions`. Параметры в фигурных скобках заменяются фактическими ID из API. Subscribe to provider events without entity storage Полномочие: `events:write`. Дополнительных параметров в контракте нет. ### Тело запроса Обязательно. ```json { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "event_types": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 160 }, "minItems": 1, "maxItems": 32 } }, "required": [ "connection_id", "event_types" ], "additionalProperties": false } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Configured event subscription | `application/json` {"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connection_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"source_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connector_id":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0},"enabled_at":{"type":"string","format":"date-time"},"payload_retention_seconds":{"type":"integer","exclusiveMinimum":0}},"required":["id","connection_id","source_id","connector_id","event_types","status","version","enabled_at","payload_retention_seconds"],"additionalProperties":false} | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getProviderEventSubscription `GET /v1/provider-event-subscriptions` URL этого стенда: `https://context4.me/v1/provider-event-subscriptions`. Параметры в фигурных скобках заменяются фактическими ID из API. Read the connection event subscription Полномочие: `events:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connection_id` | query | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Subscription or null | `application/json` {"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connection_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"source_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connector_id":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0},"enabled_at":{"type":"string","format":"date-time"},"payload_retention_seconds":{"type":"integer","exclusiveMinimum":0}},"required":["id","connection_id","source_id","connector_id","event_types","status","version","enabled_at","payload_retention_seconds"],"additionalProperties":false} | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## disableProviderEventSubscription `DELETE /v1/provider-event-subscriptions/{subscriptionId}` URL этого стенда: `https://context4.me/v1/provider-event-subscriptions/{subscriptionId}`. Параметры в фигурных скобках заменяются фактическими ID из API. Disable a provider event subscription Полномочие: `events:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `subscriptionId` | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Disabled subscription | `application/json` {"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connection_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"source_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connector_id":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0},"enabled_at":{"type":"string","format":"date-time"},"payload_retention_seconds":{"type":"integer","exclusiveMinimum":0}},"required":["id","connection_id","source_id","connector_id","event_types","status","version","enabled_at","payload_retention_seconds"],"additionalProperties":false} | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Каталог HTTP и вызовы провайдеров Источник: https://context4.me/docs/api-endpoints Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы». ## listConnectorEndpoints `GET /v1/connectors/{connectorId}/endpoints` URL этого стенда: `https://context4.me/v1/connectors/{connectorId}/endpoints`. Параметры в фигурных скобках заменяются фактическими ID из API. List a connector's raw API endpoints Полномочие: `tools:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `q` | query | нет | {"type":"string","minLength":1,"maxLength":120} | | `group` | query | нет | {"type":"string","minLength":1,"maxLength":64} | | `include_removed` | query | нет | {"type":"string","enum":["true","false"],"description":"`true` lists the endpoints a lock regeneration removed (with `removed_at`) beside the live ones"} `true` lists the endpoints a lock regeneration removed (with `removed_at`) beside the live ones | | `cursor` | query | нет | {"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response | | `limit` | query | нет | {"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Endpoints ordered by id, without schemas, each with its descriptor; `q` matches id, path or summary, `group` narrows to one vendor group, `include_removed=true` lists tombstoned endpoints too | `application/json` [EndpointListResponse](https://context4.me/docs/api-schemas-4.md#endpointlistresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getConnectorEndpoint `GET /v1/connectors/{connectorId}/endpoint` URL этого стенда: `https://context4.me/v1/connectors/{connectorId}/endpoint`. Параметры в фигурных скобках заменяются фактическими ID из API. Get one raw endpoint, by method and vendor path, with its JSON schemas Полномочие: `tools:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `method` | query | да | {"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","HEAD"]} | | `path` | query | да | {"type":"string","minLength":1,"maxLength":500,"pattern":"^\\/","example":"/api/v4/leads/{id}"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Endpoint detail with input and output schemas and its paging descriptor | `application/json` [EndpointDetail](https://context4.me/docs/api-schemas-4.md#endpointdetail) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found). No such endpoint — or a lock regeneration removed it, in which case the problem detail names when, and its last descriptor digest when one was recorded (`include_removed=true` on the list still shows it) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## getConnectorOpenApi `GET /v1/connectors/{connectorId}/openapi.json` URL этого стенда: `https://context4.me/v1/connectors/{connectorId}/openapi.json`. Параметры в фигурных скобках заменяются фактическими ID из API. The connector's mirror call surface as one OpenAPI 3.1 document Полномочие: `tools:read`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | OpenAPI 3.1: every live catalogued endpoint as an operation on `/v1/api/{connectorId}` + the vendor path, with the bearer security scheme and the `Context4-Connection-Id` header on each; deterministic for an unchanged catalogue, and `ETag` carries the document's sha256 | `application/json` [ConnectorOpenApiDocument](https://context4.me/docs/api-schemas-4.md#connectoropenapidocument) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found). No connector of that id has catalogued endpoints | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## searchEndpoints `POST /v1/endpoints/search` URL этого стенда: `https://context4.me/v1/endpoints/search`. Параметры в фигурных скобках заменяются фактическими ID из API. Search raw endpoints across the connectors the caller has a usable connection for Полномочие: `connections:read`. Дополнительных параметров в контракте нет. ### Тело запроса Обязательно. [EndpointSearchRequest](https://context4.me/docs/api-schemas-4.md#endpointsearchrequest) ```json { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EndpointSearchRequest" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | Hits ranked by relevance within the scope — the connectors of the workspace's active connections (or of the connections the named `borrowers` lend), narrowed by `connectors`; an empty scope answers no items and no error. `scope.index` names the index that answered (`ratel`, or `ilike` while the registry is unbuilt or disabled) | `application/json` [EndpointSearchResponse](https://context4.me/docs/api-schemas-4.md#endpointsearchresponse) | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## callConnectorApiGet `GET /v1/api/{connectorId}/{vendorPath}` URL этого стенда: `https://context4.me/v1/api/{connectorId}/{vendorPath}`. Параметры в фигурных скобках заменяются фактическими ID из API. GET a catalogued vendor endpoint through a connection (mirror path) Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `vendorPath` | path | да | {"type":"string","minLength":1,"maxLength":2000,"description":"The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter","example":"api/v4/leads/7"} The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter | | `Context4-Connection-Id` | header | да | {"type":"string","format":"uuid","description":"The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`)","example":"3f1c2a9e-8b4d-4c55-9a0e-6d2f1b7c8e90"} The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`) | ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The vendor's response, status and body unchanged, with `Context4-Execution-Id` and `Context4-Origin: provider`; a platform refusal is a problem document with `Context4-Origin: platform` | Тело не задано контрактом | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## callConnectorApiPost `POST /v1/api/{connectorId}/{vendorPath}` URL этого стенда: `https://context4.me/v1/api/{connectorId}/{vendorPath}`. Параметры в фигурных скобках заменяются фактическими ID из API. POST a catalogued vendor endpoint through a connection (mirror path) Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `vendorPath` | path | да | {"type":"string","minLength":1,"maxLength":2000,"description":"The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter","example":"api/v4/leads/7"} The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter | | `Context4-Connection-Id` | header | да | {"type":"string","format":"uuid","description":"The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`)","example":"3f1c2a9e-8b4d-4c55-9a0e-6d2f1b7c8e90"} The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`) | ### Тело запроса Необязательно. [ConnectorApiBody](https://context4.me/docs/api-schemas-5.md#connectorapibody) ```json { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectorApiBody" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The vendor's response, status and body unchanged, with `Context4-Execution-Id` and `Context4-Origin: provider`; a platform refusal is a problem document with `Context4-Origin: platform` | Тело не задано контрактом | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## callConnectorApiPut `PUT /v1/api/{connectorId}/{vendorPath}` URL этого стенда: `https://context4.me/v1/api/{connectorId}/{vendorPath}`. Параметры в фигурных скобках заменяются фактическими ID из API. PUT a catalogued vendor endpoint through a connection (mirror path) Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `vendorPath` | path | да | {"type":"string","minLength":1,"maxLength":2000,"description":"The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter","example":"api/v4/leads/7"} The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter | | `Context4-Connection-Id` | header | да | {"type":"string","format":"uuid","description":"The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`)","example":"3f1c2a9e-8b4d-4c55-9a0e-6d2f1b7c8e90"} The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`) | ### Тело запроса Необязательно. [ConnectorApiBody](https://context4.me/docs/api-schemas-5.md#connectorapibody) ```json { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectorApiBody" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The vendor's response, status and body unchanged, with `Context4-Execution-Id` and `Context4-Origin: provider`; a platform refusal is a problem document with `Context4-Origin: platform` | Тело не задано контрактом | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## callConnectorApiPatch `PATCH /v1/api/{connectorId}/{vendorPath}` URL этого стенда: `https://context4.me/v1/api/{connectorId}/{vendorPath}`. Параметры в фигурных скобках заменяются фактическими ID из API. PATCH a catalogued vendor endpoint through a connection (mirror path) Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `vendorPath` | path | да | {"type":"string","minLength":1,"maxLength":2000,"description":"The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter","example":"api/v4/leads/7"} The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter | | `Context4-Connection-Id` | header | да | {"type":"string","format":"uuid","description":"The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`)","example":"3f1c2a9e-8b4d-4c55-9a0e-6d2f1b7c8e90"} The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`) | ### Тело запроса Необязательно. [ConnectorApiBody](https://context4.me/docs/api-schemas-5.md#connectorapibody) ```json { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectorApiBody" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The vendor's response, status and body unchanged, with `Context4-Execution-Id` and `Context4-Origin: provider`; a platform refusal is a problem document with `Context4-Origin: platform` | Тело не задано контрактом | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` ## callConnectorApiDelete `DELETE /v1/api/{connectorId}/{vendorPath}` URL этого стенда: `https://context4.me/v1/api/{connectorId}/{vendorPath}`. Параметры в фигурных скобках заменяются фактическими ID из API. DELETE a catalogued vendor endpoint through a connection (mirror path) Полномочие: `executions:write`. ### Параметры | Имя | Где | Обязателен | Тип и ограничения | | --- | --- | --- | --- | | `connectorId` | path | да | {"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"} | | `vendorPath` | path | да | {"type":"string","minLength":1,"maxLength":2000,"description":"The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter","example":"api/v4/leads/7"} The vendor path after `/v1/api/{connectorId}/`, exactly as the vendor documents it. Its slashes may be sent literally (`api/v4/leads/7`) or, as a generated client encodes one path parameter, percent-encoded as one segment (`api%2Fv4%2Fleads%2F7`). A `/` that belongs inside one vendor parameter (a git ref `heads/main`) is `%2F` in the literal form (`git/ref/heads%2Fmain`) and `%252F` in the encoded one; it reaches the vendor as `%2F` inside that segment, and only where the endpoint's template has a parameter | | `Context4-Connection-Id` | header | да | {"type":"string","format":"uuid","description":"The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`)","example":"3f1c2a9e-8b4d-4c55-9a0e-6d2f1b7c8e90"} The connection the vendor call runs on; it must belong to `connectorId` (another connector's connection is `409`) | ### Тело запроса Необязательно. [ConnectorApiBody](https://context4.me/docs/api-schemas-5.md#connectorapibody) ```json { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectorApiBody" } } } } ``` ### Ответы и ошибки | HTTP | Значение | Формат и схема | | --- | --- | --- | | 200 | The vendor's response, status and body unchanged, with `Context4-Execution-Id` and `Context4-Origin: provider`; a platform refusal is a problem document with `Context4-Origin: platform` | Тело не задано контрактом | | 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | | 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) | Заголовки успешного ответа: ```json { "X-Request-Id": { "description": "Correlation id echoed on every response", "schema": { "type": "string" } }, "RateLimit-Limit": { "description": "Per-key request limit for the current window", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Requests remaining in the current window", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Seconds until the current window resets", "schema": { "type": "integer" } } } ``` --- # Реестр HTTP-методов Composio Источник: https://context4.me/docs/compat-api-reference Сгенерировано из деклараций клиентских compat-контроллеров. Параметры с `:` заполняются значением соответствующего ID. Авторизация — API-ключ Context4. Формы SDK, ограничения совместимости и обработка ошибок — [Composio SDK](https://context4.me/docs/composio-sdk.md). Это адаптер SDK: его JSON-конверты отличаются от нативного `/v1` и не описаны нативным OpenAPI. Base URL этого стенда: `https://context4.me/compat/context4/v1`. Для `GET /compat/context4/v1/api/v3.1/auth_configs` сейчас нужны оба полномочия: `tools:read` проверяется compat-маршрутом, а `connections:read` — вложенным чтением auth configs. Ключ только с одним из них получает `403`. В таблице указан полный необходимый набор; декларация маршрута отдельно содержит `tools:read`. | Метод | Полный путь | URL этого стенда | Полномочие | Обычный HTTP успех | | --- | --- | --- | --- | --- | | GET | `/compat/context4/v1/api/v3.1/auth_configs` | `https://context4.me/compat/context4/v1/api/v3.1/auth_configs` | `tools:read + connections:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/auth_configs` | `https://context4.me/compat/context4/v1/api/v3.1/auth_configs` | `connections:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/auth_configs/:authConfigId` | `https://context4.me/compat/context4/v1/api/v3.1/auth_configs/:authConfigId` | `connections:read` | 200 | | PATCH | `/compat/context4/v1/api/v3.1/auth_configs/:authConfigId` | `https://context4.me/compat/context4/v1/api/v3.1/auth_configs/:authConfigId` | `connections:write` | 200 | | PATCH | `/compat/context4/v1/api/v3.1/auth_configs/:authConfigId/:status` | `https://context4.me/compat/context4/v1/api/v3.1/auth_configs/:authConfigId/:status` | `connections:write` | 200 | | DELETE | `/compat/context4/v1/api/v3.1/auth_configs/:authConfigId` | `https://context4.me/compat/context4/v1/api/v3.1/auth_configs/:authConfigId` | `connections:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/connected_accounts` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts` | `connections:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/connected_accounts/:connectionId/refresh` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts/:connectionId/refresh` | `connections:write` | 200 | | PATCH | `/compat/context4/v1/api/v3.1/connected_accounts/:connectionId` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts/:connectionId` | `connections:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/connected_accounts/link` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts/link` | `connections:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/connected_accounts` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts` | `connections:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/connected_accounts/:connectionId` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts/:connectionId` | `connections:read` | 200 | | DELETE | `/compat/context4/v1/api/v3.1/connected_accounts/:connectionId` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts/:connectionId` | `connections:write` | 200 | | PATCH | `/compat/context4/v1/api/v3.1/connected_accounts/:connectionId/status` | `https://context4.me/compat/context4/v1/api/v3.1/connected_accounts/:connectionId/status` | `connections:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/endpoints/list` | `https://context4.me/compat/context4/v1/api/v3.1/endpoints/list` | `tools:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/endpoints/describe` | `https://context4.me/compat/context4/v1/api/v3.1/endpoints/describe` | `tools:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/endpoints/search` | `https://context4.me/compat/context4/v1/api/v3.1/endpoints/search` | `connections:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/endpoints/execute` | `https://context4.me/compat/context4/v1/api/v3.1/endpoints/execute` | `executions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/endpoints/executions/lookup` | `https://context4.me/compat/context4/v1/api/v3.1/endpoints/executions/lookup` | `executions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/files/upload/request` | `https://context4.me/compat/context4/v1/api/v3.1/files/upload/request` | `executions:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/files/list` | `https://context4.me/compat/context4/v1/api/v3.1/files/list` | `executions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/mcp/servers` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/servers` | `tool-sessions:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/mcp/servers` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/servers` | `tool-sessions:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/mcp/app/:appKey` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/app/:appKey` | `tool-sessions:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/mcp/:id` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/:id` | `tool-sessions:read` | 200 | | PATCH | `/compat/context4/v1/api/v3.1/mcp/:id` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/:id` | `tool-sessions:write` | 200 | | DELETE | `/compat/context4/v1/api/v3.1/mcp/:id` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/:id` | `tool-sessions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/mcp/servers/generate` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/servers/generate` | `tool-sessions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/mcp/servers/custom` | `https://context4.me/compat/context4/v1/api/v3.1/mcp/servers/custom` | `tool-sessions:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/items` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/items` | `tool-sessions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/delete` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/delete` | `tool-sessions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/upload_url` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/upload_url` | `tool-sessions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/download_url` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/mounts/:mountID/download_url` | `tool-sessions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/attach` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/attach` | `tool-sessions:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/toolkits` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/toolkits` | `tool-sessions:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/config_history` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/config_history` | `tool-sessions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/search` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/search` | `tool-sessions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/proxy_execute` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/proxy_execute` | `executions:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/tools` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/tools` | `tool-sessions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/execute_meta` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/execute_meta` | `executions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/execute` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/execute` | `executions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/tools/execute/proxy` | `https://context4.me/compat/context4/v1/api/v3.1/tools/execute/proxy` | `executions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/tools/execute/:toolSlug` | `https://context4.me/compat/context4/v1/api/v3.1/tools/execute/:toolSlug` | `executions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/internal/action_execution/logs` | `https://context4.me/compat/context4/v1/api/v3.1/internal/action_execution/logs` | `executions:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/internal/action_execution/log/:logId` | `https://context4.me/compat/context4/v1/api/v3.1/internal/action_execution/log/:logId` | `executions:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session` | `tool-sessions:write` | 200 | | POST | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/link` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId/link` | `connections:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId` | `tool-sessions:read` | 200 | | PATCH | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId` | `tool-sessions:write` | 200 | | DELETE | `/compat/context4/v1/api/v3.1/tool_router/session/:sessionId` | `https://context4.me/compat/context4/v1/api/v3.1/tool_router/session/:sessionId` | `tool-sessions:write` | 200 | | GET | `/compat/context4/v1/api/v3.1/toolkits` | `https://context4.me/compat/context4/v1/api/v3.1/toolkits` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/toolkits/categories` | `https://context4.me/compat/context4/v1/api/v3.1/toolkits/categories` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/toolkits/:toolkitSlug` | `https://context4.me/compat/context4/v1/api/v3.1/toolkits/:toolkitSlug` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/tools` | `https://context4.me/compat/context4/v1/api/v3.1/tools` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/tools/enum` | `https://context4.me/compat/context4/v1/api/v3.1/tools/enum` | `tools:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/tools/execute/:toolSlug/input` | `https://context4.me/compat/context4/v1/api/v3.1/tools/execute/:toolSlug/input` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/tools/:toolSlug` | `https://context4.me/compat/context4/v1/api/v3.1/tools/:toolSlug` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/triggers_types` | `https://context4.me/compat/context4/v1/api/v3.1/triggers_types` | `tools:read` | 200 | | GET | `/compat/context4/v1/api/v3.1/triggers_types/:triggerSlug` | `https://context4.me/compat/context4/v1/api/v3.1/triggers_types/:triggerSlug` | `tools:read` | 200 | | POST | `/compat/context4/v1/api/v3.1/trigger_instances/:triggerSlug/upsert` | `https://context4.me/compat/context4/v1/api/v3.1/trigger_instances/:triggerSlug/upsert` | `executions:write` | 501 | | DELETE | `/compat/context4/v1/api/v3.1/trigger_instances/manage/:triggerId` | `https://context4.me/compat/context4/v1/api/v3.1/trigger_instances/manage/:triggerId` | `executions:write` | 501 | Обычный HTTP успех не означает успешное действие: проверяйте SDK-конверт, `successful` и `error`. Trigger-заглушки и недоступные возможности могут отвечать отказом. Каталог внешних endpoint-автоматизаций first-party платформы не является клиентским SDK API и в этот реестр не включён. --- # Схемы API: часть 1 Источник: https://context4.me/docs/api-schemas-1 Точные имена полей, required, enum, nullable и ограничения сохранены из [OpenAPI](https://context4.me/docs/openapi.json). `$ref` разрешается относительно `components.schemas` полного документа. Все части: [1](https://context4.me/docs/api-schemas-1.md), [2](https://context4.me/docs/api-schemas-2.md), [3](https://context4.me/docs/api-schemas-3.md), [4](https://context4.me/docs/api-schemas-4.md). ## Problem ```json { "type": "object", "properties": { "type": { "type": "string" }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "status": { "type": "integer", "minimum": 400, "maximum": 599 }, "code": { "type": "string", "enum": [ "validation_failed", "authentication_required", "invalid_api_key", "api_key_expired", "api_key_revoked", "invalid_oauth_token", "oauth_token_expired", "oauth_grant_revoked", "workspace_selection_required", "capability_missing", "forbidden", "not_found", "conflict", "idempotency_conflict", "execution_not_cancellable", "session_expired", "session_revoked", "session_call_budget_exhausted", "rate_limited", "quota_exceeded", "connector_version_unavailable", "provider_unavailable", "service_unavailable", "internal" ] }, "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "detail": { "type": "string", "maxLength": 256 } }, "required": [ "type", "title", "status", "code", "request_id" ], "additionalProperties": false, "description": "RFC7807-style problem document. `code` is the stable machine-readable registry entry." } ``` ## ToolListResponse Связанные схемы: [ToolSummary](https://context4.me/docs/api-schemas-1.md#toolsummary). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ToolSummary" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## ToolSummary ```json { "type": "object", "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}\\.[a-z0-9][a-z0-9_.]{1,78}$", "example": "bitrix24.contact.create" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "operation_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_.]{1,78}$", "example": "contact.create" }, "name": { "type": "string", "minLength": 1, "maxLength": 160 }, "description": { "type": [ "string", "null" ], "maxLength": 2000 } }, "required": [ "id", "connector_id", "connector_version", "operation_id", "name", "description" ], "additionalProperties": false } ``` ## ToolDetail ```json { "type": "object", "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}\\.[a-z0-9][a-z0-9_.]{1,78}$", "example": "bitrix24.contact.create" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "operation_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_.]{1,78}$", "example": "contact.create" }, "name": { "type": "string", "minLength": 1, "maxLength": 160 }, "description": { "type": [ "string", "null" ], "maxLength": 2000 }, "input_schema": {}, "output_schema": {} }, "required": [ "id", "connector_id", "connector_version", "operation_id", "name", "description" ], "additionalProperties": false, "description": "Tool with its pinned JSON-schema documents (published catalog version)" } ``` ## PublicIdentity ```json { "type": "object", "properties": { "organization_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "workspace_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "organization_id", "workspace_id" ], "additionalProperties": false } ``` ## Execution Связанные схемы: [ExecutionEndUserRef](https://context4.me/docs/api-schemas-1.md#executionenduserref). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "status": { "type": "string", "enum": [ "requested", "queued", "running", "retrying", "succeeded", "failed", "rejected", "cancelled" ] }, "source": { "type": "string", "enum": [ "dashboard", "api", "mcp", "compat" ] }, "user_id": { "$ref": "#/components/schemas/ExecutionEndUserRef" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "operation_id": { "type": "string", "minLength": 1, "maxLength": 160 }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "tool_session_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "project_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "denial_code": { "type": [ "string", "null" ], "enum": [ "policy_denied", "quota_exhausted", "connector_version_unavailable", "connection_unavailable", "session_denied", null ] }, "failure_code": { "type": [ "string", "null" ], "enum": [ "provider_timeout", "provider_rate_limited", "provider_unavailable", "connection_revoked", "invalid_input", "provider_rejected", "attempt_lost", "engine_error", "retries_exhausted", null ] }, "attempt_count": { "type": "integer", "minimum": 0 }, "max_attempts": { "type": "integer", "exclusiveMinimum": 0 }, "next_retry_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "queued_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "finished_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "status", "source", "user_id", "connector_id", "connector_version", "operation_id", "connection_id", "tool_session_id", "project_id", "denial_code", "failure_code", "attempt_count", "max_attempts", "next_retry_at", "version", "created_at", "updated_at", "queued_at", "finished_at" ], "additionalProperties": false } ``` ## ExecutionEndUserRef ```json { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9 _.:@-]{0,255}$" } ``` ## CreateExecutionRequest ```json { "type": "object", "properties": { "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "operation_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_.]{1,78}$", "example": "contact.create" }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "tool_session_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "tool_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}\\.[a-z0-9][a-z0-9_.]{1,78}$", "example": "bitrix24.contact.create" }, "project_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "input": { "description": "Bounded JSON payload (<= 64 KiB serialized)" } }, "additionalProperties": false } ``` ## ExecutionListResponse Связанные схемы: [Execution](https://context4.me/docs/api-schemas-1.md#execution). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Execution" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## ExecutionWithResult Связанные схемы: [ExecutionEndUserRef](https://context4.me/docs/api-schemas-1.md#executionenduserref), [ExecutionResult](https://context4.me/docs/api-schemas-1.md#executionresult). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "status": { "type": "string", "enum": [ "requested", "queued", "running", "retrying", "succeeded", "failed", "rejected", "cancelled" ] }, "source": { "type": "string", "enum": [ "dashboard", "api", "mcp", "compat" ] }, "user_id": { "$ref": "#/components/schemas/ExecutionEndUserRef" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "operation_id": { "type": "string", "minLength": 1, "maxLength": 160 }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "tool_session_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "project_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "denial_code": { "type": [ "string", "null" ], "enum": [ "policy_denied", "quota_exhausted", "connector_version_unavailable", "connection_unavailable", "session_denied", null ] }, "failure_code": { "type": [ "string", "null" ], "enum": [ "provider_timeout", "provider_rate_limited", "provider_unavailable", "connection_revoked", "invalid_input", "provider_rejected", "attempt_lost", "engine_error", "retries_exhausted", null ] }, "attempt_count": { "type": "integer", "minimum": 0 }, "max_attempts": { "type": "integer", "exclusiveMinimum": 0 }, "next_retry_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "queued_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "finished_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "result": { "$ref": "#/components/schemas/ExecutionResult" } }, "required": [ "id", "status", "source", "user_id", "connector_id", "connector_version", "operation_id", "connection_id", "tool_session_id", "project_id", "denial_code", "failure_code", "attempt_count", "max_attempts", "next_retry_at", "version", "created_at", "updated_at", "queued_at", "finished_at", "result" ], "additionalProperties": false } ``` ## ExecutionResult ```json { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "inline" ] }, "data": {} }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "url" ] }, "url": { "type": "string", "maxLength": 2048, "format": "uri" }, "expires_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "kind", "url", "expires_at" ], "additionalProperties": false }, { "type": "null" } ], "description": "Inline normalized result or a short-lived signed download URL" } ``` ## AttemptListResponse Связанные схемы: [ExecutionAttempt](https://context4.me/docs/api-schemas-1.md#executionattempt). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ExecutionAttempt" } } }, "required": [ "data" ], "additionalProperties": false } ``` ## ExecutionAttempt ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "execution_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "attempt_number": { "type": "integer", "exclusiveMinimum": 0 }, "outcome": { "type": "string", "enum": [ "succeeded", "failed_transient", "failed_permanent", "lost" ] }, "error_code": { "type": [ "string", "null" ], "enum": [ "provider_timeout", "provider_rate_limited", "provider_unavailable", "connection_revoked", "invalid_input", "provider_rejected", "attempt_lost", "engine_error", "retries_exhausted", null ] }, "error_message": { "type": [ "string", "null" ], "maxLength": 500 }, "started_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "finished_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "latency_ms": { "type": "integer", "minimum": 0 } }, "required": [ "id", "execution_id", "attempt_number", "outcome", "error_code", "error_message", "started_at", "finished_at", "latency_ms" ], "additionalProperties": false, "description": "Append-only attempt record; engine identifiers are deliberately not exposed" } ``` ## CancelExecutionRequest ```json { "type": "object", "properties": { "expected_version": { "type": "integer", "exclusiveMinimum": 0 } }, "required": [ "expected_version" ], "additionalProperties": false } ``` ## ConnectionListResponse Связанные схемы: [Connection](https://context4.me/docs/api-schemas-1.md#connection). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Connection" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## Connection Связанные схемы: [EndUserRef](https://context4.me/docs/api-schemas-2.md#enduserref). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "auth_method": { "type": "string", "enum": [ "oauth2", "api_key" ] }, "user_id": { "$ref": "#/components/schemas/EndUserRef" }, "is_default": { "type": "boolean" }, "status": { "type": "string", "enum": [ "pending", "active", "degraded", "revoked", "failed" ] }, "status_reason": { "type": [ "string", "null" ], "maxLength": 120 }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "activated_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "connector_id", "connector_version", "name", "auth_method", "user_id", "is_default", "status", "status_reason", "version", "created_at", "activated_at" ], "additionalProperties": false } ``` --- # Схемы API: часть 2 Источник: https://context4.me/docs/api-schemas-2 Точные имена полей, required, enum, nullable и ограничения сохранены из [OpenAPI](https://context4.me/docs/openapi.json). `$ref` разрешается относительно `components.schemas` полного документа. Все части: [1](https://context4.me/docs/api-schemas-1.md), [2](https://context4.me/docs/api-schemas-2.md), [3](https://context4.me/docs/api-schemas-3.md), [4](https://context4.me/docs/api-schemas-4.md). ## EndUserRef ```json { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9 _.:@-]{0,255}$" } ``` ## HostedAuthLink ```json { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connect_url": { "type": "string", "maxLength": 2048, "format": "uri" }, "expires_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "connection_id", "connect_url", "expires_at" ], "additionalProperties": false, "description": "Hosted authorization link; direct the end user to connect_url before it expires" } ``` ## CreateConnectionRequest Связанные схемы: [EndUserRef](https://context4.me/docs/api-schemas-2.md#enduserref). ```json { "type": "object", "properties": { "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "user_id": { "$ref": "#/components/schemas/EndUserRef" }, "name": { "type": "string", "minLength": 2, "maxLength": 120, "pattern": "^[\\p{L}\\p{N}][\\p{L}\\p{N}\\p{Pd} _.]+$" }, "resume": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "expected_version": { "type": "integer", "exclusiveMinimum": 0 } }, "required": [ "connection_id", "expected_version" ], "additionalProperties": false } }, "required": [ "connector_id", "name" ], "additionalProperties": false, "description": "Initiates hosted OAuth authorization. Optional resume renews an unactivated connection in place; account identity must match and expected_version guards concurrent attempts." } ``` ## AuthConfigListResponse Связанные схемы: [AuthConfig](https://context4.me/docs/api-schemas-2.md#authconfig). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AuthConfig" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## AuthConfig ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "mode": { "type": "string", "enum": [ "managed", "custom" ] }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "client_id_mask": { "type": "string", "maxLength": 24 }, "scopes": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "maxItems": 64 }, "status": { "type": "string", "enum": [ "enabled", "disabled" ] }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "connector_id", "mode", "name", "client_id_mask", "scopes", "status", "version", "created_at", "updated_at" ], "additionalProperties": false } ``` ## CreateAuthConfigRequest ```json { "type": "object", "properties": { "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "mode": { "type": "string", "enum": [ "managed", "custom" ] }, "client_id": { "type": "string", "minLength": 4, "maxLength": 512 }, "client_secret": { "type": "string", "minLength": 8, "maxLength": 4096 }, "scopes": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "maxItems": 64 } }, "required": [ "connector_id", "name" ], "additionalProperties": false, "description": "Registers a named auth configuration; a custom mode requires the tenant's OAuth client, whose secret is delivered once to the engine boundary and never echoed" } ``` ## UpdateAuthConfigRequest ```json { "type": "object", "properties": { "expected_version": { "type": "integer", "exclusiveMinimum": 0 }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "status": { "type": "string", "enum": [ "enabled", "disabled" ] } }, "required": [ "expected_version" ], "additionalProperties": false } ``` ## NetworkAttachment ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "mode": { "type": "string", "enum": [ "direct", "wireguard", "openvpn" ] }, "destinations": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false } }, "dns_servers": { "type": "array", "items": { "anyOf": [ { "type": "string", "format": "ip" }, { "type": "string", "format": "ip" } ] }, "maxItems": 3 }, "connection_enabled": { "type": "boolean" }, "status": { "type": "string", "enum": [ "pending", "provisioning", "active", "degraded", "draining", "ready_to_revoke", "revoked", "failed" ] }, "status_reason": { "type": [ "string", "null" ], "maxLength": 120 }, "desired_generation": { "type": "integer", "exclusiveMinimum": 0 }, "observed_generation": { "type": "integer", "minimum": 0 }, "active_lease_count": { "type": "integer", "minimum": 0 }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "last_health_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "revoked_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "name", "mode", "destinations", "dns_servers", "connection_enabled", "status", "status_reason", "desired_generation", "observed_generation", "active_lease_count", "version", "last_health_at", "revoked_at", "created_at", "updated_at" ], "additionalProperties": false } ``` ## NetworkAttachmentList Связанные схемы: [NetworkAttachment](https://context4.me/docs/api-schemas-2.md#networkattachment). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/NetworkAttachment" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## CreateNetworkAttachmentRequest ```json { "oneOf": [ { "type": "object", "properties": { "dns_servers": { "type": "array", "items": { "anyOf": [ { "type": "string", "format": "ip" }, { "type": "string", "format": "ip" } ] }, "maxItems": 3 }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "destinations": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 64 }, "mode": { "type": "string", "enum": [ "direct" ] } }, "required": [ "name", "destinations", "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "dns_servers": { "type": "array", "items": { "anyOf": [ { "type": "string", "format": "ip" }, { "type": "string", "format": "ip" } ] }, "maxItems": 3 }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "destinations": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 64 }, "mode": { "type": "string", "enum": [ "wireguard" ] }, "credential": { "type": "object", "properties": { "private_key": { "type": "string", "minLength": 32, "maxLength": 256 }, "peer_public_key": { "type": "string", "minLength": 32, "maxLength": 256 }, "preshared_key": { "type": "string", "minLength": 32, "maxLength": 256 }, "endpoint_host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "endpoint_port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "interface_addresses": { "type": "array", "items": { "type": "string", "minLength": 3, "maxLength": 64 }, "minItems": 1, "maxItems": 8 } }, "required": [ "private_key", "peer_public_key", "endpoint_host", "endpoint_port", "interface_addresses" ], "additionalProperties": false } }, "required": [ "name", "destinations", "mode", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "dns_servers": { "type": "array", "items": { "anyOf": [ { "type": "string", "format": "ip" }, { "type": "string", "format": "ip" } ] }, "maxItems": 3 }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "destinations": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 64 }, "mode": { "type": "string", "enum": [ "openvpn" ] }, "credential": { "type": "object", "properties": { "options": { "type": "object", "properties": { "cipher": { "type": "string", "enum": [ "AES-256-GCM", "AES-128-GCM", "CHACHA20-POLY1305" ] }, "auth": { "type": "string", "enum": [ "none", "SHA1", "SHA256", "SHA512" ] }, "tun_mtu": { "type": "integer", "minimum": 576, "maximum": 9000 }, "ping": { "type": "integer", "minimum": 0, "maximum": 3600 }, "ping_restart": { "type": "integer", "minimum": 0, "maximum": 86400 }, "connect_retry": { "type": "integer", "minimum": 1, "maximum": 300 }, "reneg_sec": { "type": "integer", "minimum": 0, "maximum": 604800 }, "persist_tun": { "type": "boolean" }, "persist_key": { "type": "boolean" }, "mute_replay_warnings": { "type": "boolean" }, "verb": { "type": "integer", "minimum": 0, "maximum": 4 } }, "additionalProperties": false }, "remote_host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$" }, "remote_port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "protocol": { "type": "string", "enum": [ "udp", "tcp" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 16384 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 16384 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 16384 }, "tls_auth_key": { "type": "string", "minLength": 64, "maxLength": 16384 }, "tls_auth_direction": { "type": "string", "enum": [ "0", "1" ] }, "username": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[^\\0\\r\\n]+$" }, "password": { "type": "string", "minLength": 1, "maxLength": 4096, "pattern": "^[^\\0\\r\\n]+$" } }, "required": [ "remote_host", "remote_port", "protocol", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false, "not": { "required": [ "options", "tls_auth_key" ], "properties": { "options": { "required": [ "auth" ], "properties": { "auth": { "enum": [ "none" ] } } } } } } }, "required": [ "name", "destinations", "mode", "credential" ], "additionalProperties": false } ], "description": "Typed private-network configuration; arbitrary OpenVPN/WireGuard files, scripts, plugins, and routes are not accepted" } ``` ## DiscoverPostgresDatabasesResponse ```json { "type": "object", "properties": { "databases": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "access": { "type": "string", "enum": [ "verified", "candidate", "denied" ] }, "connect_privilege": { "type": "boolean" } }, "required": [ "name", "access", "connect_privilege" ], "additionalProperties": false }, "maxItems": 100 }, "incomplete": { "type": "boolean" }, "seed_database": { "type": "string", "minLength": 1, "maxLength": 200 }, "error_code": { "type": [ "string", "null" ], "enum": [ "network_unavailable", "authentication_failed", "login_trigger_failed", "tls_failed", "tls_configuration_unsupported", "seed_database_unavailable", "catalog_denied", "discovery_unavailable", null ] } }, "required": [ "databases", "incomplete", "seed_database", "error_code" ], "additionalProperties": false } ``` ## DataSourceConnection Связанные схемы: [DataSourceAttentionReason](https://context4.me/docs/api-schemas-2.md#datasourceattentionreason). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "kind": { "type": "string", "enum": [ "postgres", "mysql", "sqlserver", "mongodb", "topic" ] }, "endpoint": { "type": "object", "properties": { "hosts": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 253 }, "minItems": 1, "maxItems": 20 }, "port": { "type": [ "integer", "null" ], "minimum": 1, "maximum": 65535 }, "resource": { "type": "string", "minLength": 1, "maxLength": 200 }, "authentication": { "type": "string", "minLength": 1, "maxLength": 64 }, "tls_mode": { "type": "string", "enum": [ "require", "verify_ca", "verify_full", "mutual_tls" ] }, "custom_ca": { "type": "boolean" }, "mutual_tls": { "type": "boolean" } }, "required": [ "hosts", "port", "resource", "authentication", "tls_mode", "custom_ca", "mutual_tls" ], "additionalProperties": false }, "credential_version": { "type": "integer", "exclusiveMinimum": 0 }, "network_attachment_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "status": { "type": "string", "enum": [ "pending", "active", "degraded", "revoked", "failed" ] }, "status_reason": { "$ref": "#/components/schemas/DataSourceAttentionReason" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "name", "kind", "endpoint", "credential_version", "network_attachment_id", "status", "status_reason", "created_at", "updated_at" ], "additionalProperties": false } ``` ## DataSourceAttentionReason ```json { "type": [ "string", "null" ], "enum": [ "authentication_failed", "login_trigger_failed", "catalog_denied", "tls_failed", null ], "description": "Source-side condition a person must fix; set only while the connection is degraded" } ``` ## AddDatabaseFromConnectionRequest ```json { "type": "object", "properties": { "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "database": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "name", "database" ], "additionalProperties": false } ``` ## DiscoverPostgresDatabasesRequest ```json { "type": "object", "properties": { "network_attachment_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "source": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "postgres", "sqlserver" ] }, "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "seed_database": { "type": "string", "minLength": 1, "maxLength": 200 }, "authentication": { "type": "string", "enum": [ "username_password" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] } }, "required": [ "kind", "host", "port", "authentication", "credential", "tls" ], "additionalProperties": false } }, "required": [ "source" ], "additionalProperties": false } ``` ## DataSourceConnectionList Связанные схемы: [DataSourceConnection](https://context4.me/docs/api-schemas-2.md#datasourceconnection). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DataSourceConnection" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` --- # Схемы API: часть 3 Источник: https://context4.me/docs/api-schemas-3 Точные имена полей, required, enum, nullable и ограничения сохранены из [OpenAPI](https://context4.me/docs/openapi.json). `$ref` разрешается относительно `components.schemas` полного документа. Все части: [1](https://context4.me/docs/api-schemas-1.md), [2](https://context4.me/docs/api-schemas-2.md), [3](https://context4.me/docs/api-schemas-3.md), [4](https://context4.me/docs/api-schemas-4.md). ## CreateDataSourceConnectionRequest ```json { "type": "object", "properties": { "name": { "type": "string", "minLength": 2, "maxLength": 120 }, "network_attachment_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "source": { "anyOf": [ { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "database": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "anyOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "sqlserver" ] }, "authentication": { "type": "string", "enum": [ "username_password" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "host", "port", "database", "tls", "kind", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "database": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "postgres" ] }, "authentication": { "type": "string", "enum": [ "username_password" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "host", "port", "database", "tls", "kind", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "database": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "mysql" ] }, "authentication": { "type": "string", "enum": [ "username_password" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "host", "port", "database", "tls", "kind", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "database": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "mongodb" ] }, "replica_set": { "type": "string", "minLength": 1, "maxLength": 200 }, "authentication": { "type": "string", "enum": [ "username_password" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "host", "port", "database", "tls", "kind", "replica_set", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "database": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "mongodb" ] }, "replica_set": { "type": "string", "minLength": 1, "maxLength": 200 }, "authentication": { "type": "string", "enum": [ "x509" ] }, "credential": { "type": "object", "properties": {}, "additionalProperties": false } }, "required": [ "host", "port", "database", "tls", "kind", "replica_set", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "bootstrap_servers": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 20 }, "topic": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "topic" ] }, "authentication": { "type": "string", "enum": [ "sasl_scram_256" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "bootstrap_servers", "topic", "tls", "kind", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "bootstrap_servers": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 20 }, "topic": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "topic" ] }, "authentication": { "type": "string", "enum": [ "sasl_scram_512" ] }, "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "bootstrap_servers", "topic", "tls", "kind", "authentication", "credential" ], "additionalProperties": false }, { "type": "object", "properties": { "bootstrap_servers": { "type": "array", "items": { "type": "object", "properties": { "host": { "type": "string", "minLength": 1, "maxLength": 253 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 } }, "required": [ "host", "port" ], "additionalProperties": false }, "minItems": 1, "maxItems": 20 }, "topic": { "type": "string", "minLength": 1, "maxLength": 200 }, "tls": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "require" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "verify_ca", "verify_full" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate" ], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "mutual_tls" ] }, "ca_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_certificate": { "type": "string", "minLength": 64, "maxLength": 32768 }, "client_key": { "type": "string", "minLength": 64, "maxLength": 32768 } }, "required": [ "mode", "ca_certificate", "client_certificate", "client_key" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "topic" ] }, "authentication": { "type": "string", "enum": [ "mutual_tls" ] }, "credential": { "type": "object", "properties": {}, "additionalProperties": false } }, "required": [ "bootstrap_servers", "topic", "tls", "kind", "authentication", "credential" ], "additionalProperties": false } ] } }, "required": [ "name", "source" ], "additionalProperties": false, "description": "Typed source settings; raw DSNs, secret references, connector configs, and executable content are not accepted" } ``` ## ReplaceDataSourceCredentialRequest ```json { "type": "object", "properties": { "credential": { "type": "object", "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "password": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "username", "password" ], "additionalProperties": false } }, "required": [ "credential" ], "additionalProperties": false, "description": "A new username and password for a password-authenticated source; stored as the next secret version and never returned" } ``` ## SourceSchema ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "source_connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "source_technology": { "type": "string", "enum": [ "postgres", "mysql", "mongodb", "sqlserver", "topic" ] }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "entities": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "key_fields": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 64 }, "fields": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "type": { "type": "string", "minLength": 1, "maxLength": 200 }, "nullable": { "type": "boolean" } }, "required": [ "name", "type", "nullable" ], "additionalProperties": false }, "minItems": 1, "maxItems": 2000 } }, "required": [ "name", "key_fields", "fields" ], "additionalProperties": false }, "maxItems": 500 }, "capabilities": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 120 }, "maxItems": 64 }, "incomplete": { "type": "boolean" }, "compatibility": { "type": "string", "enum": [ "initial", "compatible", "breaking" ] }, "breaking_reasons": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 500 }, "maxItems": 2000 }, "predecessor_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "source_connection_id", "source_technology", "version", "hash", "entities", "capabilities", "incomplete", "compatibility", "breaking_reasons", "predecessor_id", "created_at" ], "additionalProperties": false } ``` ## ProviderSchema ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connector_id": { "type": "string", "minLength": 1, "maxLength": 120 }, "entity": { "type": "string", "minLength": 1, "maxLength": 80 }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "key_fields": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 }, "fields": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "provider_name": { "type": "string", "minLength": 1 }, "definition": { "type": "object", "additionalProperties": {} } }, "required": [ "name", "provider_name", "definition" ], "additionalProperties": false }, "minItems": 1 }, "predecessor_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "connection_id", "connector_id", "entity", "version", "hash", "key_fields", "fields", "predecessor_id", "created_at" ], "additionalProperties": false } ``` ## ToolSessionWithMcp Связанные схемы: [EndUserRef](https://context4.me/docs/api-schemas-2.md#enduserref), [SessionTool](https://context4.me/docs/api-schemas-3.md#sessiontool). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connection_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "user_id": { "$ref": "#/components/schemas/EndUserRef" }, "status": { "type": "string", "enum": [ "active", "expired", "revoked" ] }, "tools": { "type": "array", "items": { "$ref": "#/components/schemas/SessionTool" } }, "disabled_tools": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" } }, "connections": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "alias": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 64 } }, "required": [ "connection_id", "alias" ], "additionalProperties": false } } }, "expires_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "max_calls": { "type": [ "integer", "null" ], "exclusiveMinimum": 0 }, "calls_used": { "type": "integer", "minimum": 0 }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "mcp_url": { "type": "string", "maxLength": 2048, "format": "uri" } }, "required": [ "id", "connection_id", "user_id", "status", "tools", "disabled_tools", "connections", "expires_at", "max_calls", "calls_used", "version", "created_at", "updated_at", "mcp_url" ], "additionalProperties": false } ``` ## SessionTool ```json { "type": "object", "properties": { "tool_id": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "operation_id": { "type": "string", "minLength": 1, "maxLength": 160 }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" } }, "required": [ "tool_id", "connector_id", "connector_version", "operation_id", "connection_id" ], "additionalProperties": false } ``` ## CreateToolSessionRequest Связанные схемы: [EndUserRef](https://context4.me/docs/api-schemas-2.md#enduserref). ```json { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "user_id": { "$ref": "#/components/schemas/EndUserRef" }, "tool_allowlist": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" }, "minItems": 1, "maxItems": 200 }, "ttl_seconds": { "type": "integer", "minimum": 60, "maximum": 86400 }, "max_calls": { "type": [ "integer", "null" ], "minimum": 1, "maximum": 10000 } }, "additionalProperties": false, "anyOf": [ { "required": [ "connection_id" ] }, { "required": [ "user_id" ] } ], "description": "Creates a tool session. With a pinned connection the snapshot derives from connection ∩ catalog ∩ policy ∩ allowlist and is immutable afterwards; without one the session starts empty and fills as accounts are connected to it" } ``` ## ToolSession Связанные схемы: [EndUserRef](https://context4.me/docs/api-schemas-2.md#enduserref), [SessionTool](https://context4.me/docs/api-schemas-3.md#sessiontool). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connection_id": { "type": [ "string", "null" ], "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "user_id": { "$ref": "#/components/schemas/EndUserRef" }, "status": { "type": "string", "enum": [ "active", "expired", "revoked" ] }, "tools": { "type": "array", "items": { "$ref": "#/components/schemas/SessionTool" } }, "disabled_tools": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" } }, "connections": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "alias": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 64 } }, "required": [ "connection_id", "alias" ], "additionalProperties": false } } }, "expires_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "max_calls": { "type": [ "integer", "null" ], "exclusiveMinimum": 0 }, "calls_used": { "type": "integer", "minimum": 0 }, "version": { "type": "integer", "exclusiveMinimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "connection_id", "user_id", "status", "tools", "disabled_tools", "connections", "expires_at", "max_calls", "calls_used", "version", "created_at", "updated_at" ], "additionalProperties": false } ``` ## PatchToolSessionRequest ```json { "type": "object", "properties": { "expected_version": { "type": "integer", "exclusiveMinimum": 0 }, "disable": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" }, "minItems": 1, "maxItems": 200 }, "enable": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" }, "minItems": 1, "maxItems": 200 } }, "required": [ "expected_version" ], "additionalProperties": false, "description": "Bounded session mutation: enable/disable tools within the immutable snapshot, CAS-guarded by expected_version" } ``` ## SessionToolListResponse Связанные схемы: [SessionToolDetail](https://context4.me/docs/api-schemas-3.md#sessiontooldetail). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SessionToolDetail" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400 } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## SessionToolDetail ```json { "type": "object", "properties": { "tool_id": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,239}$" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connector_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "operation_id": { "type": "string", "minLength": 1, "maxLength": 160 }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "display_name": { "type": "string", "minLength": 1, "maxLength": 160 }, "description": { "type": [ "string", "null" ], "maxLength": 2000 }, "input_schema": {} }, "required": [ "tool_id", "connector_id", "connector_version", "operation_id", "connection_id", "display_name", "description" ], "additionalProperties": false } ``` ## SyncDeliveryAuthority ```json { "type": "object", "properties": { "schemaVersion": { "type": "number", "enum": [ 1 ] }, "context4OrganizationId": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,200}$" }, "workspaceId": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "syncId": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "resourceKey": { "type": "string", "minLength": 1, "maxLength": 500 }, "deliveryGrants": { "type": "array", "items": { "type": "object", "properties": { "deliveryGrantId": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "deliveryGeneration": { "type": "integer", "exclusiveMinimum": 0 }, "state": { "type": "string", "enum": [ "active", "retiring", "revoked" ] }, "retiringExpiresAt": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "revocationBarriers": { "type": "array", "items": { "type": "object", "properties": { "partition": { "type": "integer", "minimum": 0 }, "offset": { "type": "string", "pattern": "^(0|[1-9][0-9]{0,18})$" } }, "required": [ "partition", "offset" ], "additionalProperties": false }, "maxItems": 1024 } }, "required": [ "deliveryGrantId", "deliveryGeneration", "state", "retiringExpiresAt", "revocationBarriers" ], "additionalProperties": false }, "minItems": 1, "maxItems": 8 }, "sourceEpoch": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "sourceEpochTransition": { "type": "string", "enum": [ "continuation", "replacement-snapshot", "incompatible-reset" ] }, "authorityRevision": { "type": "integer", "exclusiveMinimum": 0 }, "active": { "type": "boolean" } }, "required": [ "schemaVersion", "context4OrganizationId", "workspaceId", "syncId", "entity", "resourceKey", "deliveryGrants", "sourceEpoch", "sourceEpochTransition", "authorityRevision", "active" ], "additionalProperties": false } ``` ## Sync Связанные схемы: [DataSourceAttentionReason](https://context4.me/docs/api-schemas-2.md#datasourceattentionreason). ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "connection_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "source_kind": { "type": "string", "enum": [ "api_poll", "database_cdc", "database_poll", "topic" ] }, "database_poll": { "type": [ "object", "null" ], "properties": { "schema": { "type": "string", "minLength": 1, "maxLength": 128 }, "table": { "type": "string", "minLength": 1, "maxLength": 128 }, "columns": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "minItems": 1, "maxItems": 256 }, "primary_key": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "minItems": 1, "maxItems": 16 }, "mode": { "type": "string", "enum": [ "full_scan", "rowversion", "timestamp" ] }, "watermark_column": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 128 }, "full_reconciliation_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 }, "timestamp_overlap_seconds": { "type": "integer", "minimum": 0, "maximum": 86400 }, "deletion_policy": { "type": "string", "enum": [ "preserve", "confirm_missing" ] }, "config_revision": { "type": "integer", "exclusiveMinimum": 0 } }, "required": [ "schema", "table", "columns", "primary_key", "mode", "watermark_column", "full_reconciliation_minutes", "timestamp_overlap_seconds", "deletion_policy", "config_revision" ], "additionalProperties": false }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "strategy": { "type": "string", "enum": [ "incremental", "snapshot-diff" ] }, "schedule_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 }, "schedule_clamped": { "type": "boolean" }, "requested_schedule_minutes": { "type": [ "integer", "null" ], "minimum": 1, "maximum": 10080 }, "status": { "type": "string", "enum": [ "enabled", "paused", "deleted" ] }, "source_health": { "type": [ "object", "null" ], "properties": { "phase": { "type": "string", "enum": [ "gateway_connecting", "source_connecting", "snapshotting", "streaming", "paused", "failed" ] }, "classified_error": { "type": [ "string", "null" ], "maxLength": 120 }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "artifacts": { "type": [ "object", "null" ], "properties": { "state": { "type": "string", "minLength": 1, "maxLength": 16, "description": "One of `held`, `released`, `orphaned`, `absent`.", "example": "held" }, "since": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "state", "since" ], "additionalProperties": false, "description": "The PostgreSQL replication slot and publication this CDC sync holds on its source, and since when it is in that state: `held`; `released` — the sync stayed paused past the pause limit or failed past the failed-slot grace, so the slot was dropped and the next start takes a fresh snapshot; `orphaned` — a release gave up and the source's DBA must drop the slot; `absent` — nothing was left to release. Null for a source that holds none." } }, "required": [ "phase", "classified_error", "updated_at", "artifacts" ], "additionalProperties": false }, "source_attention": { "$ref": "#/components/schemas/DataSourceAttentionReason" }, "last_run_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "next_run_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "connector_id", "connection_id", "source_kind", "entity", "strategy", "schedule_minutes", "schedule_clamped", "requested_schedule_minutes", "status", "source_health", "last_run_at", "next_run_at", "created_at", "updated_at" ], "additionalProperties": false } ``` ## SyncList Связанные схемы: [Sync](https://context4.me/docs/api-schemas-3.md#sync). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Sync" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## SyncTestFire ```json { "type": "object", "properties": { "records": { "type": "array", "items": { "type": "object", "properties": { "external_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "payload": { "type": "object", "additionalProperties": {} } }, "required": [ "external_id", "payload" ], "additionalProperties": false } }, "estimated_total": { "type": [ "integer", "null" ], "minimum": 0 } }, "required": [ "records", "estimated_total" ], "additionalProperties": false } ``` ## SyncRunList Связанные схемы: [SyncRun](https://context4.me/docs/api-schemas-4.md#syncrun). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SyncRun" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` --- # Схемы API: часть 4 Источник: https://context4.me/docs/api-schemas-4 Точные имена полей, required, enum, nullable и ограничения сохранены из [OpenAPI](https://context4.me/docs/openapi.json). `$ref` разрешается относительно `components.schemas` полного документа. Все части: [1](https://context4.me/docs/api-schemas-1.md), [2](https://context4.me/docs/api-schemas-2.md), [3](https://context4.me/docs/api-schemas-3.md), [4](https://context4.me/docs/api-schemas-4.md). ## SyncRun ```json { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "sync_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "kind": { "type": "string", "enum": [ "backfill", "incremental", "manual" ] }, "status": { "type": "string", "enum": [ "planned", "running", "deferred", "completed", "failed" ] }, "fetched": { "type": "integer", "minimum": 0 }, "created": { "type": "integer", "minimum": 0 }, "updated": { "type": "integer", "minimum": 0 }, "deleted": { "type": "integer", "minimum": 0 }, "error_code": { "type": [ "string", "null" ], "maxLength": 120 }, "backoff_reason": { "type": [ "string", "null" ], "maxLength": 200 }, "started_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "completed_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "duration_ms": { "type": [ "integer", "null" ], "minimum": 0 }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "id", "sync_id", "kind", "status", "fetched", "created", "updated", "deleted", "error_code", "backoff_reason", "started_at", "completed_at", "duration_ms", "created_at" ], "additionalProperties": false } ``` ## SyncRecordList Связанные схемы: [SyncRecord](https://context4.me/docs/api-schemas-4.md#syncrecord). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SyncRecord" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## SyncRecord ```json { "type": "object", "properties": { "external_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "change_type": { "type": "string", "enum": [ "created", "updated", "deleted" ] }, "mod_cursor": { "type": "string", "minLength": 1, "maxLength": 64 }, "payload": { "type": [ "object", "null" ], "additionalProperties": {} }, "run_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "recorded_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" } }, "required": [ "external_id", "entity", "change_type", "mod_cursor", "payload", "run_id", "recorded_at" ], "additionalProperties": false } ``` ## SyncReplay ```json { "type": "object", "properties": { "replayed": { "type": "integer", "minimum": 0 } }, "required": [ "replayed" ], "additionalProperties": false } ``` ## SyncableEntityList ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "strategy": { "type": "string", "enum": [ "incremental", "snapshot-diff" ] }, "default_schedule_minutes": { "type": "integer", "minimum": 1, "maximum": 10080 } }, "required": [ "key", "title", "strategy", "default_schedule_minutes" ], "additionalProperties": false } } }, "required": [ "data" ], "additionalProperties": false } ``` ## SyncDeliveryCapabilities ```json { "type": "object", "properties": { "channel_version": { "type": "string", "minLength": 1, "maxLength": 40 }, "envelope_schema_versions": { "type": "array", "items": { "type": "integer", "minimum": 1 }, "minItems": 1 }, "max_payload_bytes": { "type": "integer", "minimum": 1 }, "max_envelope_bytes": { "type": "integer", "minimum": 1 }, "max_key_bytes": { "type": "integer", "minimum": 1 }, "payload_measurement": { "type": "string", "enum": [ "utf8-json" ] }, "delete_semantics": { "type": "string", "enum": [ "logical-delete-null-payload", "two-step-logical-delete-then-tombstone" ] }, "retraction": { "type": "object", "properties": { "header": { "type": "string", "minLength": 1, "maxLength": 80 }, "marker": { "type": "string", "minLength": 1, "maxLength": 80 }, "grace_ms": { "type": "integer", "minimum": 1 }, "min_compaction_lag_ms": { "type": "integer", "minimum": 1 }, "delete_retention_ms": { "type": "integer", "minimum": 1 } }, "required": [ "header", "marker", "grace_ms", "min_compaction_lag_ms", "delete_retention_ms" ], "additionalProperties": false }, "oversized_record_code": { "type": "string", "minLength": 1, "maxLength": 80 } }, "required": [ "channel_version", "envelope_schema_versions", "max_payload_bytes", "max_envelope_bytes", "max_key_bytes", "payload_measurement", "delete_semantics", "retraction", "oversized_record_code" ], "additionalProperties": false } ``` ## SyncExportSession ```json { "type": "object", "properties": { "export_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "organization_id": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,200}$" }, "workspace_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "schema_fingerprint": { "type": [ "string", "null" ], "pattern": "^sha256:[a-f0-9]{64}$" }, "expires_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "range": { "type": "object", "properties": { "after_cursor": { "type": [ "string", "null" ], "pattern": "^(0|[1-9][0-9]{0,18})$" }, "through_cursor": { "type": "string", "pattern": "^(0|[1-9][0-9]{0,18})$" } }, "required": [ "after_cursor", "through_cursor" ], "additionalProperties": false }, "sync_id": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" }, "entity": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$" }, "state": { "type": "string", "enum": [ "preparing", "running", "complete", "range_expired", "archive_unavailable", "digest_mismatch", "cancelled", "failed" ] }, "frontier": { "type": "object", "properties": { "mod_cursor": { "type": "string", "minLength": 1, "maxLength": 20 }, "captured_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "source_epoch": { "type": "string", "format": "uuid", "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f" } }, "required": [ "mod_cursor", "captured_at", "source_epoch" ], "additionalProperties": false }, "publication_barrier": { "type": "array", "items": { "type": "object", "properties": { "partition": { "type": "integer", "minimum": 0 }, "offset": { "type": "string", "minLength": 1, "maxLength": 20 } }, "required": [ "partition", "offset" ], "additionalProperties": false } }, "publication_channel": { "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,248}$" }, "progress": { "type": "object", "properties": { "records": { "type": "integer", "minimum": 0 }, "encoded_bytes": { "type": "integer", "minimum": 0 } }, "required": [ "records", "encoded_bytes" ], "additionalProperties": false }, "record_count": { "type": [ "integer", "null" ], "minimum": 0 }, "digest": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 71 }, "terminal_reason": { "type": [ "string", "null" ], "maxLength": 200 }, "delivery": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "bounded-replay-topic" ] }, "channel": { "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,248}$" }, "export_key": { "type": "string", "minLength": 1, "maxLength": 200 }, "delivery_generation": { "type": "integer", "exclusiveMinimum": 0 }, "state": { "type": "string", "enum": [ "pending", "publishing", "complete", "failed", "cancelled" ] }, "records": { "type": "string", "pattern": "^(0|[1-9][0-9]{0,19})$" }, "terminal_positions": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "partition": { "type": "integer", "minimum": 0 }, "offset": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$" } }, "required": [ "partition", "offset" ], "additionalProperties": false }, "minItems": 1 }, "completed_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-07-16T12:00:00.000Z" }, "error": { "type": [ "string", "null" ], "maxLength": 200 } }, "required": [ "kind", "channel", "export_key", "delivery_generation", "state", "records", "terminal_positions", "completed_at", "updated_at", "error" ], "additionalProperties": false }, "parts": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer", "minimum": 0 }, "after_cursor": { "type": "string", "minLength": 1, "maxLength": 20 }, "through_cursor": { "type": "string", "minLength": 1, "maxLength": 20 }, "records": { "type": "integer", "minimum": 1 }, "encoded_bytes": { "type": "integer", "minimum": 1 }, "digest": { "type": "string", "minLength": 1, "maxLength": 71 }, "download_url": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 4096 } }, "required": [ "index", "after_cursor", "through_cursor", "records", "encoded_bytes", "digest", "download_url" ], "additionalProperties": false } } }, "required": [ "export_id", "sync_id", "entity", "state", "frontier", "publication_barrier", "progress", "record_count", "digest", "terminal_reason", "parts" ], "additionalProperties": false } ``` ## SyncProviderListResponse ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "display_name": { "type": "string", "minLength": 1, "maxLength": 160 } }, "required": [ "key", "display_name" ], "additionalProperties": false } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## EndpointListResponse Связанные схемы: [EndpointSummary](https://context4.me/docs/api-schemas-4.md#endpointsummary). ```json { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/EndpointSummary" } }, "next_cursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 400, "description": "Cursor for the next page; null when exhausted" } }, "required": [ "data", "next_cursor" ], "additionalProperties": false } ``` ## EndpointSummary ```json { "type": "object", "properties": { "id": { "type": "string", "pattern": "^(?:GET|POST|PUT|PATCH|DELETE|HEAD) \\/[\\x21-\\x7e]{0,240}$", "example": "GET /api/v4/leads/{id}" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "group": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The vendor's own grouping of the endpoint (its spec tag or resource)", "example": "leads" }, "method": { "type": "string", "enum": [ "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD" ] }, "path": { "type": "string", "minLength": 1, "maxLength": 500, "pattern": "^\\/", "example": "/api/v4/leads/{id}" }, "summary": { "type": [ "string", "null" ], "maxLength": 2000 }, "call_url": { "type": "string", "minLength": 1, "maxLength": 600, "description": "The mirror URL that calls this endpoint: `/v1/api/{connectorId}` followed by the vendor path", "example": "/v1/api/amocrm/api/v4/leads/{id}" }, "risk": { "type": "string", "enum": [ "read", "write", "destructive", "external_send" ], "description": "What calling it does to the world, as a floor: read, write, destructive or external_send (reaches a person outside the vendor)" }, "sensitive": { "type": "boolean", "description": "Its schemas name credentials or personal data (a floor)" }, "idempotent": { "type": "boolean" }, "paging_kind": { "type": [ "string", "null" ], "enum": [ "page", "offset", "cursor", "next-link", "header-cursor", "rpc-start", "relay", null ], "description": "How a listing pages, or null when pages cannot be collected from it" }, "descriptor_digest": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$", "description": "sha256 of the endpoint's contract (method, path, schemas, risk, idempotency — not its paging or summary); null only for a row seeded before descriptors existed", "example": "089fed2ebbff74aa8cd059e02cedb06f5fa5044a8e86ff7b457e75a90b8341fa" }, "removed_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z", "description": "When a lock regeneration dropped the endpoint; null while it is live. A removed endpoint is listed only with `include_removed=true`" } }, "required": [ "id", "connector_id", "group", "method", "path", "summary", "call_url" ], "additionalProperties": false } ``` ## EndpointDetail Связанные схемы: [PagingDescriptor](https://context4.me/docs/api-schemas-4.md#pagingdescriptor). ```json { "type": "object", "properties": { "id": { "type": "string", "pattern": "^(?:GET|POST|PUT|PATCH|DELETE|HEAD) \\/[\\x21-\\x7e]{0,240}$", "example": "GET /api/v4/leads/{id}" }, "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "group": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The vendor's own grouping of the endpoint (its spec tag or resource)", "example": "leads" }, "method": { "type": "string", "enum": [ "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD" ] }, "path": { "type": "string", "minLength": 1, "maxLength": 500, "pattern": "^\\/", "example": "/api/v4/leads/{id}" }, "summary": { "type": [ "string", "null" ], "maxLength": 2000 }, "call_url": { "type": "string", "minLength": 1, "maxLength": 600, "description": "The mirror URL that calls this endpoint: `/v1/api/{connectorId}` followed by the vendor path", "example": "/v1/api/amocrm/api/v4/leads/{id}" }, "risk": { "type": "string", "enum": [ "read", "write", "destructive", "external_send" ], "description": "What calling it does to the world, as a floor: read, write, destructive or external_send (reaches a person outside the vendor)" }, "sensitive": { "type": "boolean", "description": "Its schemas name credentials or personal data (a floor)" }, "idempotent": { "type": "boolean" }, "paging_kind": { "type": [ "string", "null" ], "enum": [ "page", "offset", "cursor", "next-link", "header-cursor", "rpc-start", "relay", null ], "description": "How a listing pages, or null when pages cannot be collected from it" }, "descriptor_digest": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$", "description": "sha256 of the endpoint's contract (method, path, schemas, risk, idempotency — not its paging or summary); null only for a row seeded before descriptors existed", "example": "089fed2ebbff74aa8cd059e02cedb06f5fa5044a8e86ff7b457e75a90b8341fa" }, "removed_at": { "type": [ "string", "null" ], "format": "date-time", "example": "2026-07-16T12:00:00.000Z", "description": "When a lock regeneration dropped the endpoint; null while it is live. A removed endpoint is listed only with `include_removed=true`" }, "input_schema": { "description": "JSON Schema of the call input: an object with optional `path`, `query`, `header` and `body` members, self-contained (`$defs` included)" }, "output_schema": {}, "paging": { "$ref": "#/components/schemas/PagingDescriptor" } }, "required": [ "id", "connector_id", "group", "method", "path", "summary", "call_url" ], "additionalProperties": false, "description": "One raw endpoint with its input and (when published) output schema, and its paging descriptor" } ``` ## PagingDescriptor ```json { "type": [ "object", "null" ], "properties": { "kind": { "type": "string", "enum": [ "page", "offset", "cursor", "next-link", "header-cursor", "rpc-start", "relay" ] }, "records": { "type": "string", "maxLength": 500, "description": "Pointer to the records array in the output; `\"\"` is the whole document", "example": "/_embedded/leads" }, "max_page_size": { "type": "integer", "exclusiveMinimum": 0 }, "inputs": { "type": "object", "additionalProperties": { "type": "string", "maxLength": 500, "description": "RFC 6901 JSON pointer into the endpoint's input or output document", "example": "/query/page" }, "description": "Input pointers by role: page, size, cursor, offset, start, first, after" }, "next": { "type": "object", "additionalProperties": { "type": "string", "maxLength": 500 }, "description": "Where the next page is named: output pointers by role (link, cursor, end_cursor, has_next_page) or `header`, a response header name" } }, "required": [ "kind", "records", "max_page_size", "inputs" ], "additionalProperties": false } ``` ## ConnectorOpenApiDocument ```json { "type": "object", "properties": { "openapi": { "type": "string", "enum": [ "3.1.0" ] }, "info": { "type": "object", "additionalProperties": {} }, "servers": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "paths": { "type": "object", "additionalProperties": {} }, "components": { "type": "object", "additionalProperties": {} } }, "required": [ "openapi", "info", "servers", "paths", "components" ], "additionalProperties": {} } ``` ## EndpointSearchResponse Связанные схемы: [EndpointSearchItem](https://context4.me/docs/api-schemas-4.md#endpointsearchitem). ```json { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/EndpointSearchItem" } }, "scope": { "type": "object", "properties": { "connectors": { "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "description": "The connectors the search ran over: those of the caller's usable connections, narrowed by `connectors`. Empty when nothing is usable — then `items` is empty too, never an error" }, "index": { "type": "string", "enum": [ "ratel", "ilike" ] } }, "required": [ "connectors", "index" ], "additionalProperties": false } }, "required": [ "items", "scope" ], "additionalProperties": false } ``` ## EndpointSearchItem ```json { "type": "object", "properties": { "connector_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "endpoint_id": { "type": "string", "pattern": "^(?:GET|POST|PUT|PATCH|DELETE|HEAD) \\/[\\x21-\\x7e]{0,240}$", "example": "GET /api/v4/leads/{id}" }, "method": { "type": "string", "enum": [ "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD" ] }, "path": { "type": "string", "minLength": 1, "maxLength": 500, "pattern": "^\\/", "example": "/api/v4/leads/{id}" }, "summary": { "type": [ "string", "null" ], "maxLength": 2000 }, "group": { "type": "string", "minLength": 1, "maxLength": 64 }, "risk": { "type": "string", "enum": [ "read", "write", "destructive", "external_send" ] }, "sensitive": { "type": "boolean" }, "idempotent": { "type": "boolean" }, "paging_kind": { "type": [ "string", "null" ], "enum": [ "page", "offset", "cursor", "next-link", "header-cursor", "rpc-start", "relay", null ] }, "descriptor_digest": { "type": [ "string", "null" ], "pattern": "^[0-9a-f]{64}$", "description": "sha256 of the endpoint's contract (method, path, schemas, risk, idempotency — not its paging or summary); null only for a row seeded before descriptors existed", "example": "089fed2ebbff74aa8cd059e02cedb06f5fa5044a8e86ff7b457e75a90b8341fa" }, "score": { "type": "number", "minimum": 0, "maximum": 1, "description": "Relevance relative to the best hit of this answer: the top hit is 1, the rest in (0, 1]; a fallback answer scores every hit 1" } }, "required": [ "connector_id", "endpoint_id", "method", "path", "summary", "group", "risk", "sensitive", "idempotent", "paging_kind", "descriptor_digest", "score" ], "additionalProperties": false } ``` ## EndpointSearchRequest ```json { "type": "object", "properties": { "query": { "type": "string", "minLength": 1, "maxLength": 500, "description": "Free text, Russian or English", "example": "list the labels of a repository" }, "connectors": { "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,78}$", "example": "bitrix24" }, "maxItems": 50, "description": "Narrows the scope to these connectors; a connector the caller has no usable connection for is dropped, never added" }, "borrowers": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "maxItems": 200, "description": "The principals whose connections this search may use (exact `end_user_ref` match, never widened). Omitted: every active connection of the API key's workspace", "example": [ "ws_a1b2c3:u_d4e5f6", "ws_a1b2c3:a_workspace" ] }, "limit": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 } }, "required": [ "query" ], "additionalProperties": false } ``` --- # Схемы API: часть 5 Источник: https://context4.me/docs/api-schemas-5 Точные имена полей, required, enum, nullable и ограничения сохранены из [OpenAPI](https://context4.me/docs/openapi.json). `$ref` разрешается относительно `components.schemas` полного документа. Все части: [1](https://context4.me/docs/api-schemas-1.md), [2](https://context4.me/docs/api-schemas-2.md), [3](https://context4.me/docs/api-schemas-3.md), [4](https://context4.me/docs/api-schemas-4.md). ## ConnectorApiBody ```json {} ```