{
  "openapi": "3.0.1",
  "info": {
    "title": "Sajjad Alam AI Agent API",
    "description": "API for interacting with Mr. Sajjad Alam's portfolio, service catalog, case studies, and automated lead capture.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://sajjadalam.wholesalehouse2016.in/api"
    }
  ],
  "paths": {
    "/agent.php": {
      "get": {
        "operationId": "getAgentInfo",
        "summary": "Retrieve info, services, or case studies",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["info", "services", "case_studies"],
              "default": "info"
            },
            "description": "The type of information to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful query response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "submitLead",
        "summary": "Submit a business growth or consultation lead",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadSubmissionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead received and registered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string" },
                    "message": { "type": "string" },
                    "lead_id": { "type": "string" },
                    "timestamp": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadSubmissionRequest": {
        "type": "object",
        "required": ["name", "phone"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Client full name or company name"
          },
          "phone": {
            "type": "string",
            "description": "Contact phone number with country code"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Client email address"
          },
          "industry": {
            "type": "string",
            "description": "Business industry or service interested in"
          },
          "message": {
            "type": "string",
            "description": "Detailed project description or goals"
          },
          "agent_source": {
            "type": "string",
            "description": "Originating AI agent name or platform"
          }
        }
      }
    }
  }
}
