{
  "openapi": "3.1.0",
  "info": {
    "title": "API pública da WBX Serviços",
    "version": "1.0.0",
    "summary": "Dados públicos da empresa, produtos e páginas do site, somente leitura.",
    "description": "API sem autenticação, para agentes de IA e integrações. Todas as respostas são JSON em UTF-8 e podem ser lidas de qualquer origem (CORS liberado). Não há preços: cada projeto recebe proposta sob medida. Documentação: https://wbxservicos.com.br/desenvolvedores",
    "contact": { "name": "WBX Serviços", "email": "suporte@wbxservicos.com.br", "url": "https://wbxservicos.com.br/contato" }
  },
  "servers": [{ "url": "https://wbxservicos.com.br/api/v1" }],
  "externalDocs": { "description": "Documentação para desenvolvedores", "url": "https://wbxservicos.com.br/desenvolvedores" },
  "paths": {
    "/empresa.json": {
      "get": {
        "operationId": "obterEmpresa",
        "summary": "Dados da empresa e canais de contato",
        "responses": {
          "200": { "description": "Dados da empresa", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empresa" } } } }
        }
      }
    },
    "/produtos.json": {
      "get": {
        "operationId": "listarProdutos",
        "summary": "Produtos e serviços",
        "responses": {
          "200": {
            "description": "Lista de produtos",
            "content": { "application/json": { "schema": { "type": "object", "required": ["produtos"], "properties": { "produtos": { "type": "array", "items": { "$ref": "#/components/schemas/Produto" } } } } } }
          }
        }
      }
    },
    "/paginas.json": {
      "get": {
        "operationId": "listarPaginas",
        "summary": "Páginas do site, com link para a versão em Markdown",
        "responses": {
          "200": {
            "description": "Lista de páginas",
            "content": { "application/json": { "schema": { "type": "object", "required": ["paginas"], "properties": { "paginas": { "type": "array", "items": { "$ref": "#/components/schemas/Pagina" } } } } } }
          }
        }
      }
    },
    "/saude": {
      "get": {
        "operationId": "verificarSaude",
        "summary": "Estado da API (health check)",
        "responses": {
          "200": { "description": "API funcionando", "content": { "application/health+json": { "schema": { "$ref": "#/components/schemas/Saude" } } } },
          "503": { "description": "API com problema", "content": { "application/health+json": { "schema": { "$ref": "#/components/schemas/Saude" } } } }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Empresa": {
        "type": "object",
        "required": ["nome", "site", "contato"],
        "properties": {
          "nome": { "type": "string" },
          "site": { "type": "string", "format": "uri" },
          "anosNoMercado": { "type": "integer" },
          "descricao": { "type": "string" },
          "endereco": {
            "type": "object",
            "properties": { "logradouro": { "type": "string" }, "cidade": { "type": "string" }, "uf": { "type": "string" }, "pais": { "type": "string" } }
          },
          "contato": {
            "type": "object",
            "properties": {
              "telefone": { "type": "string" },
              "whatsapp": { "type": "string" },
              "whatsappUrl": { "type": "string", "format": "uri" },
              "email": { "type": "string", "format": "email" },
              "formulario": { "type": "string", "format": "uri" }
            }
          },
          "atendimento": {
            "type": "object",
            "properties": { "comercial": { "type": "string" }, "suporte": { "type": "string" }, "respostaComercial": { "type": "string" }, "abrangencia": { "type": "string" } }
          },
          "precos": { "type": "string" }
        }
      },
      "Produto": {
        "type": "object",
        "required": ["id", "nome", "descricao", "url"],
        "properties": {
          "id": { "type": "string", "examples": ["servidores"] },
          "nome": { "type": "string" },
          "nomeCurto": { "type": "string" },
          "descricao": { "type": "string" },
          "destaque": { "type": "boolean" },
          "url": { "type": "string", "format": "uri" },
          "markdown": { "type": "string", "format": "uri" },
          "solicitarProposta": { "type": "string", "format": "uri" }
        }
      },
      "Pagina": {
        "type": "object",
        "required": ["slug", "titulo", "url", "markdown"],
        "properties": {
          "slug": { "type": "string", "examples": ["inicio", "servidores"] },
          "titulo": { "type": "string" },
          "descricao": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "markdown": { "type": "string", "format": "uri" },
          "arquivo": { "type": "string" },
          "tokens": { "type": "integer", "description": "Estimativa de tokens da versão em Markdown" }
        }
      },
      "Saude": {
        "type": "object",
        "required": ["status"],
        "properties": {
          "status": { "type": "string", "enum": ["pass", "fail"] },
          "version": { "type": "string" },
          "serviceId": { "type": "string" },
          "description": { "type": "string" },
          "checks": { "type": "object" }
        }
      }
    }
  }
}
