{
  "openapi": "3.1.0",
  "info": {
    "title": "whapi — WhatsApp API",
    "version": "1.0.2",
    "summary": "HTTP API к WhatsApp на Baileys, совместимое по путям с whapi.cloud",
    "description": "Описание собирается из реального набора маршрутов работающей сборки, поэтому\nсоответствует развёрнутой версии. Аутентификация — API-ключ.\n\nКороткая версия для агентов: https://whapi.xpertnet.ai/llms.txt, полная: https://whapi.xpertnet.ai/llms-full.txt"
  },
  "servers": [
    {
      "url": "https://whapi.xpertnet.ai"
    }
  ],
  "tags": [
    {
      "name": "analytics",
      "description": "Аналитика сообщений"
    },
    {
      "name": "backups",
      "description": "Резервные копии данных"
    },
    {
      "name": "business",
      "description": "Бизнес-профиль"
    },
    {
      "name": "channels",
      "description": "Каналы: создание, подключение по QR или коду, статус, вебхуки, прокси, диагностика"
    },
    {
      "name": "chats",
      "description": "Чаты: список, архив, закрепление, отметка о прочтении"
    },
    {
      "name": "communities",
      "description": "Сообщества"
    },
    {
      "name": "contacts",
      "description": "Контакты, проверка номеров, блокировки"
    },
    {
      "name": "groups",
      "description": "Группы и участники"
    },
    {
      "name": "labels",
      "description": "Метки чатов"
    },
    {
      "name": "media",
      "description": "Загрузка и скачивание медиа"
    },
    {
      "name": "messages",
      "description": "Отправка сообщений всех типов и операции над ними"
    },
    {
      "name": "newsletters",
      "description": "Каналы WhatsApp (newsletters)"
    },
    {
      "name": "presences",
      "description": "Присутствие и статус «печатает…»"
    },
    {
      "name": "stories",
      "description": "Статусы (истории)"
    },
    {
      "name": "system",
      "description": "Служебные: здоровье, метрики, документация"
    },
    {
      "name": "users",
      "description": "Профиль подключённого аккаунта"
    },
    {
      "name": "webhooks",
      "description": "Вебхуки: мониторинг доставки, DLQ, песочница"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key"
      }
    }
  },
  "security": [
    {
      "apiKeyHeader": []
    }
  ],
  "paths": {
    "/analytics/by-hour": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get hourly distribution",
        "operationId": "get_analytics_by_hour",
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Filter by channel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/analytics/by-weekday": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get weekday distribution",
        "operationId": "get_analytics_by_weekday",
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Filter by channel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/analytics/channels": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get per-channel stats",
        "operationId": "get_analytics_channels",
        "responses": {
          "200": {
            "description": "[{ channelId, name, today, week, total }]"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/analytics/daily": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get daily message counts",
        "operationId": "get_analytics_daily",
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Filter by channel"
                  },
                  "days": {
                    "type": "number",
                    "description": "Number of days",
                    "example": 7
                  }
                }
              }
            }
          }
        }
      }
    },
    "/analytics/hourly": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "List hourly",
        "operationId": "get_analytics_hourly",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/analytics/overview": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get analytics overview",
        "operationId": "get_analytics_overview",
        "responses": {
          "200": {
            "description": "{ totalMessages, sentMessages, receivedMessages, todayMessages }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Filter by channel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/analytics/trends": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get message trends",
        "operationId": "get_analytics_trends",
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "number",
                    "description": "Days to analyze",
                    "example": 14
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backups": {
      "get": {
        "tags": [
          "backups"
        ],
        "summary": "Backup schedule, storage usage and list of archives",
        "operationId": "get_backups",
        "responses": {
          "200": {
            "description": "{ success, enabled, retentionDays, hour, dir, count, totalSizeBytes, lastBackupAt, nextRunAt, backups: [{ name, sizeBytes, createdAt, preRestore }] }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "enabled": true,
                  "retentionDays": 7,
                  "count": 2,
                  "backups": [
                    {
                      "name": "whapi-20260906T030000Z.tar.gz",
                      "sizeBytes": 254331,
                      "createdAt": 1788653000000,
                      "preRestore": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "x-curl-example": "curl -H \"X-API-Key: $KEY\" http://localhost:3005/backups"
      },
      "post": {
        "tags": [
          "backups"
        ],
        "summary": "Create a backup right now (whapi.db snapshot + channels.json) and prune expired ones",
        "operationId": "post_backups",
        "responses": {
          "200": {
            "description": "{ success, backup: { name, sizeBytes, createdAt }, pruned: string[] }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "backup": {
                    "name": "whapi-20260906T131500Z.tar.gz",
                    "sizeBytes": 254331
                  },
                  "pruned": []
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "x-curl-example": "curl -X POST -H \"X-API-Key: $KEY\" http://localhost:3005/backups"
      }
    },
    "/backups/{name}": {
      "delete": {
        "tags": [
          "backups"
        ],
        "summary": "Delete a backup archive",
        "operationId": "delete_backups_name_",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, deleted }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/backups/{name}/download": {
      "get": {
        "tags": [
          "backups"
        ],
        "summary": "Download a backup archive (.tar.gz)",
        "operationId": "get_backups_name_download",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "application/gzip stream"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "x-curl-example": "curl -H \"X-API-Key: $KEY\" -O -J http://localhost:3005/backups/whapi-20260906T030000Z.tar.gz/download"
      }
    },
    "/backups/{name}/restore": {
      "post": {
        "tags": [
          "backups"
        ],
        "summary": "Restore data from a backup stored on the server. Channels disconnect, data is replaced, channels reconnect. A pre-restore snapshot is taken automatically",
        "operationId": "post_backups_name_restore",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ success, source, manifest, safetyBackup }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "safetyBackup": "whapi-pre-restore-20260906T131500Z.tar.gz"
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "x-curl-example": "curl -X POST -H \"X-API-Key: $KEY\" http://localhost:3005/backups/whapi-20260906T030000Z.tar.gz/restore"
      }
    },
    "/backups/restore": {
      "post": {
        "tags": [
          "backups"
        ],
        "summary": "Upload an archive (raw body, application/octet-stream) and restore from it",
        "operationId": "post_backups_restore",
        "responses": {
          "200": {
            "description": "{ success, source: \"upload\", sizeBytes, manifest, safetyBackup }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "x-curl-example": "curl -X POST -H \"X-API-Key: $KEY\" -H \"Content-Type: application/octet-stream\" --data-binary @whapi-20260906T030000Z.tar.gz http://localhost:3005/backups/restore"
      }
    },
    "/business/categories": {
      "get": {
        "tags": [
          "business"
        ],
        "summary": "Get available business categories",
        "operationId": "get_business_categories",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ categories: [...] }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/business/profile": {
      "get": {
        "tags": [
          "business"
        ],
        "summary": "Get business profile",
        "operationId": "get_business_profile",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ description, email, websites[], address, category }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "business"
        ],
        "summary": "Update business profile",
        "operationId": "patch_business_profile",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "description": {
                    "type": "string",
                    "description": "Business description"
                  },
                  "email": {
                    "type": "string",
                    "description": "Business email"
                  },
                  "website": {
                    "type": "string",
                    "description": "Website URL"
                  },
                  "address": {
                    "type": "string",
                    "description": "Business address"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/channels": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get list of all channels",
        "operationId": "get_channels",
        "responses": {
          "200": {
            "description": "{ success: true, data: Channel[] }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "channel-123",
                      "name": "Sales",
                      "status": "connected",
                      "phone": "79991234567"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "x-curl-example": "curl -H \"X-API-Key: $KEY\" http://localhost:3005/channels"
      },
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Create a new channel",
        "operationId": "post_channels",
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "id": "channel-123",
                    "name": "Sales"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Channel name",
                    "example": "Sales Team"
                  },
                  "department": {
                    "type": "string",
                    "description": "Department name",
                    "example": "Sales"
                  },
                  "autoConnect": {
                    "type": "boolean",
                    "description": "Auto-connect on startup",
                    "example": true
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "x-curl-example": "curl -X POST -H \"X-API-Key: $KEY\" -d '{\"name\":\"Sales\"}' http://localhost:3005/channels"
      }
    },
    "/channels/{id}": {
      "delete": {
        "tags": [
          "channels"
        ],
        "summary": "Delete channel and disconnect session",
        "operationId": "delete_channels_id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get channel details",
        "operationId": "get_channels_id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            },
            "example": "channel-123"
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "channels"
        ],
        "summary": "Update channel",
        "operationId": "put_channels_id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name"
                  },
                  "department": {
                    "type": "string",
                    "description": "New department"
                  },
                  "autoConnect": {
                    "type": "boolean",
                    "description": "Auto-connect setting"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/channels/{id}/auto-connect": {
      "put": {
        "tags": [
          "channels"
        ],
        "summary": "Update auto connect",
        "operationId": "put_channels_id_auto_connect",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/auto-download": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List auto download",
        "operationId": "get_channels_id_auto_download",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "channels"
        ],
        "summary": "Update auto download",
        "operationId": "put_channels_id_auto_download",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/chats": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get all chats for channel",
        "operationId": "get_channels_id_chats",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/chats/{chatId}/messages": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get messages from chat",
        "operationId": "get_channels_id_chats_chatId_messages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chatId",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            },
            "example": "79991234567@s.whatsapp.net"
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "type": "number",
                    "description": "Max messages",
                    "example": 50
                  },
                  "offset": {
                    "type": "number",
                    "description": "Skip N messages",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    },
    "/channels/{id}/chats/{chatId}/messages/search": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List search",
        "operationId": "get_channels_id_chats_chatId_messages_search",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/connect": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Start connection (generates QR code)",
        "operationId": "post_channels_id_connect",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ success: true, status: \"qr\", qr: \"base64...\" }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/connect-phone": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Connect via phone number (pairing code)",
        "operationId": "post_channels_id_connect_phone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ success: true, pairingCode: \"ABCD-1234\" }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phoneNumber": {
                    "type": "string",
                    "description": "Phone number with country code",
                    "example": "+79991234567"
                  }
                },
                "required": [
                  "phoneNumber"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/contacts/{phone}/block": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Block contacts",
        "operationId": "post_channels_id_contacts_phone_block",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/contacts/{phone}/unblock": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Unblock contacts",
        "operationId": "post_channels_id_contacts_phone_unblock",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/contacts/blocked": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List blocked",
        "operationId": "get_channels_id_contacts_blocked",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/contacts/check": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Create check",
        "operationId": "post_channels_id_contacts_check",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/diagnostics": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List diagnostics",
        "operationId": "get_channels_id_diagnostics",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/disconnect": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Disconnect session (keeps auth)",
        "operationId": "post_channels_id_disconnect",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/groups": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List groups",
        "operationId": "get_channels_id_groups",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/lid-mappings": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List lid mappings",
        "operationId": "get_channels_id_lid_mappings",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/logout": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Logout and delete session",
        "operationId": "post_channels_id_logout",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/messages/contact": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send vCard contact",
        "operationId": "post_channels_id_messages_contact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient"
                  },
                  "contact.fullName": {
                    "type": "string",
                    "description": "Contact name",
                    "example": "John Doe"
                  },
                  "contact.phone": {
                    "type": "string",
                    "description": "Contact phone",
                    "example": "+79991234567"
                  }
                },
                "required": [
                  "to",
                  "contact.fullName",
                  "contact.phone"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/messages/document": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send document/file",
        "operationId": "post_channels_id_messages_document",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient"
                  },
                  "media": {
                    "type": "string",
                    "description": "URL or base64 file"
                  },
                  "filename": {
                    "type": "string",
                    "description": "File name",
                    "example": "report.pdf"
                  },
                  "mimetype": {
                    "type": "string",
                    "description": "MIME type",
                    "example": "application/pdf"
                  }
                },
                "required": [
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/messages/forward": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Forward messages",
        "operationId": "post_channels_id_messages_forward",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/messages/image": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send image message",
        "operationId": "post_channels_id_messages_image",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient phone or JID",
                    "example": "79991234567"
                  },
                  "media": {
                    "type": "string",
                    "description": "URL or base64 image",
                    "example": "https://example.com/image.jpg"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Image caption"
                  }
                },
                "required": [
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/messages/location": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send location",
        "operationId": "post_channels_id_messages_location",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient"
                  },
                  "latitude": {
                    "type": "number",
                    "description": "Latitude",
                    "example": 55.7558
                  },
                  "longitude": {
                    "type": "number",
                    "description": "Longitude",
                    "example": 37.6173
                  },
                  "name": {
                    "type": "string",
                    "description": "Location name",
                    "example": "Moscow"
                  },
                  "address": {
                    "type": "string",
                    "description": "Address",
                    "example": "Red Square"
                  }
                },
                "required": [
                  "to",
                  "latitude",
                  "longitude"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/messages/queue": {
      "delete": {
        "tags": [
          "channels"
        ],
        "summary": "Delete queue",
        "operationId": "delete_channels_id_messages_queue",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List queue",
        "operationId": "get_channels_id_messages_queue",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/messages/send": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send messages",
        "operationId": "post_channels_id_messages_send",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/messages/send-immediate": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send message immediately (bypasses queue)",
        "operationId": "post_channels_id_messages_send_immediate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone": {
                    "type": "string",
                    "description": "Recipient phone",
                    "example": "79991234567"
                  },
                  "message": {
                    "type": "string",
                    "description": "Message text",
                    "example": "Hello!"
                  }
                },
                "required": [
                  "phone",
                  "message"
                ]
              }
            }
          }
        },
        "x-curl-example": "curl -X POST -H \"X-API-Key: $KEY\" -d '{\"phone\":\"79991234567\",\"message\":\"Hi!\"}' http://localhost:3005/channels/ch-1/messages/send-immediate"
      }
    },
    "/channels/{id}/messages/stats": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List stats",
        "operationId": "get_channels_id_messages_stats",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/messages/video": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Send video message",
        "operationId": "post_channels_id_messages_video",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient"
                  },
                  "media": {
                    "type": "string",
                    "description": "URL or base64 video"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Video caption"
                  }
                },
                "required": [
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/pairing-code": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List pairing code",
        "operationId": "get_channels_id_pairing_code",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/proxy": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List proxy",
        "operationId": "get_channels_id_proxy",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "channels"
        ],
        "summary": "Update proxy",
        "operationId": "put_channels_id_proxy",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/proxy/test": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Test proxy",
        "operationId": "post_channels_id_proxy_test",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/qr": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get QR code as base64 JSON",
        "operationId": "get_channels_id_qr",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ success: true, qr: \"data:image/png;base64,...\" }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/qr/image": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get QR code as PNG image",
        "operationId": "get_channels_id_qr_image",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "image/png"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/resolve-lids": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Resolve lids channels",
        "operationId": "post_channels_id_resolve_lids",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/status": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "Get connection status",
        "operationId": "get_channels_id_status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ status: \"connected\" | \"disconnected\" | \"connecting\" | \"qr\" }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/webhooks": {
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List webhooks of the channel",
        "operationId": "get_channels_id_webhooks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Add a webhook to the channel",
        "operationId": "post_channels_id_webhooks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Channel ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Webhook URL",
                    "example": "https://example.com/webhook"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Events to receive",
                    "example": [
                      "message.received",
                      "message.sent"
                    ]
                  },
                  "secret": {
                    "type": "string",
                    "description": "HMAC secret for signing"
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Enable webhook",
                    "example": true
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          }
        }
      }
    },
    "/channels/{id}/webhooks/{webhookId}": {
      "delete": {
        "tags": [
          "channels"
        ],
        "summary": "Delete webhooks",
        "operationId": "delete_channels_id_webhooks_webhookId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "channels"
        ],
        "summary": "Update webhooks",
        "operationId": "put_channels_id_webhooks_webhookId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/webhooks/{webhookId}/disable": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Disable webhooks",
        "operationId": "post_channels_id_webhooks_webhookId_disable",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/webhooks/{webhookId}/enable": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Enable webhooks",
        "operationId": "post_channels_id_webhooks_webhookId_enable",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/webhooks/{webhookId}/test": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Test webhooks",
        "operationId": "post_channels_id_webhooks_webhookId_test",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/webhooks/dlq": {
      "delete": {
        "tags": [
          "channels"
        ],
        "summary": "Delete dlq",
        "operationId": "delete_channels_id_webhooks_dlq",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "channels"
        ],
        "summary": "List dlq",
        "operationId": "get_channels_id_webhooks_dlq",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/channels/{id}/webhooks/dlq/replay": {
      "post": {
        "tags": [
          "channels"
        ],
        "summary": "Replay dlq",
        "operationId": "post_channels_id_webhooks_dlq_replay",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/chats": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "Get all chats",
        "operationId": "get_chats",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID (query param)"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}": {
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Delete chat",
        "operationId": "delete_chats_chatId_",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "Get chat info",
        "operationId": "get_chats_chatId_",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/archive": {
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Unarchive chat",
        "operationId": "delete_chats_chatId_archive",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Archive chat",
        "operationId": "post_chats_chatId_archive",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/messages": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "List messages",
        "operationId": "get_chats_chatId_messages",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/chats/{chatId}/messages/search": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "List search",
        "operationId": "get_chats_chatId_messages_search",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/chats/{chatId}/mute": {
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Unmute chat",
        "operationId": "delete_chats_chatId_mute",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Mute chat notifications",
        "operationId": "post_chats_chatId_mute",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "duration": {
                    "type": "number",
                    "description": "Mute duration (seconds)",
                    "example": 86400
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/pin": {
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Unpin chat",
        "operationId": "delete_chats_chatId_pin",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Pin chat",
        "operationId": "post_chats_chatId_pin",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/read": {
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Mark chat as read",
        "operationId": "post_chats_chatId_read",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/communities": {
      "get": {
        "tags": [
          "communities"
        ],
        "summary": "Get all communities",
        "operationId": "get_communities",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "communities"
        ],
        "summary": "Create communities",
        "operationId": "post_communities",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/communities/{communityId}": {
      "get": {
        "tags": [
          "communities"
        ],
        "summary": "Get community details",
        "operationId": "get_communities_communityId_",
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Community JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/communities/{communityId}/groups": {
      "get": {
        "tags": [
          "communities"
        ],
        "summary": "List groups",
        "operationId": "get_communities_communityId_groups",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "post": {
        "tags": [
          "communities"
        ],
        "summary": "Create groups",
        "operationId": "post_communities_communityId_groups",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/communities/{communityId}/groups/{groupId}": {
      "delete": {
        "tags": [
          "communities"
        ],
        "summary": "Delete groups",
        "operationId": "delete_communities_communityId_groups_groupId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/contacts": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Get all contacts",
        "operationId": "get_contacts",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID (query param)"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "contacts"
        ],
        "summary": "Update contacts",
        "operationId": "put_contacts",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/contacts/{contactId}": {
      "delete": {
        "tags": [
          "contacts"
        ],
        "summary": "Delete contacts",
        "operationId": "delete_contacts_contactId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Get contacts",
        "operationId": "get_contacts_contactId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "patch": {
        "tags": [
          "contacts"
        ],
        "summary": "Update contacts",
        "operationId": "patch_contacts_contactId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/contacts/{contactId}/block": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Block a contact",
        "operationId": "post_contacts_contactId_block",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": true,
            "description": "Phone number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}/profile": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Get contact profile picture & status",
        "operationId": "get_contacts_contactId_profile",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": true,
            "description": "Phone number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}/unblock": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Unblock a contact",
        "operationId": "post_contacts_contactId_unblock",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": true,
            "description": "Phone number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/contacts/blocked": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Get blocked contacts",
        "operationId": "get_contacts_blocked",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/contacts/check": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Check if phones have WhatsApp",
        "operationId": "post_contacts_check",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "phone": "79991234567",
                      "exists": true,
                      "jid": "79991234567@s.whatsapp.net"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "phones": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Phone numbers to check",
                    "example": [
                      "79991234567",
                      "79997654321"
                    ]
                  }
                },
                "required": [
                  "channelId",
                  "phones"
                ]
              }
            }
          }
        },
        "x-curl-example": "curl -X POST -d '{\"channelId\":\"ch-1\",\"phones\":[\"79991234567\"]}' http://localhost:3005/contacts/check"
      }
    },
    "/docs": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "API documentation page (HTML, no auth)",
        "operationId": "get_docs",
        "responses": {
          "200": {
            "description": "HTML documentation page"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": []
      }
    },
    "/groups": {
      "get": {
        "tags": [
          "groups"
        ],
        "summary": "Get all groups",
        "operationId": "get_groups",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID (query param)"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "groups"
        ],
        "summary": "Create new group",
        "operationId": "post_groups",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "name": {
                    "type": "string",
                    "description": "Group name",
                    "example": "My Group"
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Initial members",
                    "example": [
                      "79991234567"
                    ]
                  }
                },
                "required": [
                  "channelId",
                  "name",
                  "participants"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/{groupId}": {
      "delete": {
        "tags": [
          "groups"
        ],
        "summary": "Leave group",
        "operationId": "delete_groups_groupId_",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "groups"
        ],
        "summary": "Get group info and members",
        "operationId": "get_groups_groupId_",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "groups"
        ],
        "summary": "Update group name/description",
        "operationId": "patch_groups_groupId_",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "name": {
                    "type": "string",
                    "description": "New group name"
                  },
                  "description": {
                    "type": "string",
                    "description": "New description"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/{groupId}/icon": {
      "delete": {
        "tags": [
          "groups"
        ],
        "summary": "Delete icon",
        "operationId": "delete_groups_groupId_icon",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "groups"
        ],
        "summary": "List icon",
        "operationId": "get_groups_groupId_icon",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "groups"
        ],
        "summary": "Update icon",
        "operationId": "put_groups_groupId_icon",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/groups/{groupId}/invite": {
      "get": {
        "tags": [
          "groups"
        ],
        "summary": "Get group invite link",
        "operationId": "get_groups_groupId_invite",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/{groupId}/invite/revoke": {
      "post": {
        "tags": [
          "groups"
        ],
        "summary": "Revoke invite link (generate new)",
        "operationId": "post_groups_groupId_invite_revoke",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/{groupId}/participants": {
      "delete": {
        "tags": [
          "groups"
        ],
        "summary": "Remove participants from group",
        "operationId": "delete_groups_groupId_participants",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Phone numbers to remove"
                  }
                },
                "required": [
                  "channelId",
                  "participants"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "groups"
        ],
        "summary": "List participants",
        "operationId": "get_groups_groupId_participants",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "post": {
        "tags": [
          "groups"
        ],
        "summary": "Add participants to group",
        "operationId": "post_groups_groupId_participants",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Phone numbers to add"
                  }
                },
                "required": [
                  "channelId",
                  "participants"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/{groupId}/participants/demote": {
      "post": {
        "tags": [
          "groups"
        ],
        "summary": "Demote admins to members",
        "operationId": "post_groups_groupId_participants_demote",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Phone numbers to demote"
                  }
                },
                "required": [
                  "channelId",
                  "participants"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/{groupId}/participants/promote": {
      "post": {
        "tags": [
          "groups"
        ],
        "summary": "Promote members to admin",
        "operationId": "post_groups_groupId_participants_promote",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Group JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Phone numbers to promote"
                  }
                },
                "required": [
                  "channelId",
                  "participants"
                ]
              }
            }
          }
        }
      }
    },
    "/groups/join": {
      "post": {
        "tags": [
          "groups"
        ],
        "summary": "Join groups",
        "operationId": "post_groups_join",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/health": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Health check (no auth required)",
        "operationId": "get_health",
        "responses": {
          "200": {
            "description": "{ status, timestamp, database, redis, channels, auth }"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": []
      }
    },
    "/health/details": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List details",
        "operationId": "get_health_details",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/labels": {
      "get": {
        "tags": [
          "labels"
        ],
        "summary": "Get all labels",
        "operationId": "get_labels",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "labels"
        ],
        "summary": "Create label",
        "operationId": "post_labels",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "name": {
                    "type": "string",
                    "description": "Label name",
                    "example": "VIP"
                  },
                  "color": {
                    "type": "number",
                    "description": "Color index (0-20)",
                    "example": 1
                  }
                },
                "required": [
                  "channelId",
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/labels/{labelId}": {
      "delete": {
        "tags": [
          "labels"
        ],
        "summary": "Delete label",
        "operationId": "delete_labels_labelId_",
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Label ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "labels"
        ],
        "summary": "Get labels",
        "operationId": "get_labels_labelId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/labels/{labelId}/chats": {
      "get": {
        "tags": [
          "labels"
        ],
        "summary": "List chats",
        "operationId": "get_labels_labelId_chats",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "post": {
        "tags": [
          "labels"
        ],
        "summary": "Add chat to label",
        "operationId": "post_labels_labelId_chats",
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Label ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Chat JID"
                  }
                },
                "required": [
                  "channelId",
                  "chatId"
                ]
              }
            }
          }
        }
      }
    },
    "/labels/{labelId}/chats/{chatId}": {
      "delete": {
        "tags": [
          "labels"
        ],
        "summary": "Remove chat from label",
        "operationId": "delete_labels_labelId_chats_chatId_",
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Label ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chatId",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List llms full.txt",
        "operationId": "get_llms_full_txt",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": []
      }
    },
    "/llms.txt": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List llms.txt",
        "operationId": "get_llms_txt",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": []
      }
    },
    "/media/{mediaId}": {
      "delete": {
        "tags": [
          "media"
        ],
        "summary": "Delete media",
        "operationId": "delete_media_mediaId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "media"
        ],
        "summary": "Download media by ID",
        "operationId": "get_media_mediaId_",
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Media ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/media/{mediaId}/info": {
      "get": {
        "tags": [
          "media"
        ],
        "summary": "List info",
        "operationId": "get_media_mediaId_info",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/media/from-url": {
      "post": {
        "tags": [
          "media"
        ],
        "summary": "Create from url",
        "operationId": "post_media_from_url",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/media/upload": {
      "post": {
        "tags": [
          "media"
        ],
        "summary": "Upload media file (multipart/form-data)",
        "operationId": "post_media_upload",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ mediaId, url, mimetype }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "file": {
                    "type": "string",
                    "description": "File to upload (multipart)"
                  }
                },
                "required": [
                  "channelId",
                  "file"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/{chatId}/typing": {
      "delete": {
        "tags": [
          "messages"
        ],
        "summary": "Untyping messages",
        "operationId": "delete_messages_chatId_typing",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Typing messages",
        "operationId": "post_messages_chatId_typing",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/messages/{id}/media": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "List media",
        "operationId": "get_messages_id_media",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/messages/{messageId}": {
      "delete": {
        "tags": [
          "messages"
        ],
        "summary": "Delete message",
        "operationId": "delete_messages_messageId_",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Message ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Chat JID"
                  },
                  "forEveryone": {
                    "type": "boolean",
                    "description": "Delete for everyone",
                    "example": true
                  }
                },
                "required": [
                  "channelId",
                  "chatId"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/pin": {
      "delete": {
        "tags": [
          "messages"
        ],
        "summary": "Unpin message",
        "operationId": "delete_messages_messageId_pin",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Message ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Chat JID"
                  }
                },
                "required": [
                  "channelId",
                  "chatId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Pin message",
        "operationId": "post_messages_messageId_pin",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Message ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Chat JID"
                  },
                  "duration": {
                    "type": "number",
                    "description": "Pin duration (seconds)",
                    "example": 86400
                  }
                },
                "required": [
                  "channelId",
                  "chatId"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/react": {
      "delete": {
        "tags": [
          "messages"
        ],
        "summary": "Delete react",
        "operationId": "delete_messages_messageId_react",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "messages"
        ],
        "summary": "Update react",
        "operationId": "put_messages_messageId_react",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/messages/{messageId}/reaction": {
      "delete": {
        "tags": [
          "messages"
        ],
        "summary": "Unreaction messages",
        "operationId": "delete_messages_messageId_reaction",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "messages"
        ],
        "summary": "React to message with emoji",
        "operationId": "put_messages_messageId_reaction",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Message ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Chat JID"
                  },
                  "emoji": {
                    "type": "string",
                    "description": "Emoji reaction",
                    "example": "👍"
                  }
                },
                "required": [
                  "channelId",
                  "chatId",
                  "emoji"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/read": {
      "put": {
        "tags": [
          "messages"
        ],
        "summary": "Read messages",
        "operationId": "put_messages_messageId_read",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/messages/{messageId}/star": {
      "put": {
        "tags": [
          "messages"
        ],
        "summary": "Star/unstar message",
        "operationId": "put_messages_messageId_star",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Message ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Chat JID"
                  },
                  "star": {
                    "type": "boolean",
                    "description": "Star status",
                    "example": true
                  }
                },
                "required": [
                  "channelId",
                  "chatId",
                  "star"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/audio": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send audio file",
        "operationId": "post_messages_audio",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "Audio URL or base64"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/contact": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send vCard contact",
        "operationId": "post_messages_contact",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "contact": {
                    "type": "object",
                    "description": "Contact object { fullName, phone }"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "contact"
                ]
              }
            }
          }
        },
        "x-curl-example": "curl -X POST -d '{\"channelId\":\"ch-1\",\"to\":\"79991234567\",\"contact\":{\"fullName\":\"John\",\"phone\":\"+123456\"}}' http://localhost:3005/messages/contact"
      }
    },
    "/messages/contact-list": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send multiple contacts",
        "operationId": "post_messages_contact_list",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "contacts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of { fullName, phone }"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "contacts"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/document": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send document/file",
        "operationId": "post_messages_document",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "File URL or base64"
                  },
                  "filename": {
                    "type": "string",
                    "description": "Filename",
                    "example": "report.pdf"
                  },
                  "mimetype": {
                    "type": "string",
                    "description": "MIME type"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/forward": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Forward message to recipients",
        "operationId": "post_messages_forward",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "chatId": {
                    "type": "string",
                    "description": "Source chat JID"
                  },
                  "messageId": {
                    "type": "string",
                    "description": "Message ID to forward"
                  },
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Recipients array",
                    "example": [
                      "79991234567",
                      "79997654321"
                    ]
                  }
                },
                "required": [
                  "channelId",
                  "chatId",
                  "messageId",
                  "to"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/gif": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send animated GIF",
        "operationId": "post_messages_gif",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "GIF/MP4 URL or base64"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/image": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send image",
        "operationId": "post_messages_image",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "Image URL or base64",
                    "example": "https://example.com/photo.jpg"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Image caption"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/link-preview": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send URL with link preview",
        "operationId": "post_messages_link_preview",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "url": {
                    "type": "string",
                    "description": "URL to send",
                    "example": "https://example.com"
                  },
                  "title": {
                    "type": "string",
                    "description": "Link title"
                  },
                  "description": {
                    "type": "string",
                    "description": "Link description"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "url"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/list": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get all messages",
        "operationId": "get_messages_list",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID (query param)"
                  },
                  "limit": {
                    "type": "number",
                    "description": "Max messages",
                    "example": 50
                  },
                  "offset": {
                    "type": "number",
                    "description": "Skip count",
                    "example": 0
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/list/{chatId}": {
      "get": {
        "tags": [
          "messages"
        ],
        "summary": "Get messages from specific chat",
        "operationId": "get_messages_list_chatId_",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chatId",
            "in": "query",
            "required": true,
            "description": "Chat JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "limit": {
                    "type": "number",
                    "description": "Max messages"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/live-location": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send live location",
        "operationId": "post_messages_live_location",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "latitude": {
                    "type": "number",
                    "description": "Latitude"
                  },
                  "longitude": {
                    "type": "number",
                    "description": "Longitude"
                  },
                  "duration": {
                    "type": "number",
                    "description": "Duration in seconds",
                    "example": 3600
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "latitude",
                  "longitude"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/location": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send location",
        "operationId": "post_messages_location",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "latitude": {
                    "type": "number",
                    "description": "Latitude",
                    "example": 55.7558
                  },
                  "longitude": {
                    "type": "number",
                    "description": "Longitude",
                    "example": 37.6173
                  },
                  "name": {
                    "type": "string",
                    "description": "Location name"
                  },
                  "address": {
                    "type": "string",
                    "description": "Address text"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "latitude",
                  "longitude"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/poll": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send poll",
        "operationId": "post_messages_poll",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "question": {
                    "type": "string",
                    "description": "Poll question",
                    "example": "What is your choice?"
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Poll options",
                    "example": [
                      "Option A",
                      "Option B",
                      "Option C"
                    ]
                  },
                  "multiSelect": {
                    "type": "boolean",
                    "description": "Allow multiple answers",
                    "example": false
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "question",
                  "options"
                ]
              }
            }
          }
        },
        "x-curl-example": "curl -X POST -d '{\"channelId\":\"ch-1\",\"to\":\"799...\",\"question\":\"Rate?\",\"options\":[\"1\",\"2\",\"3\",\"4\",\"5\"]}' http://localhost:3005/messages/poll"
      }
    },
    "/messages/send-immediate": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Create send immediate",
        "operationId": "post_messages_send_immediate",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/messages/short": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send PTV (video note/circle)",
        "operationId": "post_messages_short",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "Video URL or base64"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/sticker": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send sticker",
        "operationId": "post_messages_sticker",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "WebP sticker URL or base64"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/text": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send text message (whapi.cloud compatible)",
        "operationId": "post_messages_text",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "messageId": "BAE5123..."
                }
              }
            }
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID (or X-Channel-Id header)"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone",
                    "example": "79991234567"
                  },
                  "body": {
                    "type": "string",
                    "description": "Message text",
                    "example": "Hello World!"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "body"
                ]
              }
            }
          }
        },
        "x-curl-example": "curl -X POST -H \"X-API-Key: $KEY\" -d '{\"channelId\":\"ch-1\",\"to\":\"79991234567\",\"body\":\"Hello!\"}' http://localhost:3005/messages/text"
      }
    },
    "/messages/video": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send video",
        "operationId": "post_messages_video",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "Video URL or base64"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Video caption"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/messages/voice": {
      "post": {
        "tags": [
          "messages"
        ],
        "summary": "Send voice message (PTT)",
        "operationId": "post_messages_voice",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient phone"
                  },
                  "media": {
                    "type": "string",
                    "description": "OGG audio URL or base64"
                  }
                },
                "required": [
                  "channelId",
                  "to",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/metrics": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List metrics",
        "operationId": "get_metrics",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/monitoring/alerts": {
      "delete": {
        "tags": [
          "system"
        ],
        "summary": "Delete alerts",
        "operationId": "delete_monitoring_alerts",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List alerts",
        "operationId": "get_monitoring_alerts",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/monitoring/alerts/{id}/acknowledge": {
      "post": {
        "tags": [
          "system"
        ],
        "summary": "Create acknowledge",
        "operationId": "post_monitoring_alerts_id_acknowledge",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/monitoring/alerts/acknowledge-all": {
      "post": {
        "tags": [
          "system"
        ],
        "summary": "Create acknowledge all",
        "operationId": "post_monitoring_alerts_acknowledge_all",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/monitoring/alerts/critical": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List critical",
        "operationId": "get_monitoring_alerts_critical",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/monitoring/alerts/stats": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List stats",
        "operationId": "get_monitoring_alerts_stats",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/newsletters": {
      "get": {
        "tags": [
          "newsletters"
        ],
        "summary": "Get subscribed newsletters/channels",
        "operationId": "get_newsletters",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "newsletters"
        ],
        "summary": "Create newsletter",
        "operationId": "post_newsletters",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "name": {
                    "type": "string",
                    "description": "Newsletter name"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description"
                  }
                },
                "required": [
                  "channelId",
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/newsletters/{newsletterId}": {
      "get": {
        "tags": [
          "newsletters"
        ],
        "summary": "Get newsletters",
        "operationId": "get_newsletters_newsletterId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "newsletterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/newsletters/{newsletterId}/messages": {
      "post": {
        "tags": [
          "newsletters"
        ],
        "summary": "Send message to newsletter",
        "operationId": "post_newsletters_newsletterId_messages",
        "parameters": [
          {
            "name": "newsletterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Newsletter JID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "text": {
                    "type": "string",
                    "description": "Text message"
                  },
                  "media": {
                    "type": "string",
                    "description": "Media URL or base64"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/newsletters/{newsletterId}/subscribe": {
      "post": {
        "tags": [
          "newsletters"
        ],
        "summary": "Create subscribe",
        "operationId": "post_newsletters_newsletterId_subscribe",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "newsletterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/newsletters/{newsletterId}/unsubscribe": {
      "post": {
        "tags": [
          "newsletters"
        ],
        "summary": "Create unsubscribe",
        "operationId": "post_newsletters_newsletterId_unsubscribe",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "newsletterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "List openapi.json",
        "operationId": "get_openapi_json",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": []
      }
    },
    "/presences/{contactId}": {
      "get": {
        "tags": [
          "presences"
        ],
        "summary": "Get presences",
        "operationId": "get_presences_contactId_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/presences/{contactId}/subscribe": {
      "post": {
        "tags": [
          "presences"
        ],
        "summary": "Create subscribe",
        "operationId": "post_presences_contactId_subscribe",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/presences/me": {
      "put": {
        "tags": [
          "presences"
        ],
        "summary": "Update me",
        "operationId": "put_presences_me",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/settings": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Get API documentation (JSON)",
        "operationId": "get_settings",
        "responses": {
          "200": {
            "description": "Full API documentation object"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/stories": {
      "get": {
        "tags": [
          "stories"
        ],
        "summary": "Get status stories",
        "operationId": "get_stories",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "stories"
        ],
        "summary": "Create stories",
        "operationId": "post_stories",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/stories/{storyId}": {
      "delete": {
        "tags": [
          "stories"
        ],
        "summary": "Delete story",
        "operationId": "delete_stories_storyId_",
        "parameters": [
          {
            "name": "storyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Story ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/stories/audio": {
      "post": {
        "tags": [
          "stories"
        ],
        "summary": "Create audio",
        "operationId": "post_stories_audio",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/stories/image": {
      "post": {
        "tags": [
          "stories"
        ],
        "summary": "Post image story",
        "operationId": "post_stories_image",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "media": {
                    "type": "string",
                    "description": "Image URL or base64"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption"
                  }
                },
                "required": [
                  "channelId",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/stories/media": {
      "post": {
        "tags": [
          "stories"
        ],
        "summary": "Create media",
        "operationId": "post_stories_media",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/stories/text": {
      "post": {
        "tags": [
          "stories"
        ],
        "summary": "Post text story",
        "operationId": "post_stories_text",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "text": {
                    "type": "string",
                    "description": "Story text",
                    "example": "Hello World!"
                  },
                  "backgroundColor": {
                    "type": "string",
                    "description": "Background color",
                    "example": "#FF5733"
                  },
                  "font": {
                    "type": "number",
                    "description": "Font type (0-5)",
                    "example": 0
                  }
                },
                "required": [
                  "channelId",
                  "text"
                ]
              }
            }
          }
        }
      }
    },
    "/stories/video": {
      "post": {
        "tags": [
          "stories"
        ],
        "summary": "Post video story",
        "operationId": "post_stories_video",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "media": {
                    "type": "string",
                    "description": "Video URL or base64"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Caption"
                  }
                },
                "required": [
                  "channelId",
                  "media"
                ]
              }
            }
          }
        }
      }
    },
    "/test-webhook/{token}": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create test webhook",
        "operationId": "post_test_webhook_token_",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": []
      }
    },
    "/test-webhook/requests": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List requests",
        "operationId": "get_test_webhook_requests",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/test-webhook/send": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Send test webhook",
        "operationId": "post_test_webhook_send",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/users": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Get own profile",
        "operationId": "get_users",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ name, status, picture }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "Update profile",
        "operationId": "patch_users",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name"
                  },
                  "status": {
                    "type": "string",
                    "description": "About text"
                  }
                },
                "required": [
                  "channelId"
                ]
              }
            }
          }
        }
      }
    },
    "/users/name": {
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Update name",
        "operationId": "put_users_name",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/users/picture": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Delete picture",
        "operationId": "delete_users_picture",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Update profile picture",
        "operationId": "put_users_picture",
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channelId": {
                    "type": "string",
                    "description": "Channel ID"
                  },
                  "image": {
                    "type": "string",
                    "description": "Image URL or base64"
                  }
                },
                "required": [
                  "channelId",
                  "image"
                ]
              }
            }
          }
        }
      }
    },
    "/users/status": {
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Update status",
        "operationId": "put_users_status",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Идентификатор канала. Обязателен, если каналов несколько; альтернатива — заголовок X-Channel-Id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Channel-Id",
            "in": "header",
            "required": false,
            "description": "Идентификатор канала вместо query-параметра channelId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/all-webhooks": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List all webhooks",
        "operationId": "get_webhook_monitor_all_webhooks",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/deliveries": {
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "Delete deliveries",
        "operationId": "delete_webhook_monitor_deliveries",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List deliveries",
        "operationId": "get_webhook_monitor_deliveries",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/dlq": {
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "Delete dlq",
        "operationId": "delete_webhook_monitor_dlq",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      },
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List dlq",
        "operationId": "get_webhook_monitor_dlq",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/dlq/{id}/retry": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create retry",
        "operationId": "post_webhook_monitor_dlq_id_retry",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/dlq/retry-all": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create retry all",
        "operationId": "post_webhook_monitor_dlq_retry_all",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/stats": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List stats",
        "operationId": "get_webhook_monitor_stats",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/test-webhook": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create test webhook",
        "operationId": "post_webhook_monitor_test_webhook",
        "x-generated-summary": true,
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    },
    "/webhook-monitor/webhook/{channelId}/{webhookId}/toggle": {
      "patch": {
        "tags": [
          "webhooks"
        ],
        "summary": "Update toggle",
        "operationId": "patch_webhook_monitor_webhook_channelId_webhookId_toggle",
        "x-generated-summary": true,
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ: { success: true, ... }"
          },
          "401": {
            "description": "Ключ не передан"
          },
          "403": {
            "description": "Неверный ключ"
          },
          "429": {
            "description": "Превышен лимит запросов"
          }
        },
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          },
          {
            "apiKeyQuery": []
          }
        ]
      }
    }
  }
}