{
  "openapi": "3.0.3",
  "info": {
    "title": "Machine Sports Association — Machine Profile API",
    "version": "1.0.0",
    "description": "Performability (P) surface for the MSA machine profile. Describes public discovery documents and live Cloud Functions used by the fan site.",
    "contact": {
      "name": "MSA Support",
      "email": "support@theaiwebcompany.com",
      "url": "https://machinesportsassociation.web.app/"
    }
  },
  "servers": [
    {
      "url": "https://machinesportsassociation.web.app",
      "description": "Public site and static VCAP surfaces"
    },
    {
      "url": "https://us-central1-machinesportsassociation.cloudfunctions.net",
      "description": "Firebase Cloud Functions (callable HTTPS)"
    }
  ],
  "vcap": {
    "visibility": "https://machinesportsassociation.web.app/",
    "citability": "https://machinesportsassociation.web.app/llms.txt",
    "actionability": "https://machinesportsassociation.web.app/mcp.json",
    "performability": "https://machinesportsassociation.web.app/openapi.json"
  },
  "paths": {
    "/llms.txt": {
      "get": {
        "operationId": "getMachineProfileText",
        "summary": "Citability profile (plain text)",
        "responses": {
          "200": {
            "description": "MSA entity profile for answer engines",
            "content": {
              "text/plain": {
                "schema": { "type": "string" }
              }
            }
          }
        }
      }
    },
    "/mcp.json": {
      "get": {
        "operationId": "getMcpDescriptor",
        "summary": "Actionability MCP descriptor",
        "responses": {
          "200": {
            "description": "MCP tool list for agents",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiDocument",
        "summary": "This OpenAPI document",
        "responses": {
          "200": {
            "description": "OpenAPI 3 document",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/app": {
      "get": {
        "operationId": "getFanAiWebApp",
        "summary": "MSA Fan AI Web App install surface",
        "responses": {
          "200": {
            "description": "HTML installable AI Web App"
          }
        }
      }
    },
    "/createReservationCheckout": {
      "post": {
        "servers": [
          {
            "url": "https://us-central1-machinesportsassociation.cloudfunctions.net"
          }
        ],
        "operationId": "createReservationCheckout",
        "summary": "Create Stripe Checkout for a $10 match reservation",
        "description": "Firebase callable HTTPS function. Requires authenticated fan session in the web client.",
        "responses": {
          "200": {
            "description": "Checkout session URL and reservation id"
          }
        }
      }
    },
    "/confirmReservationCheckout": {
      "post": {
        "servers": [
          {
            "url": "https://us-central1-machinesportsassociation.cloudfunctions.net"
          }
        ],
        "operationId": "confirmReservationCheckout",
        "summary": "Confirm a completed Stripe reservation checkout",
        "responses": {
          "200": {
            "description": "Reservation confirmation payload"
          }
        }
      }
    },
    "/stripeWebhook": {
      "post": {
        "servers": [
          {
            "url": "https://us-central1-machinesportsassociation.cloudfunctions.net"
          }
        ],
        "operationId": "stripeWebhook",
        "summary": "Stripe webhook receiver for checkout.session.completed",
        "responses": {
          "200": {
            "description": "Webhook acknowledged"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MsaEntity": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "example": "Machine Sports Association" },
          "alternateName": {
            "type": "array",
            "items": { "type": "string" },
            "example": ["MSA", "Machine Martial Arts"]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "support@theaiwebcompany.com"
          },
          "foundingRule": {
            "type": "string",
            "example": "Enter complete. Transform. Adapt. Repair. Upgrade."
          },
          "firstEvent": {
            "type": "string",
            "example": "2027 · Time TBD · Location TBD"
          }
        }
      }
    }
  }
}
