{
  "openapi": "3.1.0",
  "info": {
    "title": "futr.work Modular Pods API",
    "version": "1.0.0",
    "description": "Autonomous edge-native business pods for phone intake, missed-call SMS recovery, speed-to-lead whisper dialers, and reputation growth."
  },
  "servers": [
    {
      "url": "https://futr.work",
      "description": "Production Edge Cloud (Cloudflare Workers)"
    }
  ],
  "paths": {
    "/api/pods": {
      "get": {
        "operationId": "listPods",
        "summary": "List all modular business pods",
        "description": "Returns machine-readable inventory of all specialized pods, capabilities, pricing, and integrations.",
        "responses": {
          "200": {
            "description": "List of available pods",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PodListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/checkout": {
      "post": {
        "operationId": "createCheckout",
        "summary": "Initiate pod deployment checkout session",
        "description": "Generates a secure Stripe billing session to deploy a single pod or managed fleet.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checkout session created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/waitlist": {
      "post": {
        "operationId": "joinWaitlist",
        "summary": "Submit email for pod deployment updates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WaitlistRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Waitlist entry recorded"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PodListResponse": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "count": { "type": "integer" },
          "pricing": {
            "type": "object",
            "properties": {
              "single_pod_monthly_usd": { "type": "number", "example": 49 },
              "managed_fleet_monthly_usd": { "type": "number", "example": 199 }
            }
          },
          "pods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pod"
            }
          }
        }
      },
      "Pod": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string" },
          "tagline": { "type": "string" },
          "status": { "type": "string", "enum": ["built", "planned"] },
          "monthly_price_usd": { "type": "number", "example": 49 },
          "tools": {
            "type": "array",
            "items": { "type": "string" }
          },
          "capabilities": {
            "type": "array",
            "items": { "type": "string" }
          },
          "url": { "type": "string" }
        }
      },
      "CheckoutRequest": {
        "type": "object",
        "required": ["planId"],
        "properties": {
          "planId": {
            "type": "string",
            "enum": ["starter", "pro", "fleet"],
            "description": "starter = single pod ($49/mo), fleet = managed fleet ($199/mo)"
          },
          "email": { "type": "string", "format": "email" }
        }
      },
      "CheckoutResponse": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "url": { "type": "string" }
        }
      },
      "WaitlistRequest": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "email": { "type": "string", "format": "email" },
          "product": { "type": "string" }
        }
      }
    }
  }
}
