{
  "openapi": "3.1.0",
  "info": {
    "title": "Institute of Cognitive Behavior Therapy (ICBT) API",
    "version": "1.0.0",
    "description": "Comprehensive REST and Agentic API for ICBT courses, workshops, events, blogs, faculty, and clinical admissions."
  },
  "servers": [
    { "url": "https://icbt.org.pk", "description": "Production Server" },
    { "url": "http://localhost:3000", "description": "Local Development Server" }
  ],
  "paths": {
    "/api/public/courses": {
      "get": {
        "summary": "Get all active courses",
        "responses": {
          "200": { "description": "List of courses" }
        }
      }
    },
    "/api/public/workshops": {
      "get": {
        "summary": "Get all active workshops",
        "responses": {
          "200": { "description": "List of workshops" }
        }
      }
    },
    "/api/public/workshops/{slug}": {
      "get": {
        "summary": "Get workshop by slug",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Workshop details" },
          "404": { "description": "Workshop not found" }
        }
      }
    },
    "/api/public/events": {
      "get": {
        "summary": "Get all active events",
        "responses": {
          "200": { "description": "List of events" }
        }
      }
    },
    "/api/public/blogs": {
      "get": {
        "summary": "Get all active blog articles",
        "responses": {
          "200": { "description": "List of blog articles" }
        }
      }
    },
    "/api/public/teams": {
      "get": {
        "summary": "Get faculty and team members",
        "responses": {
          "200": { "description": "List of team members" }
        }
      }
    },
    "/api/search": {
      "get": {
        "summary": "Full-text search across ICBT courses, workshops, events, and blogs",
        "parameters": [
          { "name": "q", "in": "query", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Matching results" }
        }
      }
    },
    "/api/contact": {
      "post": {
        "summary": "Submit contact or inquiry message",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": { "type": "string" },
                  "email": { "type": "string" },
                  "phone": { "type": "string" },
                  "subject": { "type": "string" },
                  "message": { "type": "string" }
                },
                "required": ["name", "email", "message"]
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Inquiry submitted successfully" }
        }
      }
    },
    "/api/membership": {
      "post": {
        "summary": "Submit membership application",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": { "type": "string" },
                  "email": { "type": "string" },
                  "phone": { "type": "string" },
                  "details": { "type": "string" }
                },
                "required": ["name", "email", "phone"]
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Membership application received" }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "summary": "Execute MCP tools for AI agents",
        "responses": {
          "200": { "description": "Tool execution result" }
        }
      }
    }
  }
}
