{
  "openapi": "3.1.0",
  "info": {
    "title": "MarketMai Public API",
    "version": "2026-08-03",
    "description": "Public machine-readable endpoints for MarketMai discovery and email subscription."
  },
  "servers": [
    {
      "url": "https://marketmai.com"
    }
  ],
  "paths": {
    "/api/subscribe": {
      "post": {
        "summary": "Subscribe an email address to MarketMai updates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email"],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "next": {
                    "type": "string",
                    "default": "/free-prompts"
                  },
                  "source": {
                    "type": "string",
                    "default": "free-prompts"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": ["email"],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "next": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "302": {
            "description": "Redirects back to the requested next path with success or error state."
          }
        }
      }
    },
    "/.well-known/brand-facts.json": {
      "get": {
        "summary": "Fetch MarketMai organization and catalog facts",
        "responses": {
          "200": {
            "description": "MarketMai brand facts as schema.org JSON."
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Fetch public site health",
        "responses": {
          "200": {
            "description": "Static health response for automated checks."
          }
        }
      }
    }
  }
}
