{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "API para gerenciamento de dados de cidadãos do Rio de Janeiro, incluindo autodeclaração de informações e verificação de contato.", "title": "API RMI", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "Suporte RMI", "url": "http://www.rio.rj.gov.br", "email": "suporte@rio.rj.gov.br" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "host": "localhost:8080", "basePath": "/v1", "paths": { "/admin/beta/groups": { "get": { "description": "Lista todos os grupos beta com paginação (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Listar grupos beta", "parameters": [ { "type": "integer", "description": "Página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 10)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaGroupListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "description": "Cria um novo grupo beta para o chatbot (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Criar grupo beta", "parameters": [ { "description": "Dados do grupo", "name": "group", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaGroupRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/groups/{group_id}": { "get": { "description": "Obtém um grupo beta por ID (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Obter grupo beta", "parameters": [ { "type": "string", "description": "ID do grupo", "name": "group_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "description": "Atualiza um grupo beta existente (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Atualizar grupo beta", "parameters": [ { "type": "string", "description": "ID do grupo", "name": "group_id", "in": "path", "required": true }, { "description": "Dados do grupo", "name": "group", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaGroupRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "description": "Exclui um grupo beta e remove todas as associações de telefones (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Excluir grupo beta", "parameters": [ { "type": "string", "description": "ID do grupo", "name": "group_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Grupo excluído com sucesso" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist": { "get": { "description": "Lista telefones na whitelist beta com paginação (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Listar telefones na whitelist", "parameters": [ { "type": "integer", "description": "Página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 10)", "name": "per_page", "in": "query" }, { "type": "string", "description": "Filtrar por ID do grupo", "name": "group_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaWhitelistListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/bulk-add": { "post": { "description": "Adiciona múltiplos números de telefone a um grupo beta (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Adicionar múltiplos telefones à whitelist", "parameters": [ { "description": "Dados da operação em lote", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistBulkRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.BetaWhitelistResponse" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/bulk-move": { "post": { "description": "Move múltiplos números de telefone de um grupo beta para outro (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Mover múltiplos telefones entre grupos", "parameters": [ { "description": "Dados da operação de movimentação", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistMoveRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/bulk-remove": { "post": { "description": "Remove múltiplos números de telefone da whitelist beta (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Remover múltiplos telefones da whitelist", "parameters": [ { "description": "Dados da operação em lote", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistBulkRemoveRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/{phone_number}": { "post": { "description": "Adiciona um número de telefone a um grupo beta (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Adicionar telefone à whitelist", "parameters": [ { "type": "string", "description": "Número de telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da whitelist", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaWhitelistResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "description": "Remove um número de telefone da whitelist beta (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Remover telefone da whitelist", "parameters": [ { "type": "string", "description": "Número de telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaWhitelistResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/cache/read": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Permite aos administradores ler qualquer chave do cache Redis para debug e monitoramento", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Ler chave arbitrária do cache Redis", "parameters": [ { "description": "Chave do cache para ler", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CacheReadRequest" } } ], "responses": { "200": { "description": "Dados da chave do cache", "schema": { "$ref": "#/definitions/handlers.CacheReadResponse" } }, "400": { "description": "Parâmetros inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/phone/quarantine/stats": { "get": { "description": "Obtém estatísticas sobre telefones em quarentena (apenas administradores)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Obter estatísticas de quarentena", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.QuarantineStats" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/phone/quarantined": { "get": { "description": "Lista todos os telefones em quarentena com paginação (apenas administradores)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Listar telefones em quarentena", "parameters": [ { "type": "integer", "description": "Página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 10)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.QuarantinedListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/ethnicity/options": { "get": { "description": "Retorna a lista de opções válidas de etnia para autodeclaração. Esta lista é usada para validar as atualizações de etnia autodeclarada.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Listar opções de etnia", "responses": { "200": { "description": "Lista de opções de etnia válidas", "schema": { "type": "array", "items": { "type": "string" } } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera os dados do cidadão por CPF, incluindo informações básicas e dados autodeclarados.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter dados do cidadão", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Dados do cidadão", "schema": { "$ref": "#/definitions/models.Citizen" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/address": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o endereço autodeclarado de um cidadão por CPF. Apenas o campo de endereço é atualizado.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar endereço autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Endereço autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredAddressInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Endereço não alterado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/email": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o email autodeclarado de um cidadão por CPF. Apenas o campo de email é atualizado.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar email autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Email autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredEmailInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Email não alterado (email corresponde aos dados atuais)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/ethnicity": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria a etnia autodeclarada de um cidadão por CPF. Apenas o campo de etnia é atualizado. O valor deve ser uma das opções válidas retornadas pelo endpoint /citizen/ethnicity/options.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar etnia autodeclarada", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Etnia autodeclarada", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredRacaInput" } } ], "responses": { "200": { "description": "Etnia atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de etnia inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/firstlogin": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Verifica se este é o primeiro login do usuário", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter status do primeiro login", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.UserConfigResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Define o status do primeiro login como falso para um usuário", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar status do primeiro login", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.UserConfigResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/maintenance-request": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera os chamados do 1746 de um cidadão por CPF com paginação. Cada documento representa um chamado individual.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter chamados do 1746 do cidadão", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de chamados do 1746", "schema": { "$ref": "#/definitions/models.PaginatedMaintenanceRequests" } }, "400": { "description": "Formato de CPF inválido ou parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/optin": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Verifica se o usuário optou por receber notificações", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter status de opt-in", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.UserConfigOptInResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza o status de opt-in do usuário para notificações", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar status de opt-in", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Status de opt-in", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UserConfigOptInResponse" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.UserConfigOptInResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/phone": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o telefone autodeclarado de um cidadão por CPF. Apenas o campo de telefone é atualizado (armazenado como pendente até verificado).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar telefone autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Telefone autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredPhoneInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Telefone não alterado (telefone corresponde aos dados atuais verificados)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/phone/validate": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Valida o código de verificação enviado para o número de telefone", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Validar verificação de telefone", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Código de verificação e telefone", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.PhoneVerificationValidateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/wallet": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera os dados da carteira do cidadão por CPF, incluindo informações de saúde e outros dados da carteira.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter dados da carteira do cidadão", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Dados da carteira do cidadão", "schema": { "$ref": "#/definitions/models.CitizenWallet" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/config/channels": { "get": { "description": "Obtém a lista de canais disponíveis para comunicação", "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Obter canais disponíveis", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/config/opt-out-reasons": { "get": { "description": "Obtém a lista de motivos válidos para opt-out", "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Obter motivos de opt-out", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/health": { "get": { "description": "Verifica a saúde da API e suas dependências (MongoDB e Redis). Retorna status detalhado para cada serviço.", "produces": [ "application/json" ], "tags": [ "health" ], "summary": "Verificação de saúde", "responses": { "200": { "description": "Todos os serviços estão saudáveis", "schema": { "$ref": "#/definitions/handlers.HealthResponse" } }, "500": { "description": "Um ou mais serviços não estão saudáveis", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/metrics": { "get": { "description": "Expõe métricas Prometheus para monitoramento do sistema", "produces": [ "text/plain" ], "tags": [ "metrics" ], "summary": "Métricas Prometheus", "responses": { "200": { "description": "Métricas Prometheus", "schema": { "type": "string" } } } } }, "/phone/{phone_number}/beta-status": { "get": { "description": "Verifica se um número de telefone está na whitelist beta (com cache)", "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Verificar status beta", "parameters": [ { "type": "string", "description": "Número de telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BetaStatusResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/bind": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Vincula um número de telefone a um CPF sem definir opt-in", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Vincular telefone a CPF", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da vinculação", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BindRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BindResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/citizen": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Obtém informações do cidadão associado a um número de telefone", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Obter cidadão por telefone", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.PhoneCitizenResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/opt-in": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Realiza opt-in para receber notificações", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Realizar opt-in", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados do opt-in", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.OptInRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.OptInResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/opt-out": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Realiza opt-out para parar de receber notificações", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Realizar opt-out", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados do opt-out", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.OptOutRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.OptOutResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/quarantine": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Coloca um número de telefone em quarentena (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Colocar telefone em quarentena", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.QuarantineResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Libera um número de telefone da quarentena (apenas administradores)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Liberar telefone da quarentena", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.QuarantineResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/reject-registration": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Rejeita um registro e bloqueia o mapeamento telefone-CPF", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Rejeitar registro", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da rejeição", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.RejectRegistrationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.RejectRegistrationResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/status": { "get": { "description": "Obtém o status de um número de telefone (quarentena, CPF vinculado, etc.)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Obter status do telefone", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.PhoneStatusResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/validate-registration": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Valida um registro de usuário contra dados base", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Validar registro", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados do registro", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.ValidateRegistrationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ValidateRegistrationResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/v1/avatars": { "get": { "description": "Get paginated list of available profile picture avatars", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars" ], "summary": "List available avatars", "parameters": [ { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page (default: 20, max: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.AvatarsListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new profile picture avatar (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars" ], "summary": "Create a new avatar", "parameters": [ { "description": "Avatar data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.AvatarRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.AvatarResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/v1/avatars/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Soft delete a profile picture avatar (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars" ], "summary": "Delete an avatar", "parameters": [ { "type": "string", "description": "Avatar ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/v1/citizen/{cpf}/avatar": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get the current profile picture avatar for a user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars", "citizen" ], "summary": "Get user's current avatar", "parameters": [ { "type": "string", "description": "User CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.UserAvatarResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Set or change the profile picture avatar for a user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars", "citizen" ], "summary": "Update user's avatar", "parameters": [ { "type": "string", "description": "User CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Avatar selection", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UserAvatarRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.UserAvatarResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/validate/email": { "post": { "description": "Valida formato e estrutura de endereços de email, retornando informações detalhadas sobre o endereço quando válido.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "validation" ], "summary": "Valida endereço de email", "parameters": [ { "description": "Email a ser validado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.EmailValidationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.EmailValidationResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/validate/phone": { "post": { "description": "Valida DDI, DDD e número para qualquer telefone internacional.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "validation" ], "summary": "Valida número de telefone", "parameters": [ { "description": "Telefone a ser validado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.PhoneValidationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.PhoneValidationResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } } }, "definitions": { "handlers.CacheReadRequest": { "type": "object", "required": [ "key" ], "properties": { "key": { "type": "string", "example": "citizen:12345678901" } } }, "handlers.CacheReadResponse": { "type": "object", "properties": { "exists": { "type": "boolean" }, "key": { "type": "string" }, "ttl_seconds": { "type": "integer" }, "value": {} } }, "handlers.EmailValidationRequest": { "description": "Estrutura de entrada contendo o endereço de email a ser validado.", "type": "object", "required": [ "email" ], "properties": { "email": { "description": "Endereço de email a ser validado.\nexample: \"usuario@exemplo.com\"", "type": "string" } } }, "handlers.EmailValidationResponse": { "description": "Resultado da validação, contendo informações sobre o endereço de email quando válido.", "type": "object", "properties": { "domain": { "description": "Domínio do email (após o @)", "type": "string" }, "local_part": { "description": "Parte local do email (antes do @)", "type": "string" }, "message": { "description": "Mensagem de retorno.", "type": "string" }, "normalized": { "description": "Email normalizado (lowercase)", "type": "string" }, "valid": { "description": "Indica se o email é válido.", "type": "boolean" }, "validation_type": { "description": "Tipo de validação aplicada", "type": "string" } } }, "handlers.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "handlers.HealthResponse": { "type": "object", "properties": { "services": { "type": "object", "additionalProperties": { "$ref": "#/definitions/handlers.ServiceHealth" } }, "status": { "type": "boolean" }, "timestamp": { "type": "string" } } }, "handlers.PhoneValidationRequest": { "description": "Estrutura de entrada contendo o número de telefone a ser validado.", "type": "object", "required": [ "phone" ], "properties": { "phone": { "description": "Número de telefone em formato internacional ou nacional.\nexample: \"+55 11 99988-7766\"", "type": "string" } } }, "handlers.PhoneValidationResponse": { "description": "Resultado da validação, contendo a decomposição (DDI, DDD, número) quando válida.", "type": "object", "properties": { "ddd": { "description": "DDD (código de área)", "type": "string" }, "ddi": { "description": "DDI (código do país)", "type": "string" }, "e164": { "description": "Representação E.164 do número", "type": "string" }, "message": { "description": "Mensagem de retorno.", "type": "string" }, "numero": { "description": "Número do assinante", "type": "string" }, "region": { "description": "Região ISO 3166-1 alpha-2", "type": "string" }, "valid": { "description": "Indica se o número é válido.", "type": "boolean" } } }, "handlers.ServiceHealth": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "boolean" }, "timestamp": { "type": "string" } } }, "handlers.SuccessResponse": { "type": "object", "properties": { "message": { "type": "string" } } }, "models.Aluno": { "type": "object", "properties": { "conceito": { "type": "string" }, "frequencia": { "type": "number" }, "indicador": { "type": "boolean" } } }, "models.AssistenciaSocial": { "type": "object", "properties": { "cadunico": { "$ref": "#/definitions/models.CadUnico" }, "cras": { "$ref": "#/definitions/models.CRAS" } } }, "models.AvatarRequest": { "type": "object", "required": [ "name", "url" ], "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1 }, "url": { "type": "string" } } }, "models.AvatarResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "url": { "type": "string" } } }, "models.AvatarsListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.AvatarResponse" } }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "models.BetaGroupListResponse": { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "pagination": { "$ref": "#/definitions/models.PaginationInfo" }, "total_groups": { "type": "integer" } } }, "models.BetaGroupRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "models.BetaGroupResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.BetaStatusResponse": { "type": "object", "properties": { "beta_whitelisted": { "type": "boolean" }, "group_id": { "type": "string" }, "group_name": { "type": "string" }, "phone_number": { "type": "string" } } }, "models.BetaWhitelistBulkRemoveRequest": { "type": "object", "required": [ "phone_numbers" ], "properties": { "phone_numbers": { "type": "array", "items": { "type": "string" } } } }, "models.BetaWhitelistBulkRequest": { "type": "object", "required": [ "group_id", "phone_numbers" ], "properties": { "group_id": { "type": "string" }, "phone_numbers": { "type": "array", "items": { "type": "string" } } } }, "models.BetaWhitelistListResponse": { "type": "object", "properties": { "pagination": { "$ref": "#/definitions/models.PaginationInfo" }, "total_count": { "type": "integer" }, "whitelisted": { "type": "array", "items": { "$ref": "#/definitions/models.BetaWhitelistResponse" } } } }, "models.BetaWhitelistMoveRequest": { "type": "object", "required": [ "from_group_id", "phone_numbers", "to_group_id" ], "properties": { "from_group_id": { "type": "string" }, "phone_numbers": { "type": "array", "items": { "type": "string" } }, "to_group_id": { "type": "string" } } }, "models.BetaWhitelistRequest": { "type": "object", "required": [ "group_id" ], "properties": { "group_id": { "type": "string" } } }, "models.BetaWhitelistResponse": { "type": "object", "properties": { "added_at": { "type": "string" }, "group_id": { "type": "string" }, "group_name": { "type": "string" }, "phone_number": { "type": "string" } } }, "models.BindRequest": { "type": "object", "required": [ "channel", "cpf" ], "properties": { "channel": { "type": "string" }, "cpf": { "type": "string" } } }, "models.BindResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "message": { "type": "string" }, "opt_in": { "type": "boolean" }, "phone_number": { "type": "string" }, "status": { "type": "string" } } }, "models.CRAS": { "type": "object", "properties": { "endereco": { "type": "string" }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.CadUnico": { "type": "object", "properties": { "data_cadastro": { "type": "string" }, "data_limite_cadastro_atual": { "type": "string" }, "data_ultima_atualizacao": { "type": "string" }, "indicador": { "type": "boolean" }, "status_cadastral": { "type": "string" } } }, "models.Citizen": { "type": "object", "properties": { "_id": { "type": "string" }, "assistencia_social": { "$ref": "#/definitions/models.AssistenciaSocial" }, "cpf": { "type": "string" }, "documentos": { "description": "Wallet and internal fields", "allOf": [ { "$ref": "#/definitions/models.Documentos" } ] }, "educacao": { "$ref": "#/definitions/models.Educacao" }, "email": { "$ref": "#/definitions/models.Email" }, "endereco": { "$ref": "#/definitions/models.Endereco" }, "mae": { "$ref": "#/definitions/models.Mae" }, "menor_idade": { "type": "boolean" }, "nascimento": { "$ref": "#/definitions/models.Nascimento" }, "nome": { "type": "string" }, "nome_social": { "type": "string" }, "obito": { "$ref": "#/definitions/models.Obito" }, "raca": { "type": "string" }, "saude": { "$ref": "#/definitions/models.Saude" }, "sexo": { "type": "string" }, "telefone": { "$ref": "#/definitions/models.Telefone" } } }, "models.CitizenWallet": { "type": "object", "properties": { "assistencia_social": { "$ref": "#/definitions/models.AssistenciaSocial" }, "cpf": { "type": "string" }, "documentos": { "$ref": "#/definitions/models.Documentos" }, "educacao": { "$ref": "#/definitions/models.Educacao" }, "saude": { "$ref": "#/definitions/models.Saude" } } }, "models.ClinicaFamilia": { "type": "object", "properties": { "email": { "type": "string" }, "endereco": { "type": "string" }, "fonte": { "description": "\"bigquery\" or \"mcp\" - not stored in DB, populated at response time", "type": "string" }, "horario_atendimento": { "type": "string" }, "id_cnes": { "type": "string" }, "indicador": { "type": "boolean" }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.Documentos": { "type": "object", "properties": { "cns": { "type": "array", "items": { "type": "string" } } } }, "models.Educacao": { "type": "object", "properties": { "aluno": { "$ref": "#/definitions/models.Aluno" }, "escola": { "$ref": "#/definitions/models.Escola" } } }, "models.Email": { "type": "object", "properties": { "alternativo": { "type": "array", "items": { "$ref": "#/definitions/models.EmailAlternativo" } }, "indicador": { "type": "boolean" }, "principal": { "$ref": "#/definitions/models.EmailPrincipal" } } }, "models.EmailAlternativo": { "type": "object", "properties": { "origem": { "type": "string" }, "sistema": { "type": "string" }, "valor": { "type": "string" } } }, "models.EmailPrincipal": { "type": "object", "properties": { "origem": { "type": "string" }, "sistema": { "type": "string" }, "updated_at": { "type": "string" }, "valor": { "type": "string" } } }, "models.Endereco": { "type": "object", "properties": { "alternativo": { "type": "array", "items": { "$ref": "#/definitions/models.EnderecoAlternativo" } }, "indicador": { "type": "boolean" }, "principal": { "$ref": "#/definitions/models.EnderecoPrincipal" } } }, "models.EnderecoAlternativo": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "latitude": { "type": "string" }, "logradouro": { "type": "string" }, "longitude": { "type": "string" }, "municipio": { "type": "string" }, "numero": { "type": "string" }, "origem": { "type": "string" }, "pluscode": { "type": "string" }, "sistema": { "type": "string" }, "tipo_logradouro": { "type": "string" } } }, "models.EnderecoPrincipal": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "logradouro": { "type": "string" }, "municipio": { "type": "string" }, "numero": { "type": "string" }, "origem": { "type": "string" }, "sistema": { "type": "string" }, "tipo_logradouro": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.EquipeSaudeFamilia": { "type": "object", "properties": { "enfermeiros": { "type": "array", "items": { "$ref": "#/definitions/models.ProfissionalSaude" } }, "id_ine": { "type": "string" }, "indicador": { "type": "boolean" }, "medicos": { "type": "array", "items": { "$ref": "#/definitions/models.ProfissionalSaude" } }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.Escola": { "type": "object", "properties": { "email": { "type": "string" }, "endereco": { "type": "string" }, "horario_funcionamento": { "type": "string" }, "nome": { "type": "string" }, "telefone": { "type": "string" }, "whatsapp": { "type": "string" } } }, "models.Mae": { "type": "object", "properties": { "cpf": { "type": "string" }, "nome": { "type": "string" } } }, "models.MaintenanceRequest": { "type": "object", "properties": { "categoria": { "type": "string" }, "cpf": { "type": "string" }, "data_alvo_diagnostico": { "type": "string" }, "data_alvo_finalizacao": { "type": "string" }, "data_fim": { "type": "string" }, "data_inicio": { "type": "string" }, "data_real_diagnostico": { "type": "string" }, "dentro_prazo": { "type": "string" }, "descricao": { "type": "string" }, "endereco": { "description": "Human-readable address, built on demand", "type": "string" }, "id": { "type": "string" }, "id_bairro": { "type": "string" }, "id_chamado": { "type": "string" }, "id_logradouro": { "type": "string" }, "id_origem_ocorrencia": { "type": "string" }, "id_subtipo": { "type": "string" }, "id_territorialidade": { "type": "string" }, "id_tipo": { "type": "string" }, "id_unidade_organizacional": { "type": "string" }, "id_unidade_organizacional_mae": { "type": "string" }, "indicador": { "type": "boolean" }, "justificativa_status": {}, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "nome_unidade_organizacional": { "type": "string" }, "numero_logradouro": { "type": "integer" }, "origem_ocorrencia": { "type": "string" }, "prazo_tipo": { "type": "string" }, "prazo_unidade": { "type": "string" }, "reclamacoes": { "type": "integer" }, "situacao": { "type": "string" }, "status": { "type": "string" }, "subtipo": { "type": "string" }, "tempo_prazo": {}, "tipo": { "type": "string" }, "tipo_situacao": { "type": "string" }, "total_chamados": { "type": "integer" }, "total_fechados": { "type": "integer" }, "unidade_organizacional_ouvidoria": { "type": "string" } } }, "models.Nascimento": { "type": "object", "properties": { "data": { "type": "string" }, "municipio": { "type": "string" }, "municipio_id": { "type": "string" }, "pais": { "type": "string" }, "pais_id": { "type": "string" }, "uf": { "type": "string" } } }, "models.Obito": { "type": "object", "properties": { "ano": { "type": "integer" }, "indicador": { "type": "boolean" } } }, "models.OptInRequest": { "type": "object", "required": [ "channel", "cpf" ], "properties": { "channel": { "type": "string" }, "cpf": { "type": "string" }, "validation_result": { "$ref": "#/definitions/models.ValidationResult" } } }, "models.OptInResponse": { "type": "object", "properties": { "phone_mapping_id": { "type": "string" }, "status": { "type": "string" } } }, "models.OptOutRequest": { "type": "object", "required": [ "channel", "reason" ], "properties": { "channel": { "type": "string" }, "reason": { "type": "string" } } }, "models.OptOutResponse": { "type": "object", "properties": { "status": { "type": "string" } } }, "models.PaginatedMaintenanceRequests": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.MaintenanceRequest" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } } } }, "models.PaginationInfo": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "models.PhoneCitizenResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "first_name": { "type": "string" }, "found": { "type": "boolean" }, "name": { "type": "string" } } }, "models.PhoneStatusResponse": { "type": "object", "properties": { "beta_group_id": { "type": "string" }, "beta_group_name": { "type": "string" }, "beta_whitelisted": { "type": "boolean" }, "cpf": { "type": "string" }, "found": { "type": "boolean" }, "name": { "type": "string" }, "opted_out": { "type": "boolean" }, "phone_number": { "type": "string" }, "quarantine_until": { "type": "string" }, "quarantined": { "type": "boolean" } } }, "models.PhoneVerificationValidateRequest": { "type": "object", "required": [ "code", "ddd", "ddi", "valor" ], "properties": { "code": { "type": "string" }, "ddd": { "type": "string" }, "ddi": { "type": "string" }, "valor": { "type": "string" } } }, "models.ProfissionalSaude": { "type": "object", "properties": { "id_profissional_sus": { "type": "string" }, "nome": { "type": "string" } } }, "models.QuarantineResponse": { "type": "object", "properties": { "message": { "type": "string" }, "phone_number": { "type": "string" }, "quarantine_until": { "type": "string" }, "status": { "type": "string" } } }, "models.QuarantineStats": { "type": "object", "properties": { "active_quarantines": { "type": "integer" }, "expired_quarantines": { "type": "integer" }, "quarantine_history_total": { "type": "integer" }, "quarantines_with_cpf": { "type": "integer" }, "quarantines_without_cpf": { "type": "integer" }, "total_quarantined": { "type": "integer" } } }, "models.QuarantinedListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.QuarantinedPhone" } }, "pagination": { "$ref": "#/definitions/models.PaginationInfo" } } }, "models.QuarantinedPhone": { "type": "object", "properties": { "cpf": { "type": "string" }, "expired": { "type": "boolean" }, "phone_number": { "type": "string" }, "quarantine_until": { "type": "string" } } }, "models.RejectRegistrationRequest": { "type": "object", "required": [ "channel", "cpf", "reason" ], "properties": { "channel": { "type": "string" }, "cpf": { "type": "string" }, "reason": { "type": "string" } } }, "models.RejectRegistrationResponse": { "type": "object", "properties": { "status": { "type": "string" } } }, "models.Saude": { "type": "object", "properties": { "clinica_familia": { "$ref": "#/definitions/models.ClinicaFamilia" }, "equipe_saude_familia": { "$ref": "#/definitions/models.EquipeSaudeFamilia" } } }, "models.SelfDeclaredAddressInput": { "type": "object", "required": [ "bairro", "cep", "estado", "logradouro", "municipio", "numero" ], "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "logradouro": { "type": "string" }, "municipio": { "type": "string" }, "numero": { "type": "string" }, "tipo_logradouro": { "type": "string" } } }, "models.SelfDeclaredEmailInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredPhoneInput": { "type": "object", "required": [ "ddi", "valor" ], "properties": { "ddd": { "description": "DDD é obrigatório somente quando o DDI é 55 (Brasil)", "type": "string" }, "ddi": { "type": "string" }, "valor": { "type": "string" } } }, "models.SelfDeclaredRacaInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.Telefone": { "type": "object", "properties": { "alternativo": { "type": "array", "items": { "$ref": "#/definitions/models.TelefoneAlternativo" } }, "indicador": { "type": "boolean" }, "principal": { "$ref": "#/definitions/models.TelefonePrincipal" } } }, "models.TelefoneAlternativo": { "type": "object", "properties": { "ddd": { "type": "string" }, "ddi": { "type": "string" }, "origem": { "type": "string" }, "sistema": { "type": "string" }, "valor": { "type": "string" } } }, "models.TelefonePrincipal": { "type": "object", "properties": { "ddd": { "type": "string" }, "ddi": { "type": "string" }, "origem": { "type": "string" }, "sistema": { "type": "string" }, "updated_at": { "type": "string" }, "valor": { "type": "string" } } }, "models.UserAvatarRequest": { "type": "object", "properties": { "avatar_id": { "type": "string" } } }, "models.UserAvatarResponse": { "type": "object", "properties": { "avatar": { "$ref": "#/definitions/models.AvatarResponse" }, "avatar_id": { "type": "string" } } }, "models.UserConfigOptInResponse": { "type": "object", "properties": { "opt_in": { "type": "boolean" } } }, "models.UserConfigResponse": { "type": "object", "properties": { "firstlogin": { "type": "boolean" } } }, "models.ValidateRegistrationRequest": { "type": "object", "required": [ "birth_date", "channel", "cpf", "name" ], "properties": { "birth_date": { "type": "string" }, "channel": { "type": "string" }, "cpf": { "type": "string" }, "name": { "type": "string" } } }, "models.ValidateRegistrationResponse": { "type": "object", "properties": { "matched_cpf": { "type": "string" }, "matched_name": { "type": "string" }, "valid": { "type": "boolean" } } }, "models.ValidationResult": { "type": "object", "properties": { "valid": { "type": "boolean" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Tipo: Bearer token. Exemplo: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "type": "apiKey", "name": "Authorization", "in": "header" } }, "tags": [ { "description": "Operações relacionadas a cidadãos, incluindo consulta e atualização de dados autodeclarados", "name": "citizen" }, { "description": "Operações de verificação de saúde da API", "name": "health" } ] }