{
  "openapi": "3.1.0",
  "info": {
    "title": "Theodacity Public API",
    "version": "2026-04-30",
    "summary": "Public, launch-stage endpoints for Theodacity website contact and agent discovery.",
    "description": "This API description intentionally covers only public website functions. It does not imply access to private product systems."
  },
  "servers": [
    {
      "url": "https://theodacity.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "sendContactMessage",
        "summary": "Send a public contact form message",
        "responses": {
          "200": {
            "description": "Message accepted"
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Soft cooldown triggered"
          },
          "500": {
            "description": "Mail service not configured"
          }
        }
      }
    },
    "/api/newsletter": {
      "post": {
        "operationId": "joinNewsletter",
        "summary": "Join the Theodacity AI newsletter",
        "responses": {
          "200": {
            "description": "Subscriber accepted"
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Soft cooldown triggered"
          },
          "500": {
            "description": "Newsletter service not configured"
          },
          "502": {
            "description": "Newsletter provider error"
          }
        }
      }
    },
    "/api/lifecycle-email": {
      "post": {
        "operationId": "sendLifecycleEmail",
        "summary": "Send a protected lifecycle email",
        "security": [
          {
            "LifecycleSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "Email sent"
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "503": {
            "description": "Lifecycle email secret not configured"
          }
        }
      }
    },
    "/api/unsubscribe": {
      "get": {
        "operationId": "showUnsubscribe",
        "summary": "Show a human unsubscribe confirmation page",
        "responses": {
          "200": {
            "description": "Unsubscribe confirmation page"
          },
          "400": {
            "description": "Invalid token"
          }
        }
      },
      "post": {
        "operationId": "unsubscribeEmail",
        "summary": "Unsubscribe a contact from marketing emails",
        "responses": {
          "202": {
            "description": "Unsubscribe accepted"
          },
          "400": {
            "description": "Missing or invalid token"
          },
          "502": {
            "description": "Provider error"
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "operationId": "getPublicMcpMetadata",
        "summary": "Read public MCP endpoint metadata",
        "responses": {
          "200": {
            "description": "MCP metadata"
          }
        }
      },
      "post": {
        "operationId": "callPublicMcp",
        "summary": "Call the public Theodacity MCP JSON-RPC endpoint",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "204": {
            "description": "Notification accepted"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "LifecycleSecret": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
