{
    "openapi": "3.0.3",
    "info": {
        "title": "AI-анализ HTML API",
        "version": "1.0.0",
        "description": "Орфография, тёмная тема, UTM, вёрстка и ссылки — разбор HTML письма\n\nСгенерировано из карты методов tools docs. Канон вызова — этот server, не Host документации."
    },
    "servers": [
        {
            "url": "https://mailganer.com",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "html-analyzer"
        }
    ],
    "paths": {
        "/tools/html-analyzer/v1/status": {
            "get": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Квоты",
                "operationId": "html_analyzer_get_tools_html_analyzer_v1_status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "configured": {
                                            "type": "boolean",
                                            "description": "сервис готов"
                                        },
                                        "dailyLimit": {
                                            "type": "integer",
                                            "description": "лимит с IP за сутки"
                                        },
                                        "dailyRemaining": {
                                            "type": "integer"
                                        },
                                        "captchaRequired": {
                                            "type": "boolean"
                                        },
                                        "siteKey": {
                                            "type": "string",
                                            "description": "ключ SmartCaptcha, если капча нужна"
                                        },
                                        "maxHtmlBytes": {
                                            "type": "integer"
                                        },
                                        "layoutPresets": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "id → подпись сценария вёрстки"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/analyze": {
            "post": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Разобрать HTML письма",
                "operationId": "html_analyzer_post_tools_html_analyzer_v1_analyze",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "spelling": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "errors, count"
                                        },
                                        "plainText": {
                                            "type": "string"
                                        },
                                        "warning": {
                                            "type": "string"
                                        },
                                        "configured": {
                                            "type": "boolean",
                                            "description": "сервис готов"
                                        },
                                        "dailyLimit": {
                                            "type": "integer",
                                            "description": "лимит с IP за сутки"
                                        },
                                        "dailyRemaining": {
                                            "type": "integer"
                                        },
                                        "captchaRequired": {
                                            "type": "boolean"
                                        },
                                        "siteKey": {
                                            "type": "string",
                                            "description": "ключ SmartCaptcha, если капча нужна"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string"
                                    },
                                    "checks": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "spelling и/или plain"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "html",
                                    "checks"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/layout": {
            "post": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Анализ раскладки",
                "operationId": "html_analyzer_post_tools_html_analyzer_v1_layout",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "preset": {
                                            "type": "string"
                                        },
                                        "presetLabel": {
                                            "type": "string"
                                        },
                                        "verdict": {
                                            "type": "string"
                                        },
                                        "issues": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "response": {
                                            "type": "string"
                                        },
                                        "configured": {
                                            "type": "boolean",
                                            "description": "сервис готов"
                                        },
                                        "dailyLimit": {
                                            "type": "integer",
                                            "description": "лимит с IP за сутки"
                                        },
                                        "dailyRemaining": {
                                            "type": "integer"
                                        },
                                        "captchaRequired": {
                                            "type": "boolean"
                                        },
                                        "siteKey": {
                                            "type": "string",
                                            "description": "ключ SmartCaptcha, если капча нужна"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string"
                                    },
                                    "preset": {
                                        "type": "string",
                                        "description": "id из layoutPresets"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "html",
                                    "preset"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/ask": {
            "post": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Вопрос по вёрстке",
                "operationId": "html_analyzer_post_tools_html_analyzer_v1_ask",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "query": {
                                            "type": "string"
                                        },
                                        "text": {
                                            "type": "string",
                                            "description": "ответ"
                                        },
                                        "messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "configured": {
                                            "type": "boolean",
                                            "description": "сервис готов"
                                        },
                                        "dailyLimit": {
                                            "type": "integer",
                                            "description": "лимит с IP за сутки"
                                        },
                                        "dailyRemaining": {
                                            "type": "integer"
                                        },
                                        "captchaRequired": {
                                            "type": "boolean"
                                        },
                                        "siteKey": {
                                            "type": "string",
                                            "description": "ключ SmartCaptcha, если капча нужна"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string"
                                    },
                                    "query": {
                                        "type": "string",
                                        "description": "вопрос, до 2000 символов"
                                    },
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "история role/text"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "html",
                                    "query"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/subject-preheader": {
            "post": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Тема и прехедер",
                "operationId": "html_analyzer_post_tools_html_analyzer_v1_subject_preheader",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "subject": {
                                            "type": "string"
                                        },
                                        "preheader": {
                                            "type": "string"
                                        },
                                        "configured": {
                                            "type": "boolean",
                                            "description": "сервис готов"
                                        },
                                        "dailyLimit": {
                                            "type": "integer",
                                            "description": "лимит с IP за сутки"
                                        },
                                        "dailyRemaining": {
                                            "type": "integer"
                                        },
                                        "captchaRequired": {
                                            "type": "boolean"
                                        },
                                        "siteKey": {
                                            "type": "string",
                                            "description": "ключ SmartCaptcha, если капча нужна"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "html"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/redirect": {
            "post": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Цепочка редиректов ссылки",
                "operationId": "html_analyzer_post_tools_html_analyzer_v1_redirect",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "hops": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "при одном URL — плоский ответ"
                                        },
                                        "results": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "при пакете: url → hops"
                                        },
                                        "checked": {
                                            "type": "integer"
                                        },
                                        "configured": {
                                            "type": "boolean",
                                            "description": "сервис готов"
                                        },
                                        "dailyLimit": {
                                            "type": "integer",
                                            "description": "лимит с IP за сутки"
                                        },
                                        "dailyRemaining": {
                                            "type": "integer"
                                        },
                                        "captchaRequired": {
                                            "type": "boolean"
                                        },
                                        "siteKey": {
                                            "type": "string",
                                            "description": "ключ SmartCaptcha, если капча нужна"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "один URL; или urls[]"
                                    },
                                    "urls": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "user_agent": {
                                        "type": "string"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/share": {
            "post": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Сохранить сводку",
                "operationId": "html_analyzer_post_tools_html_analyzer_v1_share",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        },
                                        "share_url": {
                                            "type": "string",
                                            "description": "ссылка на отчёт в UI"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "результаты проверок для ссылки"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "items"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/html-analyzer/v1/share/{token}": {
            "get": {
                "tags": [
                    "html-analyzer"
                ],
                "summary": "Сводка по токену",
                "operationId": "html_analyzer_get_tools_html_analyzer_v1_share_token_",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "share_url": {
                                            "type": "string"
                                        },
                                        "created_at": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "токен результата"
                        },
                        "description": "токен результата"
                    }
                ]
            }
        }
    }
}