{
  "openapi": "3.1.0",
  "info": {
    "title": "Atixworld Systems — API pública",
    "version": "1.0.0",
    "description": "API para que agentes de IA e integraciones consulten la oferta de Atixworld Systems y registren solicitudes de contacto comercial. Las solicitudes requieren el consentimiento explícito del titular de los datos (Ley 29733). También disponible como servidor MCP en https://atixworld.com/mcp",
    "contact": {
      "name": "Atixworld Systems",
      "email": "gerenciacomercial@atixworld.com",
      "url": "https://atixworld.com"
    }
  },
  "servers": [
    {
      "url": "https://atixworld.com"
    }
  ],
  "paths": {
    "/catalog.json": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Catálogo completo de líneas, soluciones, necesidades, casos y recursos",
        "responses": {
          "200": {
            "description": "Catálogo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/search-index.json": {
      "get": {
        "operationId": "getSearchIndex",
        "summary": "Índice de páginas del sitio (título, descripción, texto y versión Markdown)",
        "responses": {
          "200": {
            "description": "Índice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/lead.php": {
      "post": {
        "operationId": "createLead",
        "summary": "Registrar una solicitud de contacto (diagnóstico, demo o cotización)",
        "description": "Envíala solo si el usuario lo pidió y aceptó el tratamiento de sus datos. Límite: 5 solicitudes por hora por IP.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Lead"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Solicitud registrada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "reference": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Datos inválidos o sin consentimiento"
          },
          "429": {
            "description": "Demasiadas solicitudes"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Servidor MCP (JSON-RPC 2.0, transporte Streamable HTTP)",
        "description": "Herramientas: list_solutions, get_solution, recommend_solutions, search_site, get_contact_info, request_contact.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Respuesta JSON-RPC"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Lead": {
        "type": "object",
        "required": [
          "name",
          "email",
          "message",
          "consent"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "company": {
            "type": "string",
            "maxLength": 160
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "interest": {
            "type": "string",
            "enum": [
              "",
              "awrisk-cloud",
              "awrisk-on-premise",
              "awrisk-appliance-n1",
              "awrisk-iso-27001",
              "awrisk-lpdp",
              "awrisk-sst",
              "awrisk-control-interno",
              "awrisk-iso-37001",
              "awrisk-sms",
              "cisoaas",
              "isaas",
              "sapaas",
              "grcaas",
              "ti-gestionada",
              "seguridad-digital",
              "ethical-hacking",
              "palo-alto-networks",
              "gfi-languard",
              "terranova-security",
              "implementacion-sgsi",
              "adecuacion-lpdp",
              "ingenieria-riesgos",
              "implementacion-sms",
              "gestion-proyectos",
              "gobierno-transformacion-digital",
              "programa-mgtd",
              "certificacion-awrisk",
              "cursos-iso-pecb"
            ],
            "description": "Id de la solución de interés"
          },
          "message": {
            "type": "string",
            "maxLength": 4000
          },
          "consent": {
            "type": "boolean",
            "const": true,
            "description": "El titular aceptó el tratamiento de sus datos (Ley 29733)"
          },
          "source": {
            "type": "string",
            "description": "Origen: web-form, mcp, api, nombre del agente"
          }
        }
      }
    }
  }
}