{
  "openapi": "3.1.0",
  "info": {
    "title": "Palar Group Public AI Discovery API",
    "version": "1.0.0",
    "description": "Read-only owner-curated public catalog. Private EKH, credentials, inquiries, audit logs, proposals, internal notes, and operational records are excluded."
  },
  "servers": [{ "url": "https://palar.group/api/public/v1" }],
  "paths": {
    "/catalog": {
      "get": {
        "summary": "List published public catalog items",
        "parameters": [
          { "name": "type", "in": "query", "schema": { "type": "string", "enum": ["service", "product", "pricing", "location", "capability", "faq", "offer"] } },
          { "name": "location", "in": "query", "schema": { "type": "string", "maxLength": 100 } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }
        ],
        "responses": { "200": { "description": "Public catalog results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogResponse" } } } } }
      }
    },
    "/search": {
      "get": {
        "summary": "Search public services, products, pricing guidance, capabilities, and locations",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string", "maxLength": 120 } },
          { "name": "type", "in": "query", "schema": { "type": "string", "enum": ["service", "product", "pricing", "location", "capability", "faq", "offer"] } },
          { "name": "location", "in": "query", "schema": { "type": "string", "maxLength": 100 } }
        ],
        "responses": { "200": { "description": "Search results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogResponse" } } } } }
      }
    },
    "/services": { "get": { "summary": "List public services and capabilities", "responses": { "200": { "description": "Public service results" } } } },
    "/products": { "get": { "summary": "List public products", "responses": { "200": { "description": "Public product results" } } } },
    "/pricing": { "get": { "summary": "List public pricing and quotation guidance", "responses": { "200": { "description": "Public pricing guidance" } } } },
    "/locations": { "get": { "summary": "List public service and business locations", "responses": { "200": { "description": "Public location results" } } } },
    "/content/{slug}": {
      "get": {
        "summary": "Get one public catalog item",
        "parameters": [{ "name": "slug", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,159}$" } }],
        "responses": { "200": { "description": "Public catalog item" }, "404": { "description": "Published public item not found" } }
      }
    }
  },
  "components": {
    "schemas": {
      "CatalogItem": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "slug": { "type": "string" },
          "content_type": { "type": "string" },
          "title": { "type": "string" },
          "summary": { "type": "string" },
          "description": { "type": "string" },
          "price_label": { "type": ["string", "null"] },
          "price_min": { "type": ["number", "null"] },
          "price_max": { "type": ["number", "null"] },
          "currency": { "type": "string" },
          "locations": { "type": "array", "items": { "type": "string" } },
          "keywords": { "type": "array", "items": { "type": "string" } },
          "cta_label": { "type": ["string", "null"] },
          "cta_url": { "type": ["string", "null"] },
          "published_at": { "type": ["string", "null"] },
          "updated_at": { "type": "string" }
        }
      },
      "CatalogResponse": {
        "type": "object",
        "properties": {
          "status": { "const": "success" },
          "count": { "type": "integer" },
          "data": { "type": "array", "items": { "$ref": "#/components/schemas/CatalogItem" } }
        }
      }
    }
  }
}
