{
  "openapi": "3.1.0",
  "info": {
    "title": "FlowDesk Agent API",
    "version": "1.0.0",
    "description": "Machine-readable API for AI agents to evaluate FlowDesk and provision a trial on behalf of a human. Read endpoints are unauthenticated. No payment data is ever accepted via the API — checkout is always human-confirmed.",
    "contact": { "name": "FlowDesk", "url": "https://flowdesk-landing-2yz.pages.dev" }
  },
  "servers": [{ "url": "https://flowdesk-landing-2yz.pages.dev" }],
  "paths": {
    "/api/v1/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Get all plans and prices",
        "description": "Returns every plan with price, currency, billing unit, trial terms, and per-plan limits as structured JSON.",
        "security": [],
        "responses": {
          "200": {
            "description": "Plans and prices",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pricing" } } }
          }
        }
      }
    },
    "/api/v1/features": {
      "get": {
        "operationId": "getFeatures",
        "summary": "Get the capability matrix",
        "description": "Returns FlowDesk's feature/capability matrix for comparison and evaluation.",
        "security": [],
        "responses": { "200": { "description": "Capability matrix", "content": { "application/json": { "schema": { "type": "object" } } } } }
      }
    },
    "/api/v1/trials": {
      "post": {
        "operationId": "startTrial",
        "summary": "Provision a 14-day Pro trial (waitlist mode)",
        "description": "Records a trial signup for a human user. A confirmation email is sent to the human; the workspace activates only after they confirm. NO payment data is accepted here — any paid checkout is completed by the human.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email"],
                "properties": {
                  "email": { "type": "string", "format": "email", "description": "The human user's email." },
                  "agent_id": { "type": "string", "description": "Optional identifier for the calling agent (attribution)." }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Trial signup recorded; awaiting human confirmation",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "signup_id": { "type": "string" },
                "status": { "type": "string", "example": "pending_confirmation" },
                "next_step": { "type": "string" },
                "human_confirmation": { "type": "string", "example": "required" }
              }
            } } }
          },
          "409": { "description": "Email already on the waitlist" },
          "422": { "description": "Invalid email, or payment data was (incorrectly) supplied — not accepted here" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Pricing": {
        "type": "object",
        "properties": {
          "updated": { "type": "string" },
          "currency": { "type": "string" },
          "plans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": { "type": "string" },
                "name": { "type": "string" },
                "price": { "type": "number" },
                "unit": { "type": "string", "nullable": true },
                "trial_days": { "type": "integer", "nullable": true },
                "card_required": { "type": "boolean" }
              }
            }
          }
        }
      }
    }
  }
}
