{
  "openapi": "3.1.0",
  "info": {
    "title": "Sapinetra AI agent API",
    "version": "1.0.0",
    "description": "Ask questions about Sapinetra AI and submit business problems for human follow-up. Responses come from approved website content only."
  },
  "servers": [
    {
      "url": "https://www.sapinetra.com"
    }
  ],
  "paths": {
    "/agent/info.json": {
      "get": {
        "operationId": "getInfo",
        "summary": "Company facts, services, products and contact details",
        "responses": {
          "200": {
            "description": "JSON facts"
          }
        }
      }
    },
    "/api/agent/ask": {
      "post": {
        "operationId": "ask",
        "summary": "Ask a question; answered from site content, or handed to a person",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "question"
                ],
                "properties": {
                  "question": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "lang": {
                    "enum": [
                      "en",
                      "hi",
                      "mr"
                    ],
                    "default": "en"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/agent/enquiry": {
      "post": {
        "operationId": "submitEnquiry",
        "summary": "Submit a business problem on behalf of a person, for human follow-up",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "problem",
                  "contact",
                  "consent"
                ],
                "properties": {
                  "problem": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  },
                  "contact": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 30
                      }
                    }
                  },
                  "organisation": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "industry": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "agentName": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "consent": {
                    "type": "boolean",
                    "description": "The person asked you to share these details with Sapinetra AI."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for human follow-up"
          },
          "400": {
            "description": "Invalid"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  }
}