{
  "openapi": "3.1.0",
  "info": {
    "title": "MeridianHub App Store API",
    "description": "API ботов MeridianHub: вызовы бота (/v1/bot/*, auth: Bearer — ключ бота mh_bot_ (основной, один на приложение) или ключ подключения mh_app_), консоль разработчика (/v1/dev/*, auth: юзер-сессия), клиентские эндпоинты подключения и управления подключениями (/v1/chat/...), платформенные ссылки (/v1/chat/platform/bots/*, auth: платформенный токен). С ключом бота установка определяется адресом (conversation_id/message_id) или селектором account_id|external_tenant_ref. Снято с работающего приложения.",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://chat-api.meridianhub.ru"
    }
  ],
  "paths": {
    "/v1/bot/messages": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Send App Message",
        "operationId": "send_app_message_v1_app_messages_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppSendMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "description": "Право: chat:write; с user_id — im:write. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_…."
      }
    },
    "/v1/bot/attachments/upload-url": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Create App Attachment Upload Url",
        "description": "Обратный людскому путь (P3): подготовил файл → отправил. Адрес —\nПОЛНЫМ резолвером (членство бота); пределы размера — общие. Право: files:write. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_….",
        "operationId": "create_app_attachment_upload_url_v1_app_attachments_upload_url_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppUploadUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/bot/conversations": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Create App Conversation",
        "description": "Беседы от приложения (P2): direct (создать-или-вернуть, без\nприветствия) и group (участники места + бот, space_id/visibility,\nнеобязательный ключ). Каналы — своим путём /v1/bot/channels. Право: im:write для direct, channels:manage для group. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_….",
        "operationId": "create_app_conversation_v1_app_conversations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreateConversationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/bot/messages/{message_id}": {
      "patch": {
        "tags": [
          "apps"
        ],
        "summary": "Edit App Message",
        "description": "Правка — ДВА пути (spec rev2): текст/entities идут помеченным путём\n«изменено» (как у людей); только-markup — отдельным готовым путём БЕЗ\nпометки (снятие клавиатуры после нажатия не должно выглядеть правкой). Право: chat:write. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_….",
        "operationId": "edit_app_message_v1_app_messages__message_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Message Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppEditMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "apps"
        ],
        "summary": "Delete App Message",
        "description": "Удаление ТОЛЬКО своих: та же семантика, что у людей (события\nклиентам уходят как обычно); чужое — 404, админ-ветка недостижима. Право: chat:write. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_….",
        "operationId": "delete_app_message_v1_app_messages__message_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Message Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bot/spaces": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Create App Space",
        "operationId": "create_app_space_v1_app_spaces_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreateSpaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/bot/external-links": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Create App External Link",
        "operationId": "create_app_external_link_v1_app_external_links_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreateExternalLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/bot/external-links/{link_id}": {
      "patch": {
        "tags": [
          "apps"
        ],
        "summary": "Update App External Link",
        "description": "Правка СВОЕЙ ссылки (спека rev2 §4): активность, заголовок,\nприветствие, шаблон названия чата, пояснение, предел использований.\nДеактивация через is_active=false — тот же эффект, что отзыв.",
        "operationId": "update_app_external_link_v1_app_external_links__link_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Link Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppUpdateExternalLinkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bot/channels": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Create App Channel",
        "operationId": "create_app_channel_v1_app_channels_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreateChannelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "description": "Право: channels:manage. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_…."
      }
    },
    "/v1/bot/mini-app": {
      "get": {
        "tags": [
          "apps"
        ],
        "summary": "Get App Mini App",
        "operationId": "get_app_mini_app_v1_app_mini_app_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "apps"
        ],
        "summary": "Patch App Mini App",
        "operationId": "patch_app_mini_app_v1_app_mini_app_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppMiniAppPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/bot/instance": {
      "get": {
        "tags": [
          "apps"
        ],
        "summary": "Get App Instance",
        "operationId": "get_app_instance_v1_app_instance_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "apps"
        ],
        "summary": "Patch App Instance",
        "operationId": "patch_app_instance_v1_app_instance_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppInstancePatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/chat/bot-links/{token}": {
      "get": {
        "tags": [
          "apps-client"
        ],
        "summary": "Get App Card",
        "description": "ПУБЛИЧНАЯ карточка — без auth, ничьих установок не отдаёт.",
        "operationId": "get_app_card_v1_chat_apps__token__get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/bot-links/{token}/connect": {
      "post": {
        "tags": [
          "apps-client"
        ],
        "summary": "Install App",
        "operationId": "install_app_v1_chat_apps__token__install_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/accounts/{account_id}/bot-instances": {
      "get": {
        "tags": [
          "apps-client"
        ],
        "summary": "List Account App Instances",
        "operationId": "list_account_app_instances_v1_chat_accounts__account_id__app_instances_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Account Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/bot-instances/{instance_id}": {
      "patch": {
        "tags": [
          "apps-client"
        ],
        "summary": "Patch App Instance Settings",
        "operationId": "patch_app_instance_settings_v1_chat_app_instances__instance_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstancePatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "apps-client"
        ],
        "summary": "Uninstall App Instance",
        "operationId": "uninstall_app_instance_v1_chat_app_instances__instance_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/bot-instances/{instance_id}/reconsent": {
      "post": {
        "tags": [
          "apps-client"
        ],
        "summary": "Reconsent App Instance",
        "description": "fix round 4.3: переподтверждение прав — granted := requested корня.\n\nФаза 1 без частичного выбора: согласие целиком, баннер гаснет.\nFOR UPDATE — чтобы гонка с изменением скоупов корня не оставила\nполусостояние (needs_reconsent=False при старых granted).",
        "operationId": "reconsent_app_instance_v1_chat_app_instances__instance_id__reconsent_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/bot-instances/{instance_id}/reset-mini-app": {
      "post": {
        "tags": [
          "apps-client"
        ],
        "summary": "Reset App Instance Mini App",
        "operationId": "reset_app_instance_mini_app_v1_chat_app_instances__instance_id__reset_mini_app_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots": {
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "List Dev Roots",
        "operationId": "list_dev_roots_v1_dev_roots_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Create Dev Root",
        "operationId": "create_dev_root_v1_dev_roots_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevRootCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/dev/bots/{root_id}": {
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Get Dev Root",
        "operationId": "get_dev_root_v1_dev_roots__root_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Patch Dev Root",
        "operationId": "patch_dev_root_v1_dev_roots__root_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DevRootPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/rotate-webhook-secret": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Rotate Root Webhook Secret",
        "description": "Единственный секрет корня — webhook_secret (им подписываются и\nдоставки, и данные запуска мини-приложения); отдельного root_secret\nв модели нет, ротация одна.",
        "operationId": "rotate_root_webhook_secret_v1_dev_roots__root_id__rotate_webhook_secret_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateSecretRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/connect-links": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Create Connect Link",
        "operationId": "create_connect_link_v1_dev_roots__root_id__connect_links_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ConnectLinkCreateRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "List Connect Links",
        "operationId": "list_connect_links_v1_dev_roots__root_id__connect_links_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/connect-links/{link_id}/revoke": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Revoke Connect Link",
        "operationId": "revoke_connect_link_v1_dev_roots__root_id__connect_links__link_id__revoke_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Link Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/instances": {
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "List Root Instances",
        "operationId": "list_root_instances_v1_dev_roots__root_id__instances_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/instances/{instance_id}/block": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Block Instance",
        "operationId": "block_instance_v1_dev_roots__root_id__instances__instance_id__block_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/instances/{instance_id}/unblock": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Unblock Instance",
        "operationId": "unblock_instance_v1_dev_roots__root_id__instances__instance_id__unblock_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/webhook-deliveries": {
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "List Webhook Deliveries",
        "operationId": "list_webhook_deliveries_v1_dev_roots__root_id__webhook_deliveries_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/webhook-deliveries/{delivery_id}/replay": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Replay Webhook Delivery",
        "operationId": "replay_webhook_delivery_v1_dev_roots__root_id__webhook_deliveries__delivery_id__replay_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Delivery Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/api-calls": {
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "List Api Calls",
        "operationId": "list_api_calls_v1_dev_roots__root_id__api_calls_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dev/bots/{root_id}/self-install": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Self Install",
        "description": "«Установить себе»: без ссылки, юзер — админ ОБОИХ (корня и цели).\nТот же install-оркестратор: одна транзакция, бот, ключ, событие installed. Согласие — целиком (все запрошенные права).",
        "operationId": "self_install_v1_dev_roots__root_id__self_install_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfInstallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/system/bots/{root_id}/block": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Platform Block Root",
        "operationId": "platform_block_root_v1_chat_system_app_roots__root_id__block_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/system/bots/{root_id}/unblock": {
      "post": {
        "tags": [
          "apps-dev"
        ],
        "summary": "Platform Unblock Root",
        "operationId": "platform_unblock_root_v1_chat_system_app_roots__root_id__unblock_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/platform/bots/{root_id}/connect-links": {
      "post": {
        "tags": [
          "platform-integrations"
        ],
        "summary": "Platform Issue App Connect Link",
        "operationId": "platform_issue_app_connect_link_v1_chat_platform_app_roots__root_id__connect_links_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformConnectLinkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "platform-integrations"
        ],
        "summary": "Platform List App Connect Links",
        "operationId": "platform_list_app_connect_links_v1_chat_platform_app_roots__root_id__connect_links_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/platform/bots/{root_id}/connect-links/{link_id}/revoke": {
      "post": {
        "tags": [
          "platform-integrations"
        ],
        "summary": "Platform Revoke App Connect Link",
        "operationId": "platform_revoke_app_connect_link_v1_chat_platform_app_roots__root_id__connect_links__link_id__revoke_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Root Id"
            }
          },
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Link Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bot/connections": {
      "get": {
        "tags": [
          "apps"
        ],
        "summary": "List App Connections",
        "description": "Все подключения бота. Ключ бота видит все установки приложения; ключ подключения — своё одно. Сценарий сверки: пропустили bot.connected или пришёл незнакомый instance_id — перечитайте список. Предел 500 строк (has_more).",
        "operationId": "list_app_connections_v1_bot_connections_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "instance_id": {
                            "type": "string"
                          },
                          "container": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "account",
                                  "user"
                                ]
                              },
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Название эккаунта; null у персональной установки."
                              }
                            }
                          },
                          "external_tenant_ref": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "granted_scopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "installed_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "bot": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "user_id": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "display_name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "botKey": []
          },
          {
            "instanceKey": []
          }
        ]
      }
    },
    "/v1/dev/bots/{root_id}/rotate-api-key": {
      "post": {
        "tags": [
          "dev"
        ],
        "summary": "Rotate Root Api Key",
        "description": "Выпуск (для старых ботов) и замена ключа бота mh_bot_. planned=true — старый ключ работает ещё час; false — гаснет немедленно. Ключ в ответе показывается один раз.",
        "operationId": "rotate_root_api_key_v1_dev_bots__root_id__rotate_api_key_post",
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "planned": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "api_key": {
                      "type": "string",
                      "description": "Ключ бота mh_bot_… — один раз."
                    },
                    "planned": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/v1/bot/conversations/{conversation_id}/members": {
      "post": {
        "tags": [
          "apps"
        ],
        "summary": "Add App Group Members",
        "description": "Добавить участников места в свою группу бота. Право: channels:manage. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_….",
        "operationId": "add_app_group_members",
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Conversation Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppGroupMembersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/bot/conversations/{conversation_id}/members/{user_id}": {
      "delete": {
        "tags": [
          "apps"
        ],
        "summary": "Remove App Group Member",
        "description": "Убрать человека из своей группы бота. Повтор безопасен. Право: channels:manage. Ключ подключения (mh_app_… или xoxb-…) или ключ приложения mh_bot_….",
        "operationId": "remove_app_group_member",
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Conversation Id"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/dev/scopes": {
      "get": {
        "tags": [
          "apps-dev"
        ],
        "summary": "List Scopes",
        "operationId": "list_scopes",
        "description": "Каталог прав приложения с подписями. Один список для /v1/bot/* и /slack/api/*. Прежний адрес /v1/dev/slack-scopes отдаёт то же.",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "scope": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AppCreateChannelRequest": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: эккаунт подключения. Взаимоисключим с external_tenant_ref."
          },
          "external_tenant_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: метка клиента разработчика."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "key",
          "title"
        ],
        "title": "AppCreateChannelRequest"
      },
      "AppCreateConversationRequest": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type"
          },
          "user_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "User Ids",
            "default": []
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "space_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Space Id"
          },
          "visibility": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: эккаунт подключения. Взаимоисключим с external_tenant_ref."
          },
          "external_tenant_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: метка клиента разработчика."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type"
        ],
        "title": "AppCreateConversationRequest"
      },
      "AppCreateExternalLinkRequest": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "link_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link Type"
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "chat_title_template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Title Template"
          },
          "welcome_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Welcome Message"
          },
          "auto_start": {
            "type": "boolean",
            "title": "Auto Start",
            "default": true
          },
          "auto_members": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Members"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: эккаунт подключения. Взаимоисключим с external_tenant_ref."
          },
          "external_tenant_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: метка клиента разработчика."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title"
        ],
        "title": "AppCreateExternalLinkRequest"
      },
      "AppCreateSpaceRequest": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "visibility": {
            "type": "string",
            "title": "Visibility",
            "default": "restricted"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: эккаунт подключения. Взаимоисключим с external_tenant_ref."
          },
          "external_tenant_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: метка клиента разработчика."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title"
        ],
        "title": "AppCreateSpaceRequest"
      },
      "AppEditMessageRequest": {
        "properties": {
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "entities": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entities"
          },
          "reply_markup": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply Markup"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "AppEditMessageRequest"
      },
      "AppInstancePatchRequest": {
        "properties": {
          "external_tenant_ref": {
            "type": "string",
            "title": "External Tenant Ref"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "external_tenant_ref"
        ],
        "title": "AppInstancePatchRequest"
      },
      "AppMiniAppPatchRequest": {
        "properties": {
          "launch_url_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Launch Url Override"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "AppMiniAppPatchRequest"
      },
      "AppSendMessageRequest": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "channel_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Key"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "reply_markup": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply Markup"
          },
          "entities": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entities"
          },
          "parse_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parse Mode"
          },
          "reply_to_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply To Id"
          },
          "client_message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Message Id"
          },
          "attachments": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attachments"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: эккаунт подключения. Взаимоисключим с external_tenant_ref."
          },
          "external_tenant_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: метка клиента разработчика."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text"
        ],
        "title": "AppSendMessageRequest"
      },
      "AppUpdateExternalLinkRequest": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "welcome_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Welcome Message"
          },
          "chat_title_template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Title Template"
          },
          "invite_explanation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invite Explanation"
          },
          "max_uses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Uses"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "AppUpdateExternalLinkRequest",
        "description": "Правка своей ссылки (райдер паритета). Набор — представление и\nжизненный цикл, как у платформенного PATCH; структурные поля\n(mode/link_type/conversation_id/space_id/bot_id/auto_members/…) не\nвыставлены осознанно: auto_members спекой запрещены приложению, а\nостальное меняет устройство ссылки и задаётся при создании."
      },
      "AppUploadUrlRequest": {
        "properties": {
          "conversation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "channel_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Key"
          },
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "file_size": {
            "type": "integer",
            "title": "File Size"
          },
          "mime_type": {
            "type": "string",
            "title": "Mime Type"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: эккаунт подключения. Взаимоисключим с external_tenant_ref."
          },
          "external_tenant_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Селектор установки для ключа бота: метка клиента разработчика."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "file_name",
          "file_size",
          "mime_type"
        ],
        "title": "AppUploadUrlRequest"
      },
      "ConnectLinkCreateRequest": {
        "properties": {
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ConnectLinkCreateRequest"
      },
      "DevRootCreateRequest": {
        "properties": {
          "account_id": {
            "type": "string",
            "title": "Account Id"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "base_username": {
            "type": "string",
            "title": "Base Username"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "visibility": {
            "type": "string",
            "title": "Visibility",
            "default": "by_link"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          },
          "allowed_updates": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Updates"
          },
          "requested_scopes": {
            "items": {},
            "type": "array",
            "title": "Requested Scopes",
            "default": []
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "about": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "About"
          },
          "privacy_mode": {
            "type": "boolean",
            "title": "Privacy Mode",
            "default": true
          },
          "commands": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commands"
          },
          "auto_start_enabled": {
            "type": "boolean",
            "title": "Auto Start Enabled",
            "default": false
          },
          "auto_start_command": {
            "type": "string",
            "title": "Auto Start Command",
            "default": "/start"
          },
          "join_groups_enabled": {
            "type": "boolean",
            "title": "Join Groups Enabled",
            "default": true
          },
          "guest_dm_enabled": {
            "type": "boolean",
            "title": "Guest Dm Enabled",
            "default": false
          },
          "miniapp_launch_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Launch Url"
          },
          "miniapp_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Title"
          },
          "miniapp_icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Icon Url"
          },
          "miniapp_open_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Open Mode"
          },
          "miniapp_display_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Display Mode"
          },
          "miniapp_capabilities": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Capabilities"
          },
          "miniapp_require_write_access": {
            "type": "boolean",
            "title": "Miniapp Require Write Access",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "account_id",
          "slug",
          "name",
          "base_username",
          "display_name"
        ],
        "title": "DevRootCreateRequest"
      },
      "DevRootPatchRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "visibility": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          },
          "allowed_updates": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Updates"
          },
          "requested_scopes": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Scopes"
          },
          "base_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Username"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "about": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "About"
          },
          "privacy_mode": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Privacy Mode"
          },
          "commands": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commands"
          },
          "auto_start_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Start Enabled"
          },
          "auto_start_command": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Start Command"
          },
          "join_groups_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Join Groups Enabled"
          },
          "guest_dm_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Guest Dm Enabled"
          },
          "miniapp_launch_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Launch Url"
          },
          "miniapp_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Title"
          },
          "miniapp_icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Icon Url"
          },
          "miniapp_open_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Open Mode"
          },
          "miniapp_display_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Display Mode"
          },
          "miniapp_capabilities": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Capabilities"
          },
          "miniapp_require_write_access": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Miniapp Require Write Access"
          },
          "unfurl_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "maxItems": 5
              },
              {
                "type": "null"
              }
            ],
            "title": "Unfurl Domains",
            "description": "Режим Slack. Домены приложения для link_shared: до 5 хостов, без IP и запрещённых доменов. У приложения, прошедшего проверку магазина, действует одобренный список."
          },
          "slack_events_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slack Events Url",
            "description": "Адрес событий Slack (link_shared, app_uninstalled). При сохранении — url_verification."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DevRootPatchRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InstallContainer": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type"
          },
          "id": {
            "type": "string",
            "title": "Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "title": "InstallContainer"
      },
      "InstallRequest": {
        "properties": {
          "container": {
            "$ref": "#/components/schemas/InstallContainer"
          },
          "granted_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Granted Scopes",
            "default": []
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "container"
        ],
        "title": "InstallRequest"
      },
      "InstancePatchRequest": {
        "properties": {
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "display_name_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name Override"
          },
          "avatar_url_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url Override"
          },
          "description_for_members": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description For Members"
          },
          "auto_greet_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Greet Enabled"
          },
          "guest_dm_override": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Guest Dm Override"
          },
          "join_groups_override": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Join Groups Override"
          },
          "directory_visible": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Directory Visible"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "InstancePatchRequest"
      },
      "PlatformConnectLinkRequest": {
        "properties": {
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PlatformConnectLinkRequest"
      },
      "RotateSecretRequest": {
        "properties": {
          "planned": {
            "type": "boolean",
            "title": "Planned",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RotateSecretRequest"
      },
      "SelfInstallRequest": {
        "properties": {
          "account_id": {
            "type": "string",
            "title": "Account Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "account_id"
        ],
        "title": "SelfInstallRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "AppGroupMembersRequest": {
        "properties": {
          "user_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "User Ids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_ids"
        ],
        "title": "AppGroupMembersRequest"
      }
    },
    "securitySchemes": {
      "instanceKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Ключ подключения mh_app_… (/v1/bot/*)."
      },
      "userSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "JWT юзер-сессии (/v1/dev/*, /v1/chat/*)."
      },
      "platformToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Платформенный токен mh_pl_… (/v1/chat/platform/*)."
      },
      "botKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Ключ бота mh_bot_… — один на приложение, выдаётся при создании в консоли (показ один раз, ротация /v1/dev/bots/{root_id}/rotate-api-key)."
      },
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer-ключ вызова бота: ключ бота mh_bot_ (основной) или ключ подключения mh_app_."
      }
    }
  }
}
