{
    "openapi": "3.0.3",
    "info": {
        "title": "SMTP-диагностика API",
        "version": "1.0.0",
        "description": "Временный SMTP blackhole: полный диалог, fault injection и разбор сессии\n\nСгенерировано из карты методов tools docs. Канон вызова — этот server, не Host документации."
    },
    "servers": [
        {
            "url": "https://mailganer.com",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "smtp-diag"
        }
    ],
    "paths": {
        "/tools/smtp-diag/health": {
            "get": {
                "tags": [
                    "smtp-diag"
                ],
                "summary": "Сервис жив",
                "operationId": "smtp_diag_get_tools_smtp_diag_health",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "description": "ok"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/smtp-diag/api/status": {
            "get": {
                "tags": [
                    "smtp-diag"
                ],
                "summary": "Ключ капчи",
                "operationId": "smtp_diag_get_tools_smtp_diag_api_status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "captcha": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "required, site_key"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/smtp-diag/api/behaviors": {
            "get": {
                "tags": [
                    "smtp-diag"
                ],
                "summary": "Сценарии отказа",
                "operationId": "smtp_diag_get_tools_smtp_diag_api_behaviors",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "behaviors": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "ключ сценария и описание"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/smtp-diag/api/sessions": {
            "post": {
                "tags": [
                    "smtp-diag"
                ],
                "summary": "Выдать временные SMTP-данные",
                "operationId": "smtp_diag_post_tools_smtp_diag_api_sessions",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        },
                                        "host": {
                                            "type": "string"
                                        },
                                        "port_plain": {
                                            "type": "integer"
                                        },
                                        "port_tls": {
                                            "type": "integer"
                                        },
                                        "login": {
                                            "type": "string"
                                        },
                                        "password": {
                                            "type": "string"
                                        },
                                        "behavior": {
                                            "type": "string"
                                        },
                                        "log_url": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "behavior": {
                                        "type": "string",
                                        "description": "сценарий отказа; иначе default"
                                    },
                                    "captcha_token": {
                                        "type": "string",
                                        "description": "также X-Captcha-Token"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/smtp-diag/api/sessions/{token}": {
            "get": {
                "tags": [
                    "smtp-diag"
                ],
                "summary": "Письма сессии",
                "operationId": "smtp_diag_get_tools_smtp_diag_api_sessions_token_",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        },
                                        "behavior": {
                                            "type": "string"
                                        },
                                        "connection": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "host, порты, login"
                                        },
                                        "created_at": {
                                            "type": "string"
                                        },
                                        "expires_at": {
                                            "type": "string"
                                        },
                                        "count": {
                                            "type": "integer"
                                        },
                                        "messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "id, from, subject, outcome"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "токен результата"
                        },
                        "description": "токен результата"
                    }
                ]
            }
        },
        "/tools/smtp-diag/api/sessions/{token}/m/{tid}/checks": {
            "get": {
                "tags": [
                    "smtp-diag"
                ],
                "summary": "Проверки письма",
                "operationId": "smtp_diag_get_tools_smtp_diag_api_sessions_token_m_tid_checks",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "checks": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "результаты проверок письма"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": ""
                    },
                    {
                        "name": "tid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "description": "id письма из messages"
                        },
                        "description": "id письма из messages"
                    }
                ]
            }
        }
    }
}