{
    "openapi": "3.0.3",
    "info": {
        "title": "Анализатор DMARC API",
        "version": "1.0.0",
        "description": "Подключите ящик с rua-отчётами — сводка pass/fail и источники IP за 30 дней\n\nСгенерировано из карты методов tools docs. Канон вызова — этот server, не Host документации."
    },
    "servers": [
        {
            "url": "https://mailganer.com",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "dmarc"
        }
    ],
    "paths": {
        "/tools/dmarc/v1/status": {
            "get": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Сервис жив, квоты",
                "operationId": "dmarc_get_tools_dmarc_v1_status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "service": {
                                            "type": "string"
                                        },
                                        "daily_limit": {
                                            "type": "integer"
                                        },
                                        "remaining": {
                                            "type": "integer"
                                        },
                                        "captcha": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "required, site_key, mode"
                                        },
                                        "days": {
                                            "type": "integer",
                                            "description": "окно rua, обычно 30"
                                        },
                                        "presets": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "IMAP-пресеты"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/dmarc/v1/presets": {
            "get": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Готовые IMAP-пресеты",
                "operationId": "dmarc_get_tools_dmarc_v1_presets",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "presets": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "id, host, port, label"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tools/dmarc/v1/imap": {
            "post": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Собрать rua-отчёты с ящика",
                "operationId": "dmarc_post_tools_dmarc_v1_imap",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "share_path": {
                                            "type": "string"
                                        },
                                        "summary": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "pass/fail, источники IP"
                                        },
                                        "fetch": {
                                            "type": "object",
                                            "additionalProperties": true,
                                            "description": "метаданные IMAP"
                                        },
                                        "remaining": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "preset": {
                                        "type": "string",
                                        "description": "id из /presets; или host из allow-листа"
                                    },
                                    "login": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "host": {
                                        "type": "string",
                                        "description": "только если совпадает с пресетом"
                                    },
                                    "port": {
                                        "type": "integer"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "preset",
                                    "login",
                                    "password"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/dmarc/v1/upload": {
            "post": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Загрузить XML отчёта",
                "operationId": "dmarc_post_tools_dmarc_v1_upload",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "share_path": {
                                            "type": "string"
                                        },
                                        "summary": {
                                            "type": "object",
                                            "additionalProperties": true
                                        },
                                        "remaining": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "description": "Доступ: капча",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "xml": {
                                        "type": "string",
                                        "description": "текст aggregate XML"
                                    },
                                    "smart-token": {
                                        "type": "string",
                                        "description": "капча без ключа API; также captchaToken / smart_token / X-Captcha-Token"
                                    }
                                },
                                "required": [
                                    "xml"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tools/dmarc/v1/reports/{token}": {
            "get": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Готовый разбор",
                "operationId": "dmarc_get_tools_dmarc_v1_reports_token_",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "summary": {
                                            "type": "object",
                                            "additionalProperties": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "токен результата"
                        },
                        "description": "токен результата"
                    }
                ]
            }
        },
        "/tools/dmarc/v1/share/{token}/badge.svg": {
            "get": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Бейдж разбора",
                "operationId": "dmarc_get_tools_dmarc_v1_share_token_badge_svg",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary",
                                    "description": "SVG-бейдж"
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "токен результата"
                        },
                        "description": "токен результата"
                    }
                ]
            }
        },
        "/tools/dmarc/v1/reports/{token}/badge.svg": {
            "get": {
                "tags": [
                    "dmarc"
                ],
                "summary": "Бейдж разбора (алиас)",
                "operationId": "dmarc_get_tools_dmarc_v1_reports_token_badge_svg",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary",
                                    "description": "SVG-бейдж"
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "токен результата"
                        },
                        "description": "токен результата"
                    }
                ]
            }
        }
    }
}