{ "openapi": "3.0.0", "info": { "title": "API k-test", "version": "1.0.0", "description": "Documentação da API k-test" }, "servers": [ { "url": "https://k-test.onrender.com", "description": "Servidor de produção" }, { "url": "http://localhost:3000", "description": "Servidor local" } ], "paths": { "/api/v1/auth/register": { "post": { "summary": "Registrar um novo usuário", "tags": ["Autenticação"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "João Silva" }, "email": { "type": "string", "example": "joao@example.com" }, "phone": { "type": "string", "example": "123456789" }, "password": { "type": "string", "example": "senha123" } }, "required": ["name", "email", "phone", "password"] } } } }, "responses": { "201": { "description": "Usuário criado com sucesso" }, "400": { "description": "Erro ao criar o usuário" } } } }, "/api/v1/auth/login": { "post": { "summary": "Login de usuário", "tags": ["Autenticação"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "example": "joao@example.com" }, "password": { "type": "string", "example": "senha123" } }, "required": ["email", "password"] } } } }, "responses": { "200": { "description": "Login bem-sucedido. Retorna um token", "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string", "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } } } } } }, "401": { "description": "Credenciais inválidas" } } } }, "/api/v1/chat/conversation": { "post": { "summary": "Enviar uma pergunta ao chat", "tags": ["Chat"], "security": [ { "bearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "question": { "type": "string", "example": "Qual é a capital da Itália?" } }, "required": ["question"] } } } }, "responses": { "200": { "description": "Retorna a pergunta e a resposta do chat", "content": { "application/json": { "schema": { "type": "object", "properties": { "question": { "type": "string", "example": "Qual é a capital da Itália?" }, "answer": { "type": "string", "example": "A capital da Itália é Roma." } } } } } }, "401": { "description": "Token inválido ou não fornecido" } } } }, "/api/v1/manage/clients": { "get": { "summary": "Listar todos os clientes cadastrados", "tags": ["Gerenciamento"], "responses": { "200": { "description": "Retorna a lista de clientes", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "example": "João Silva" }, "email": { "type": "string", "example": "joao@example.com" }, "phone": { "type": "string", "example": "123456789" } } } } } } } } } }, "/api/v1/manage/clients/{id}": { "delete": { "summary": "Deletar um cliente por ID", "tags": ["Gerenciamento"], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "ID do cliente a ser deletado", "schema": { "type": "string", "example": "60c72b2f4f1a4e001c3f4321" } } ], "responses": { "200": { "description": "Cliente deletado com sucesso" }, "404": { "description": "Cliente não encontrado" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } } }