{
  "openapi": "3.0.3",
  "info": {
    "title": "CRM API",
    "version": "v1",
    "description": "API REST principal del CRM para integraciones externas y módulos."
  },
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "tags": [
    { "name": "System" },
    { "name": "Capabilities" },
    { "name": "Clients" },
    { "name": "Prospects" },
    { "name": "Webhooks" },
    { "name": "Tickets" }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": { "type": "http", "scheme": "bearer" },
      "ApiKeyHeader": { "type": "apiKey", "in": "header", "name": "X-API-Key" }
    },
    "schemas": {
      "ApiSuccess": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean", "example": true },
          "message": { "type": "string", "example": "OK" },
          "data": { "type": "object" },
          "request_id": { "type": "string", "example": "req_2f9bb476c0f4" }
        }
      }
    }
  },
  "paths": {
    "/ping": {
      "get": {
        "tags": ["System"],
        "summary": "Health check",
        "responses": { "200": { "description": "Servicio operativo" } }
      }
    },
    "/capabilities": {
      "get": {
        "tags": ["Capabilities"],
        "summary": "Capacidades de la API key y módulos habilitados",
        "responses": { "200": { "description": "Capacidades disponibles" } }
      }
    }
  }
}