{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenBell waitlist API",
    "version": "1.0.0",
    "summary": "Join the OpenBell cybersecurity exchange waitlist, for people and for AI assistants acting for them.",
    "description": "Signs a person up to the OpenBell waitlist. They receive a confirmation email and must click it before they are on the list. Only sign up someone who asked you to.",
    "contact": { "email": "hello@getopenbell.com", "url": "https://getopenbell.com/" }
  },
  "servers": [{ "url": "https://getopenbell.com" }],
  "paths": {
    "/api/waitlist": {
      "post": {
        "operationId": "joinWaitlist",
        "summary": "Sign a person up to the waitlist (they confirm by email)",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object", "required": ["email", "role"], "additionalProperties": false,
            "properties": {
              "email": { "type": "string", "format": "email", "maxLength": 254, "description": "The person's work email." },
              "role": { "type": "string", "enum": ["buy", "sell"], "description": "buy: they buy cybersecurity. sell: they are a cybersecurity vendor." },
              "segment": { "type": "string", "enum": ["startup", "sme", "midmarket", "enterprise", "startup_vendor", "established_vendor"],
                           "description": "Optional. buy: startup, sme, midmarket, enterprise. sell: startup_vendor, established_vendor." },
              "via": { "type": "string", "maxLength": 40, "description": "Optional. The AI assistant making the request, e.g. claude, chatgpt, copilot." },
              "r": { "type": "string", "maxLength": 16, "description": "Optional. Invite code of the person who referred them." }
            } } } }
        },
        "responses": {
          "200": { "description": "Accepted. A confirmation email is on its way. The same answer is given if they are already on the list.",
                   "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean", "const": true } } } } } },
          "400": { "description": "A field is missing or invalid.",
                   "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "error": { "type": "string", "enum": ["email", "role", "segment", "content-type"] } } } } } },
          "429": { "description": "Too many requests. Try again later." }
        }
      }
    }
  }
}
