{
  "swagger": "2.0",
  "info": {
    "title": "Zetaleap AI Formatter",
    "description": "Convert raw ChatGPT, Azure OpenAI, Claude, and Copilot Markdown outputs into clean, XSS-sanitized HTML for Outlook emails, Teams cards, and PDFs (or HTML to Markdown).",
    "version": "1.0.0",
    "contact": {
      "name": "Zetaleap Support Team",
      "url": "https://zetaleap.com/#contact",
      "email": "support_team@zetaleap.com"
    }
  },
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://zetaleap.com"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://zetaleap.com/privacy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "AI;Productivity"
    }
  ],
  "host": "test.zetaleap.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Enter your Zetaleap Personal Access Token prefixed with Bearer (example: Bearer zl_your_api_token). Generate tokens free at https://zetaleap.com/profile."
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "paths": {
    "/api/tools/convert": {
      "post": {
        "tags": [
          "AI Formatter"
        ],
        "operationId": "ConvertFormat",
        "summary": "Convert Markdown to HTML or HTML to Markdown",
        "description": "Converts LLM/AI Markdown output (ChatGPT, Azure OpenAI, Claude, Copilot) into sanitized HTML for Outlook/Teams/PDFs, or converts HTML into clean Markdown.",
        "x-ms-visibility": "important",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "x-ms-summary": "Conversion Payload",
            "schema": {
              "type": "object",
              "required": [
                "mode",
                "text"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "md2html",
                    "html2md"
                  ],
                  "default": "md2html",
                  "x-ms-summary": "Conversion Mode",
                  "description": "Select md2html (Markdown to HTML) or html2md (HTML to Markdown)."
                },
                "text": {
                  "type": "string",
                  "x-ms-summary": "Input Content (Max 100KB)",
                  "description": "Raw Markdown or HTML string to transform."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Converted content returned successfully",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "result": {
                  "type": "string",
                  "x-ms-summary": "Converted Output",
                  "description": "Clean HTML or Markdown string ready for Outlook, Teams, or Dataverse."
                }
              }
            }
          }
        }
      }
    }
  }
}