{
  "openapi": "3.1.0",
  "info": {
    "title": "Cushly waitlist",
    "version": "0.1.0",
    "description": "Add a driver to the Cushly waitlist. We email a login link. This is not a quote and not cover."
  },
  "servers": [{ "url": "https://cushly.eu" }],
  "paths": {
    "/api/agent": {
      "get": {
        "summary": "Machine card for assistants",
        "operationId": "getAgentCard",
        "responses": { "200": { "description": "Card" } }
      }
    },
    "/api/waitlist": {
      "post": {
        "summary": "Join the waitlist",
        "operationId": "joinWaitlist",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Waitlist" }
            }
          }
        },
        "responses": {
          "200": { "description": "Saved. Human must check email." },
          "400": { "description": "Bad email or country." },
          "429": { "description": "Rate limit." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Waitlist": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "email": { "type": "string", "format": "email" },
          "country": { "type": "string", "description": "ISO 3166-1 alpha-2" },
          "lang": { "type": "string", "description": "ISO 639-1, e.g. de" },
          "fsdPercent": { "type": "integer", "minimum": 0, "maximum": 100 },
          "model": { "type": "string" },
          "notes": { "type": "string" },
          "newsletter": { "type": "boolean" },
          "via": { "type": "string", "enum": ["agent"] },
          "agent": { "type": "string", "maxLength": 80 }
        }
      }
    }
  }
}
