{
  "openapi": "3.0.3",
  "info": {
    "title": "The Logic Blocks (LogicBlocks) — Public REST & Agent API",
    "description": "Public, read-only REST API and machine-readable endpoints for 李瑞 Ray Li / The Logic Blocks (official.thelogicblocks.com). Exposes structured identity, service packages (SEO/GEO 獲客官網, 24H 智能客服導入, 企業 AI 流程整合 / FDE, Marketing Data Agent OS), verified case studies, FAQ items, developer documentation and system health for autonomous AI agents and developers.",
    "version": "1.0.0",
    "contact": {
      "name": "The Logic Blocks (李瑞 Ray Li)",
      "email": "contact@thelogicblocks.com",
      "url": "https://official.thelogicblocks.com/contact"
    },
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://official.thelogicblocks.com",
      "description": "Production Server"
    },
    {
      "url": "http://127.0.0.1:3017",
      "description": "Local Development Server"
    }
  ],
  "tags": [
    { "name": "Content", "description": "Structured content, site metadata and identity" },
    { "name": "Services", "description": "Public service packages, deliverables and pricing tiers" },
    { "name": "Cases", "description": "Verified case studies and engineering deliverables" },
    { "name": "FAQ", "description": "Frequently asked questions and service boundaries" },
    { "name": "System", "description": "Health check and service discovery" }
  ],
  "paths": {
    "/api/site": {
      "get": {
        "tags": ["Content"],
        "operationId": "getSiteContent",
        "summary": "Get all-in-one structured site content",
        "description": "Returns site identity, service catalog, FAQs, contact channels and developer resources.",
        "parameters": [
          {
            "name": "t",
            "in": "query",
            "required": false,
            "description": "Filter by section: identity, services, faq, contact, resources.",
            "schema": {
              "type": "string",
              "enum": ["identity", "services", "faq", "contact", "resources"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured site content returned successfully",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SiteContentResponse" }
              }
            }
          },
          "400": {
            "description": "Invalid query parameter",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/api/services": {
      "get": {
        "tags": ["Services"],
        "operationId": "listServices",
        "summary": "Get service catalog and pricing tiers",
        "description": "Returns available service offerings including SEO/GEO 獲客官網 (NT$25k/55k/128k), 24H 智能客服導入 (NT$30k 起), 企業 AI / FDE, and Marketing Data Agent OS (全渠道專案 NT$28,000).",
        "responses": {
          "200": {
            "description": "Service catalog returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brand": { "type": "string" },
                    "count": { "type": "integer" },
                    "services": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/ServiceDetail" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/cases": {
      "get": {
        "tags": ["Cases"],
        "operationId": "listCases",
        "summary": "Get verified case studies and deliverables",
        "description": "Returns public enterprise case studies with role, metrics, engineering evidence, and boundary disclosures.",
        "responses": {
          "200": {
            "description": "List of case studies returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brand": { "type": "string" },
                    "count": { "type": "integer" },
                    "cases": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/CaseDetail" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/faq": {
      "get": {
        "tags": ["FAQ"],
        "operationId": "getFaq",
        "summary": "Get FAQ items and service boundaries",
        "description": "Returns frequently asked questions regarding FDE, 24H 智能客服, 獲客官網, and cooperation models.",
        "responses": {
          "200": {
            "description": "FAQ items returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brand": { "type": "string" },
                    "count": { "type": "integer" },
                    "faq": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/FaqItem" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": ["System"],
        "operationId": "getHealth",
        "summary": "Health and service readiness check",
        "description": "Returns system health, server timestamp, API version, and discovery links.",
        "responses": {
          "200": {
            "description": "Service is healthy and ready",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HealthResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "status", "hints"],
            "properties": {
              "code": { "type": "string", "example": "not_found" },
              "message": { "type": "string", "example": "The API endpoint does not exist." },
              "status": { "type": "integer", "example": 404 },
              "hints": {
                "type": "array",
                "items": { "type": "string" },
                "example": ["Check /openapi.json for available endpoints.", "Visit /developers for documentation."]
              }
            }
          }
        }
      },
      "SiteContentResponse": {
        "type": "object",
        "properties": {
          "identity": { "$ref": "#/components/schemas/Identity" },
          "services": { "type": "array", "items": { "$ref": "#/components/schemas/ServiceSummary" } },
          "faq": { "type": "array", "items": { "$ref": "#/components/schemas/FaqItem" } },
          "contact": { "$ref": "#/components/schemas/Contact" },
          "resources": { "$ref": "#/components/schemas/Resources" }
        }
      },
      "Identity": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "title": { "type": "string" },
          "location": { "type": "string" },
          "language": { "type": "array", "items": { "type": "string" } },
          "domains": { "type": "array", "items": { "type": "string" } },
          "email": { "type": "string" },
          "privacy": { "type": "string" }
        }
      },
      "ServiceSummary": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "href": { "type": "string" },
          "desc": { "type": "string" }
        }
      },
      "ServiceDetail": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string" },
          "href": { "type": "string" },
          "pricing": { "type": "object" },
          "deliverables": { "type": "array", "items": { "type": "string" } },
          "boundaries": { "type": "string" }
        }
      },
      "CaseDetail": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "eyebrow": { "type": "string" },
          "subtitle": { "type": "string" },
          "role": { "type": "string" },
          "type": { "type": "string" },
          "status": { "type": "string" },
          "period": { "type": "string" },
          "href": { "type": "string" },
          "metrics": { "type": "array", "items": { "type": "object" } },
          "evidence": { "type": "array", "items": { "type": "object" } },
          "capabilities": { "type": "array", "items": { "type": "object" } }
        }
      },
      "FaqItem": {
        "type": "object",
        "required": ["question", "answer"],
        "properties": {
          "question": { "type": "string" },
          "answer": { "type": "string" }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "email": { "type": "string" },
          "line": { "type": "object" },
          "threads": { "type": "string" },
          "freeConsult": { "type": "object" }
        }
      },
      "Resources": {
        "type": "object",
        "properties": {
          "developerPortal": { "type": "string" },
          "llms": { "type": "string" },
          "sitemap": { "type": "string" },
          "robots": { "type": "string" },
          "openapi": { "type": "string" },
          "markdownByNegotiation": { "type": "string" }
        }
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string", "example": "ok" },
          "timestamp": { "type": "string" },
          "brand": { "type": "string" },
          "version": { "type": "string" },
          "environment": { "type": "string" },
          "services": { "type": "object" },
          "links": { "type": "object" }
        }
      }
    }
  }
}
