{
  "openapi": "3.1.0",
  "info": {
    "title": "daygauge Landing API",
    "version": "0.1.0",
    "description": "Public waitlist API for the daygauge landing page."
  },
  "servers": [
    {
      "url": "https://daygauge.com"
    }
  ],
  "paths": {
    "/api/waitlist": {
      "post": {
        "operationId": "joinWaitlist",
        "summary": "Join the daygauge waitlist",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email"],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "stage": {
                    "type": "string",
                    "description": "Optional client stage marker."
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Waitlist signup accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "405": {
            "description": "Method not allowed"
          }
        }
      }
    },
    "/api/auth/google": {
      "get": {
        "operationId": "startGoogleWaitlistSignup",
        "summary": "Start Google OAuth signup for the daygauge waitlist",
        "description": "Redirects the user to Google OAuth when GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET are configured. If credentials are missing, redirects back to the waitlist with a non-fatal status message.",
        "responses": {
          "302": {
            "description": "Redirect to Google OAuth or the waitlist status page"
          }
        }
      }
    },
    "/api/auth/google/callback": {
      "get": {
        "operationId": "completeGoogleWaitlistSignup",
        "summary": "Complete Google OAuth signup for the daygauge waitlist",
        "description": "Exchanges the OAuth code for the user's email, records the waitlist signup, sends notifications and redirects back to the waitlist.",
        "responses": {
          "302": {
            "description": "Redirect to the waitlist with success or error status"
          }
        }
      }
    }
  }
}
