{
  "openapi": "3.1.0",
  "info": {
    "title": "SQORI Public Knowledge API",
    "version": "1.1.0",
    "description": "Anonymous, read-only bilingual product information about SQORI. This API does not expose accounts, actions, personal data, OAuth, MCP, or write operations.",
    "termsOfService": "https://sqori.com.sa/responsible-ai/"
  },
  "servers": [
    {
      "url": "https://sqori.com.sa/wp-json/sqori/v1"
    }
  ],
  "security": [],
  "paths": {
    "/knowledge": {
      "get": {
        "operationId": "getSqoriKnowledge",
        "summary": "Get canonical public SQORI information",
        "responses": {
          "200": {
            "description": "Canonical bilingual public product information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Knowledge"
                }
              }
            }
          }
        }
      }
    },
    "/modules": {
      "get": {
        "operationId": "listSqoriModules",
        "summary": "List the five SQORI learning modules",
        "responses": {
          "200": {
            "description": "Bilingual module descriptions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["count", "modules", "updated"],
                  "properties": {
                    "count": { "type": "integer", "const": 5 },
                    "modules": {
                      "type": "array",
                      "minItems": 5,
                      "maxItems": 5,
                      "items": { "$ref": "#/components/schemas/Module" }
                    },
                    "updated": { "type": "string", "format": "date" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchSqoriKnowledge",
        "summary": "Search the small canonical SQORI fact set",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "English or Arabic query between 2 and 120 characters.",
            "schema": { "type": "string", "minLength": 2, "maxLength": 120 }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "minimum": 1, "maximum": 20, "default": 10 }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching canonical public documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["query", "count", "results"],
                  "properties": {
                    "query": { "type": "string" },
                    "count": { "type": "integer" },
                    "results": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/SearchResult" }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid query"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LocalizedText": {
        "type": "object",
        "required": ["en", "ar"],
        "additionalProperties": false,
        "properties": {
          "en": { "type": "string" },
          "ar": { "type": "string" }
        }
      },
      "Module": {
        "type": "object",
        "required": ["slug", "name", "audience", "description"],
        "additionalProperties": false,
        "properties": {
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "audience": { "type": "array", "items": { "type": "string" } },
          "description": { "$ref": "#/components/schemas/LocalizedText" }
        }
      },
      "Knowledge": {
        "type": "object",
        "required": ["name", "url", "positioning", "mission", "founder", "audiences", "languages", "modules", "public_api", "updated"],
        "additionalProperties": false,
        "properties": {
          "name": { "type": "string", "const": "SQORI" },
          "url": { "type": "string", "format": "uri" },
          "positioning": { "$ref": "#/components/schemas/LocalizedText" },
          "mission": { "$ref": "#/components/schemas/LocalizedText" },
          "founder": {
            "type": "object",
            "required": ["name", "role", "linkedin", "bio"],
            "additionalProperties": false,
            "properties": {
              "name": { "type": "string", "const": "Mohamed (AK) Abdel Khalek" },
              "role": { "type": "string", "const": "Founder" },
              "linkedin": { "type": "string", "format": "uri" },
              "bio": { "$ref": "#/components/schemas/LocalizedText" }
            }
          },
          "audiences": { "type": "array", "items": { "type": "string" } },
          "languages": { "type": "array", "items": { "type": "string" } },
          "modules": {
            "type": "array",
            "minItems": 5,
            "maxItems": 5,
            "items": { "$ref": "#/components/schemas/Module" }
          },
          "public_api": {
            "type": "object",
            "required": ["base_url", "openapi", "access", "endpoints"],
            "additionalProperties": false,
            "properties": {
              "base_url": { "type": "string", "format": "uri" },
              "openapi": { "type": "string", "format": "uri" },
              "access": { "type": "string" },
              "endpoints": { "type": "array", "items": { "type": "string" } }
            }
          },
          "updated": { "type": "string", "format": "date" }
        }
      },
      "SearchResult": {
        "type": "object",
        "required": ["id", "type", "title", "description", "url", "keywords"],
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string" },
          "type": { "type": "string", "enum": ["platform", "person", "module"] },
          "title": { "$ref": "#/components/schemas/LocalizedText" },
          "description": { "$ref": "#/components/schemas/LocalizedText" },
          "url": { "type": "string", "format": "uri" },
          "keywords": { "type": "array", "items": { "type": "string" } }
        }
      }
    }
  }
}
