{
  "openapi": "3.1.0",
  "info": {
    "title": "Adapt Mail API",
    "version": "0.16.0",
    "description": "API для работы с почтовыми ящиками, письмами, файлами и контактами. Управление подпиской доступно в личном кабинете, где вы подключили почту."
  },
  "paths": {
    "/v1/auth/login": {
      "post": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Вход в браузере",
        "operationId": "login_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mailbox_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Маршрут предназначен для adapt-mail.com и требует Origin: https://adapt-mail.com. Возвращает HttpOnly cookies и несекретный session_id. Для своего клиента используйте /v1/auth/token.",
        "security": []
      }
    },
    "/v1/auth/token": {
      "post": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Получение токена пользователя",
        "operationId": "token_v1_auth_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string",
                      "const": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "const": 3600
                    },
                    "mailbox_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Выдаёт токен доступа на один час по логину и паролю. Укажите mode=account для доступа ко всем ящикам аккаунта или mode=mailbox для доступа к одному адресу. Передавайте access_token в заголовке Authorization: Bearer <access_token>.",
        "security": []
      }
    },
    "/v1/auth/sessions": {
      "get": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Сохранённые входы",
        "operationId": "sessions_v1_auth_sessions_get",
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "session_id": {
                        "type": "string"
                      },
                      "mailbox_id": {
                        "anyOf": [
                          {
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "email": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "login": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Требуется cookie mail_browser. X-API-Key и Bearer не заменяют эту cookie. Без cookie возвращается пустой список.",
        "security": [
          {
            "Browser": []
          }
        ]
      }
    },
    "/v1/auth/logout": {
      "post": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Выход из сессии",
        "operationId": "logout_v1_auth_logout_post",
        "security": [
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "logged_out": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Только пользовательская сессия. Отзывает выбранный вход; остальные входы сохраняются."
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Профиль пользователя",
        "operationId": "me_v1_me_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "quota_mb": {
                      "type": "integer"
                    },
                    "mailbox_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "auth_type": {
                      "type": "string"
                    },
                    "login": {
                      "type": "string"
                    },
                    "is_admin": {
                      "type": "boolean"
                    },
                    "files_enabled": {
                      "type": "boolean"
                    },
                    "service_managed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает профиль текущего почтового аккаунта. Используйте его для отображения имени и логина пользователя в своём приложении."
      }
    },
    "/v1/avatars/{domain}": {
      "get": {
        "tags": [
          "Логотипы доменов"
        ],
        "summary": "Логотип домена",
        "operationId": "avatar_v1_avatars__domain__get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Domain"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Логотип подготавливается"
          },
          "204": {
            "description": "Логотип отсутствует"
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "200 — изображение; 202 — подготовка, повтор через Retry-After; 204 — логотип отсутствует; 503 — временная ошибка. Логотип не подтверждает личность отправителя."
      }
    },
    "/v1/domains": {
      "get": {
        "tags": [
          "Домены и ящики"
        ],
        "summary": "Список доменов",
        "operationId": "list_domains_v1_domains_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Domain"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Доступны собственные домены и общий домен для создания личного адреса."
      }
    },
    "/v1/domains/{domain_id}/dns": {
      "get": {
        "tags": [
          "Домены и ящики"
        ],
        "summary": "DNS-записи домена",
        "operationId": "domain_dns_v1_domains__domain_id__dns_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Domain Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain_id": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "observed": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "matches": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Инструкции содержат точные DNS-значения и результат проверки, но не меняют DNS автоматически."
      }
    },
    "/v1/mailboxes": {
      "get": {
        "tags": [
          "Домены и ящики"
        ],
        "summary": "Список ящиков и расход лимитов",
        "operationId": "list_mailboxes_v1_mailboxes_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mailbox"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Список ящиков ограничен владельцем либо единственным ящиком пользовательской сессии."
      }
    },
    "/v1/mailboxes/{mailbox_id}": {
      "patch": {
        "tags": [
          "Домены и ящики"
        ],
        "summary": "Настройки почтового ящика",
        "operationId": "update_mailbox_v1_mailboxes__mailbox_id__patch",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailboxUpdate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "Некорректный заголовок или идентификатор",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Через /v1 можно менять name, password и signature. Общая квота quota_mb меняется через панель хостинга. Отдельной квоты для файлов нет. Idempotency-Key необязателен, но рекомендуется для повторов."
      }
    },
    "/v1/mailboxes/{mailbox_id}/folders": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Папки и счётчики",
        "operationId": "folders_v1_mailboxes__mailbox_id__folders_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "flags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "total": {
                        "type": "integer"
                      },
                      "unread": {
                        "type": "integer"
                      },
                      "uidvalidity": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает список папок, количество писем total, количество непрочитанных unread и значение uidvalidity для каждой папки. Используйте имя папки и uidvalidity в запросах к её письмам."
      },
      "post": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Создание папки",
        "operationId": "create_folder_v1_mailboxes__mailbox_id__folders_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NameInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Пользовательская папка создаётся в IMAP и доступна другим почтовым клиентам."
      }
    },
    "/v1/mailboxes/{mailbox_id}/messages": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Список писем",
        "operationId": "messages_v1_mailboxes__mailbox_id__messages_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "folder",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "INBOX",
              "title": "Folder"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200,
              "default": "",
              "title": "Q"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessageSummary"
                      }
                    },
                    "next_before": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "uidvalidity": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает до 40 писем, от новых UID к старым. Для следующей страницы передайте next_before как before. При next_before=null страниц больше нет. Чтение не устанавливает флаг прочтения."
      }
    },
    "/v1/mailboxes/{mailbox_id}/messages/{uid}": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Содержимое письма",
        "operationId": "message_v1_mailboxes__mailbox_id__messages__uid__get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          },
          {
            "name": "uidvalidity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uidvalidity"
            }
          },
          {
            "name": "folder",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "INBOX",
              "title": "Folder"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Передавайте folder, uidvalidity и uid из списка писем. HTML очищен, внешние изображения не включаются. Чтобы отметить письмо прочитанным, выполните отдельное действие read."
      }
    },
    "/v1/mailboxes/{mailbox_id}/messages/actions": {
      "post": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Действия с письмами",
        "operationId": "action_v1_mailboxes__mailbox_id__messages_actions_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Применяет действие к выбранным письмам одной папки. Передайте их идентификаторы в uids, имя папки в folder и её uidvalidity. Для action=move также укажите целевую папку в destination."
      }
    },
    "/v1/mailboxes/{mailbox_id}/messages/{uid}/eml": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Скачать письмо в EML",
        "operationId": "export_eml_v1_mailboxes__mailbox_id__messages__uid__eml_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          },
          {
            "name": "uidvalidity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uidvalidity"
            }
          },
          {
            "name": "folder",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "INBOX",
              "title": "Folder"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "message/rfc822": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает исходные MIME-байты с заголовками и вложениями. Не меняет прочитанность. PDF создаётся в браузере через печать; отдельного PDF-маршрута нет."
      }
    },
    "/v1/mailboxes/{mailbox_id}/messages/{uid}/attachments/{index}": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Скачать вложение",
        "operationId": "attachment_v1_mailboxes__mailbox_id__messages__uid__attachments__index__get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Index"
            }
          },
          {
            "name": "uidvalidity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uidvalidity"
            }
          },
          {
            "name": "folder",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "INBOX",
              "title": "Folder"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          },
          {
            "name": "preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pdf"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-File-Scan": {
                "schema": {
                  "type": "string"
                }
              },
              "X-File-Scanned-At": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик."
      }
    },
    "/v1/mailboxes/{mailbox_id}/send": {
      "post": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Отправить письмо",
        "operationId": "send_v1_mailboxes__mailbox_id__send_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "Некорректный заголовок или идентификатор",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Превышен размер",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Обязателен Idempotency-Key длиной 8–128 символов. Повтор с тем же ключом и телом возвращает ту же операцию; другое тело даёт 409. HTTP 202 означает постановку в очередь. Проверяйте состояние операции, а не факт получения ответа."
      }
    },
    "/v1/operations": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Список операций",
        "operationId": "operations_v1_operations_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Operation"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает последние 100 операций. Сессия отдельного ящика видит только его операции."
      }
    },
    "/v1/operations/{operation_id}": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Состояние операции",
        "operationId": "operation_v1_operations__operation_id__get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Operation Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает текущее состояние операции по её id. Пока status равен queued или running, операция не завершена. После завершения проверьте result при успехе или error при ошибке."
      }
    },
    "/v1/operations/{operation_id}/cancel": {
      "post": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Отменить отправку",
        "operationId": "cancel_v1_operations__operation_id__cancel_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Operation Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cancelled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Отменяет отправку письма, пока операция находится в состоянии queued. Если отправка уже началась, завершилась или была отменена, возвращается 409. Отозвать уже отправленное письмо этим методом нельзя."
      }
    },
    "/v1/operations/{operation_id}/retry": {
      "post": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Повторить операцию",
        "operationId": "retry_operation_v1_operations__operation_id__retry_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Operation Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Повторно запускает применение правил отправителей: kind=sender_rules, status=failed. Отправку писем повторить этим методом нельзя. Для неподходящего состояния возвращается 409; повтор создания и настройки ящика через этот метод недоступен и возвращает 403."
      }
    },
    "/v1/mailboxes/{mailbox_id}/drafts/{draft_id}": {
      "put": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Сохранить черновик",
        "operationId": "save_draft_v1_mailboxes__mailbox_id__drafts__draft_id__put",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Draft Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DraftInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Создаёт или обновляет черновик по draft_id. Для нового черновика сгенерируйте UUID; при последующих сохранениях используйте тот же идентификатор. Черновик можно продолжить с другого устройства после входа в тот же ящик."
      },
      "delete": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Удалить черновик",
        "operationId": "delete_draft_v1_mailboxes__mailbox_id__drafts__draft_id__delete",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Draft Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Удаление черновика не влияет на уже поставленное в очередь письмо."
      }
    },
    "/v1/mailboxes/{mailbox_id}/drafts": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Список черновиков",
        "operationId": "drafts_v1_mailboxes__mailbox_id__drafts_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "mailbox_id": {
                        "type": "integer"
                      },
                      "data": {
                        "$ref": "#/components/schemas/DraftInput"
                      },
                      "created_at": {
                        "type": "string",
                        "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
                      },
                      "updated_at": {
                        "type": "string",
                        "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает до 100 черновиков, от новых к старым."
      }
    },
    "/v1/mailboxes/{mailbox_id}/threads": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Список диалогов",
        "operationId": "threads_v1_mailboxes__mailbox_id__threads_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "thread_id": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string",
                        "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
                      },
                      "messages": {
                        "type": "integer"
                      },
                      "unread": {
                        "type": "integer"
                      },
                      "senders": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "subject": {
                        "type": "string"
                      },
                      "sender": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает до 100 диалогов, начиная с недавно обновлённых. Письма из папок Trash и Junk не включаются в список. Новое письмо может появиться с небольшой задержкой; повторите запрос, чтобы обновить список."
      }
    },
    "/v1/mailboxes/{mailbox_id}/threads/{thread_id}": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Письма диалога",
        "operationId": "thread_v1_mailboxes__mailbox_id__threads__thread_id__get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Thread Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает до 100 писем выбранного диалога, от старых к новым. Передайте thread_id из списка диалогов. Письма, которые уже удалены или больше недоступны, в ответ не включаются."
      }
    },
    "/v1/mailboxes/{mailbox_id}/sender-rules": {
      "put": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Правило отправителя",
        "operationId": "sender_rule_v1_mailboxes__mailbox_id__sender_rules_put",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SenderRule"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Создаёт или обновляет правило для адреса sender. Укажите action=spam, чтобы направлять новые письма отправителя в спам, или action=allow, чтобы разрешить его письма. Правило применяется к будущим входящим письмам."
      },
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Список правил отправителей",
        "operationId": "rules_v1_mailboxes__mailbox_id__sender_rules_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "mailbox_id": {
                        "type": "integer"
                      },
                      "sender": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "spam",
                          "allow"
                        ]
                      },
                      "created_at": {
                        "type": "string",
                        "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает правила отправителей для выбранного ящика. Каждое правило содержит адрес sender, действие action и идентификатор id для последующего удаления."
      }
    },
    "/v1/mailboxes/{mailbox_id}/sender-rules/{rule_id}": {
      "delete": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Удалить правило отправителя",
        "operationId": "delete_rule_v1_mailboxes__mailbox_id__sender_rules__rule_id__delete",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Rule Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Удаляет правило отправителя по rule_id. Последующие письма обрабатываются общими правилами почты. Уже полученные письма остаются в своих папках."
      }
    },
    "/v1/mailboxes/{mailbox_id}/contacts": {
      "get": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Список контактов",
        "operationId": "contacts_v1_mailboxes__mailbox_id__contacts_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает до 1000 контактов, отсортированных по имени."
      },
      "post": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Сохранить контакт",
        "operationId": "add_contact_v1_mailboxes__mailbox_id__contacts_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Сохраняет имя и адрес контакта в выбранном ящике. Если контакт с таким email уже существует, обновляет его имя без создания дубликата."
      }
    },
    "/v1/mailboxes/{mailbox_id}/contacts/{contact_id}": {
      "delete": {
        "tags": [
          "Почтовый ящик"
        ],
        "summary": "Удалить контакт",
        "operationId": "remove_contact_v1_mailboxes__mailbox_id__contacts__contact_id__delete",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Contact Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Удаление контакта не удаляет письма."
      }
    },
    "/v1/mailboxes/{mailbox_id}/files": {
      "get": {
        "tags": [
          "Файлы"
        ],
        "summary": "Список файлов",
        "operationId": "files_v1_mailboxes__mailbox_id__files_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "filename": {
                        "type": "string"
                      },
                      "content_type": {
                        "type": "string"
                      },
                      "size_bytes": {
                        "type": "integer"
                      },
                      "created_at": {
                        "type": "string",
                        "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Возвращает до 1000 готовых файлов выбранного ящика."
      },
      "post": {
        "tags": [
          "Файлы"
        ],
        "summary": "Загрузить файл",
        "operationId": "upload_v1_mailboxes__mailbox_id__files_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_v1_mailboxes__mailbox_id__files_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Превышен размер",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "multipart/form-data, поле file. Размер от 1 байта до 25 МиБ. Антивирус проверяет файл до загрузки. Недостаток квоты даёт 409, превышение размера — 413, обнаруженная угроза — 422, недоступная проверка — 503."
      }
    },
    "/v1/mailboxes/{mailbox_id}/files/{file_id}/download": {
      "get": {
        "tags": [
          "Файлы"
        ],
        "summary": "Скачать файл",
        "operationId": "download_v1_mailboxes__mailbox_id__files__file_id__download_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-File-Scan": {
                "schema": {
                  "type": "string"
                }
              },
              "X-File-Scanned-At": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Ответ содержит байты файла с Content-Disposition: attachment. Ссылка требует авторизации при каждом запросе; публичный URL хранилища не выдаётся."
      }
    },
    "/v1/mailboxes/{mailbox_id}/files/{file_id}/content": {
      "get": {
        "tags": [
          "Файлы"
        ],
        "summary": "Содержимое файла",
        "operationId": "content_v1_mailboxes__mailbox_id__files__file_id__content_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          },
          {
            "name": "preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pdf"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-File-Scan": {
                "schema": {
                  "type": "string"
                }
              },
              "X-File-Scanned-At": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик."
      }
    },
    "/v1/mailboxes/{mailbox_id}/files/{file_id}": {
      "delete": {
        "tags": [
          "Файлы"
        ],
        "summary": "Удалить файл",
        "operationId": "remove_v1_mailboxes__mailbox_id__files__file_id__delete",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Файл незавершённой отправки удалить нельзя: ответ 409. Освобождение квоты происходит после удаления."
      }
    },
    "/v1/auth/login-link": {
      "post": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Создание ссылки для входа",
        "operationId": "login_link_v1_auth_login_link_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          }
        ],
        "parameters": [
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginLinkInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginLinkResult"
                }
              }
            }
          },
          "401": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Сервер партнёра вызывает POST /v1/auth/login-link с X-API-Key и X-Customer-ID. Укажите mailbox_id для входа только в этот ящик; без него откроется весь аккаунт. locale выбирает язык интерфейса."
      }
    },
    "/v1/auth/login-link/consume": {
      "post": {
        "tags": [
          "Авторизация и аккаунт"
        ],
        "summary": "Обмен ссылки на сессию",
        "operationId": "consume_login_link_v1_auth_login_link_consume_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginLinkConsume"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserSessionResult"
                }
              }
            }
          },
          "403": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Только для страницы входа adapt-mail.com: POST с Origin: https://adapt-mail.com. Возвращает session_id и HttpOnly cookies. Повторный обмен или истёкшая ссылка: HTTP 410.",
        "security": []
      }
    },
    "/v1/mailboxes/{mailbox_id}/templates": {
      "get": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Шаблоны писем",
        "operationId": "templates_v1_mailboxes__mailbox_id__templates_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateRecord"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам."
      },
      "post": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Шаблоны писем",
        "operationId": "create_template_v1_mailboxes__mailbox_id__templates_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailTemplate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateRecord"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам."
      }
    },
    "/v1/mailboxes/{mailbox_id}/templates/{template_id}": {
      "put": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Шаблоны писем",
        "operationId": "update_template_v1_mailboxes__mailbox_id__templates__template_id__put",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Template Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailTemplate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateRecord"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам."
      },
      "delete": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Шаблоны писем",
        "operationId": "delete_template_v1_mailboxes__mailbox_id__templates__template_id__delete",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Template Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам."
      }
    },
    "/v1/mailboxes/{mailbox_id}/autoresponder": {
      "get": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Автоответчик",
        "operationId": "autoresponder_v1_mailboxes__mailbox_id__autoresponder_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Autoresponder"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path."
      },
      "put": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Автоответчик",
        "operationId": "set_autoresponder_v1_mailboxes__mailbox_id__autoresponder_put",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Autoresponder"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Autoresponder"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path."
      }
    },
    "/v1/mailboxes/{mailbox_id}/filters": {
      "get": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Фильтры",
        "operationId": "filters_v1_mailboxes__mailbox_id__filters_get",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FilterRecord"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}."
      },
      "post": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Фильтры",
        "operationId": "create_filter_v1_mailboxes__mailbox_id__filters_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailFilter"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterChange"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}."
      }
    },
    "/v1/mailboxes/{mailbox_id}/filters/{filter_id}": {
      "put": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Фильтры",
        "operationId": "update_filter_v1_mailboxes__mailbox_id__filters__filter_id__put",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "filter_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Filter Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailFilter"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterChange"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}."
      },
      "delete": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Фильтры",
        "operationId": "delete_filter_v1_mailboxes__mailbox_id__filters__filter_id__delete",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "filter_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Filter Id"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}."
      }
    },
    "/v1/mailboxes/{mailbox_id}/filters/{filter_id}/apply": {
      "post": {
        "tags": [
          "Настройки ящика"
        ],
        "summary": "Применить к существующим",
        "operationId": "apply_filter_v1_mailboxes__mailbox_id__filters__filter_id__apply_post",
        "security": [
          {
            "PartnerKey": [],
            "Customer": []
          },
          {
            "Session": []
          },
          {
            "Browser": []
          }
        ],
        "parameters": [
          {
            "name": "mailbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Mailbox Id"
            }
          },
          {
            "name": "filter_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Filter Id"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120,
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Customer-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Customer-Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Требуется вход",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Нет доступа",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт состояния",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}."
      }
    }
  },
  "components": {
    "schemas": {
      "Body_upload_v1_mailboxes__mailbox_id__files_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_v1_mailboxes__mailbox_id__files_post"
      },
      "Contact": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "name"
        ],
        "title": "Contact",
        "example": {
          "email": "team@example.com",
          "name": "Support team"
        }
      },
      "DraftInput": {
        "properties": {
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "title": "To",
            "description": "Адреса основных получателей."
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Cc",
            "description": "Адреса получателей копии, видимые другим участникам."
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Bcc",
            "description": "Адреса получателей скрытой копии."
          },
          "subject": {
            "type": "string",
            "maxLength": 998,
            "title": "Subject",
            "default": "",
            "description": "Тема письма."
          },
          "text": {
            "type": "string",
            "maxLength": 200000,
            "title": "Text",
            "default": "",
            "description": "Текст письма без форматирования."
          },
          "html": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300000
              },
              {
                "type": "null"
              }
            ],
            "title": "Html",
            "description": "HTML-версия письма с форматированием."
          },
          "file_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 20,
            "title": "File Ids",
            "description": "ID ранее загруженных файлов этого ящика. Получите их при загрузке или из списка файлов."
          },
          "forward_message": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MessageReference"
              },
              {
                "type": "null"
              }
            ],
            "description": "Исходное письмо, вложения которого нужно переслать."
          },
          "reply_to_message_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 998
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply To Message Id",
            "description": "Значение message_id письма, на которое вы отвечаете."
          },
          "references": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "References",
            "description": "Значение references исходного письма для сохранения цепочки ответов."
          },
          "send_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Send At",
            "description": "Время отложенной отправки с часовым поясом, например 2026-11-01T12:00:00Z. Без значения отправка начинается по мере обработки очереди."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DraftInput",
        "example": {
          "to": [
            "team@example.com"
          ],
          "subject": "Hello",
          "text": "A message from Adapt Mail"
        }
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "Login": {
        "properties": {
          "login": {
            "type": "string",
            "title": "Login"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password"
          },
          "mode": {
            "type": "string",
            "enum": [
              "account",
              "mailbox"
            ],
            "title": "Mode",
            "default": "account"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "login",
          "password"
        ],
        "title": "Login"
      },
      "MailboxUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "quota_mb": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 10240
              },
              {
                "type": "null"
              }
            ],
            "title": "Quota Mb"
          },
          "file_quota_mb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 512000,
                "minimum": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "File Quota Mb"
          },
          "password": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 12
              },
              {
                "type": "null"
              }
            ],
            "title": "Password"
          },
          "signature": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ],
            "title": "Signature"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "MailboxUpdate",
        "example": {
          "name": "Support",
          "signature": "Support team"
        }
      },
      "MessageAction": {
        "properties": {
          "folder": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Folder",
            "description": "Имя папки из списка папок, например INBOX."
          },
          "uidvalidity": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Uidvalidity",
            "description": "Значение uidvalidity из ответа API для этой папки."
          },
          "uids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Uids",
            "description": "Идентификаторы выбранных писем из одной папки."
          },
          "action": {
            "type": "string",
            "enum": [
              "read",
              "unread",
              "star",
              "unstar",
              "move",
              "delete"
            ],
            "title": "Action"
          },
          "destination": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Destination",
            "description": "Имя целевой папки. Обязательно для action=move."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "folder",
          "uidvalidity",
          "uids",
          "action"
        ],
        "title": "MessageAction"
      },
      "MessageReference": {
        "properties": {
          "folder": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Folder",
            "description": "Имя папки из списка папок, например INBOX."
          },
          "uidvalidity": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Uidvalidity",
            "description": "Значение uidvalidity из ответа API для этой папки."
          },
          "uid": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Uid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "folder",
          "uidvalidity",
          "uid"
        ],
        "title": "MessageReference"
      },
      "NameInput": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "NameInput"
      },
      "SendInput": {
        "properties": {
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "To",
            "description": "Адреса основных получателей."
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Cc",
            "description": "Адреса получателей копии, видимые другим участникам."
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Bcc",
            "description": "Адреса получателей скрытой копии."
          },
          "subject": {
            "type": "string",
            "maxLength": 998,
            "title": "Subject",
            "default": "",
            "description": "Тема письма."
          },
          "text": {
            "type": "string",
            "maxLength": 200000,
            "title": "Text",
            "default": "",
            "description": "Текст письма без форматирования."
          },
          "html": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300000
              },
              {
                "type": "null"
              }
            ],
            "title": "Html",
            "description": "HTML-версия письма с форматированием."
          },
          "file_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 20,
            "title": "File Ids",
            "description": "ID ранее загруженных файлов этого ящика. Получите их при загрузке или из списка файлов."
          },
          "forward_message": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MessageReference"
              },
              {
                "type": "null"
              }
            ],
            "description": "Исходное письмо, вложения которого нужно переслать."
          },
          "reply_to_message_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 998
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply To Message Id",
            "description": "Значение message_id письма, на которое вы отвечаете."
          },
          "references": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "References",
            "description": "Значение references исходного письма для сохранения цепочки ответов."
          },
          "send_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Send At",
            "description": "Время отложенной отправки с часовым поясом, например 2026-11-01T12:00:00Z. Без значения отправка начинается по мере обработки очереди."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "to"
        ],
        "title": "SendInput",
        "example": {
          "to": [
            "team@example.com"
          ],
          "subject": "Hello",
          "text": "A message from Adapt Mail"
        }
      },
      "SenderRule": {
        "properties": {
          "sender": {
            "type": "string",
            "title": "Sender"
          },
          "action": {
            "type": "string",
            "enum": [
              "spam",
              "allow"
            ],
            "title": "Action",
            "default": "spam"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sender"
        ],
        "title": "SenderRule",
        "example": {
          "sender": "sender@example.com",
          "action": "spam"
        }
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "Address": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "MessageSummary": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "integer"
          },
          "uidvalidity": {
            "type": "integer"
          },
          "folder": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          },
          "subject": {
            "type": "string"
          },
          "preview": {
            "type": "string"
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "size_bytes": {
            "type": "integer"
          },
          "received_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          }
        }
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "integer"
          },
          "uidvalidity": {
            "type": "integer"
          },
          "folder": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          },
          "subject": {
            "type": "string"
          },
          "preview": {
            "type": "string"
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "size_bytes": {
            "type": "integer"
          },
          "received_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "text": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          },
          "cc": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          },
          "references": {
            "type": "string"
          },
          "reply_to": {
            "type": "string"
          }
        }
      },
      "Operation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Идентификатор операции для проверки состояния и отмены ожидающей отправки."
          },
          "kind": {
            "type": "string"
          },
          "mailbox_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "uncertain",
              "cancelled"
            ]
          },
          "run_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "created_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина ошибки, если операция не завершилась успешно."
          },
          "result": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ],
            "description": "Результат выполнения операции. Для отправки содержит сведения о принятых и отклонённых получателях."
          }
        }
      },
      "SendResult": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "smtp_accepted": {
            "type": "boolean"
          },
          "sent_saved": {
            "type": "boolean"
          },
          "accepted_recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rejected_recipients": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "code": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "Mailbox": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "domain_id": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "quota_mb": {
            "type": "integer"
          },
          "used_bytes": {
            "type": "integer"
          },
          "file_quota_bytes": {
            "type": "integer"
          },
          "file_used_bytes": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "access_allowed": {
            "type": "boolean"
          },
          "paid_until": {
            "anyOf": [
              {
                "type": "string",
                "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
              },
              {
                "type": "null"
              }
            ]
          },
          "ready_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
              },
              {
                "type": "null"
              }
            ]
          },
          "delete_after": {
            "anyOf": [
              {
                "type": "string",
                "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "updated_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "reserved_quota_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "outbound_high_limit": {
            "type": "boolean"
          },
          "outbound_daily_recipient_limit": {
            "type": "integer"
          },
          "outbound_daily_recipients_used": {
            "type": "integer"
          },
          "outbound_daily_recipients_remaining": {
            "type": "integer"
          },
          "outbound_messages_per_minute": {
            "type": "integer"
          },
          "outbound_minute_messages_used": {
            "type": "integer"
          },
          "outbound_minute_messages_remaining": {
            "type": "integer"
          },
          "outbound_recipients_per_message": {
            "type": "integer"
          },
          "storage_shared": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "Domain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "is_shared": {
            "type": "boolean"
          },
          "verification_token": {
            "type": "string"
          },
          "dns_status": {
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "updated_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          }
        }
      },
      "File": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "scanned_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "mailbox_id": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            ]
          }
        }
      },
      "LoginLinkInput": {
        "properties": {
          "mailbox_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Mailbox Id"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "ru",
              "fr",
              "es",
              "de",
              "zh-cn",
              "ko",
              "tr",
              "hi",
              "pt-br"
            ],
            "title": "Locale",
            "default": "en"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "LoginLinkInput"
      },
      "LoginLinkConsume": {
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "title": "Token"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "token"
        ],
        "title": "LoginLinkConsume"
      },
      "LoginLinkResult": {
        "properties": {
          "login_url": {
            "type": "string",
            "title": "Login Url"
          },
          "expires_in": {
            "type": "integer",
            "const": 300,
            "title": "Expires In"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          },
          "account_id": {
            "type": "integer",
            "title": "Account Id"
          },
          "mailbox_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mailbox Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "login_url",
          "expires_in",
          "expires_at",
          "account_id",
          "mailbox_id"
        ],
        "title": "LoginLinkResult"
      },
      "BrowserSessionResult": {
        "properties": {
          "mailbox_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mailbox Id"
          },
          "session_id": {
            "type": "string",
            "title": "Session Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "mailbox_id",
          "session_id"
        ],
        "title": "BrowserSessionResult"
      },
      "MailTemplate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "subject": {
            "type": "string",
            "maxLength": 998,
            "title": "Subject",
            "default": ""
          },
          "text": {
            "type": "string",
            "maxLength": 20000,
            "title": "Text",
            "default": ""
          },
          "html": {
            "type": "string",
            "maxLength": 30000,
            "title": "Html",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "MailTemplate"
      },
      "MailFilter": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "match": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ],
            "title": "Match",
            "default": "all"
          },
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/FilterCondition"
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Conditions"
          },
          "mark_read": {
            "type": "boolean",
            "title": "Mark Read",
            "default": false
          },
          "important": {
            "type": "boolean",
            "title": "Important",
            "default": false
          },
          "trash": {
            "type": "boolean",
            "title": "Trash",
            "default": false
          },
          "move_to": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Move To"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "conditions"
        ],
        "title": "MailFilter"
      },
      "FilterCondition": {
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "from",
              "to",
              "cc",
              "subject"
            ],
            "title": "Field"
          },
          "operator": {
            "type": "string",
            "enum": [
              "contains",
              "not_contains",
              "equals",
              "not_equals"
            ],
            "title": "Operator"
          },
          "value": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Value"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "field",
          "operator",
          "value"
        ],
        "title": "FilterCondition"
      },
      "Autoresponder": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          },
          "subject": {
            "type": "string",
            "maxLength": 200,
            "title": "Subject",
            "default": ""
          },
          "text": {
            "type": "string",
            "maxLength": 10000,
            "title": "Text",
            "default": ""
          },
          "starts_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Starts At"
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ends At"
          },
          "repeat_days": {
            "type": "integer",
            "maximum": 30,
            "minimum": 1,
            "title": "Repeat Days",
            "default": 7
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "Autoresponder"
      },
      "TemplateRecord": {
        "type": "object",
        "required": [
          "id",
          "data",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/MailTemplate"
          },
          "updated_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          }
        }
      },
      "FilterRecord": {
        "type": "object",
        "required": [
          "id",
          "data",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/MailFilter"
          },
          "updated_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          }
        }
      },
      "FilterChange": {
        "type": "object",
        "required": [
          "id",
          "data",
          "updated_at",
          "operation"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/MailFilter"
          },
          "updated_at": {
            "type": "string",
            "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC."
          },
          "operation": {
            "$ref": "#/components/schemas/Operation"
          }
        }
      }
    },
    "securitySchemes": {
      "PartnerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "Customer": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Customer-ID"
      },
      "Session": {
        "type": "http",
        "scheme": "bearer"
      },
      "Browser": {
        "type": "apiKey",
        "in": "cookie",
        "name": "mail_browser"
      }
    }
  },
  "servers": [
    {
      "url": "https://adapt-mail.com"
    }
  ]
}