{
  "openapi": "3.0.4",
  "info": {
    "title": "Consultas Hub — API de consumo",
    "description": "API para outros sistemas executarem as consultas do hub (CPF, CNPJ, processos, sanções,\nfundos, eleitoral) e receberem o resultado num envelope padronizado.\n\n**Guia de integração completo:** [https://api.jabuticaba.cloud/docs/](https://api.jabuticaba.cloud/docs/)\n\n1. Peça ao administrador do hub um `client_id` e `client_secret`.\n2. Obtenha o token: `POST https://api.jabuticaba.cloud/connect/token` com\n   `grant_type=client_credentials&client_id=…&client_secret=…&scope=ConsultasHub`.\n3. Chame os endpoints com `Authorization: Bearer <access_token>`.\n\nAqui mesmo: **Authorize** → `client_credentials` → informe client_id e client_secret.\nBasta o token válido: consultas pagas executam direto, e o custo fica registrado na auditoria.",
    "version": "v1"
  },
  "paths": {
    "/api/v1/consultas": {
      "get": {
        "tags": [
          "Consultas"
        ],
        "summary": "Catalogo completo. Cada consulta traz o que recebe, o schema que devolve, e todas as\nfontes com seu custo — inclusive as declaradas mas ainda nao implementadas.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Consultas.ConsultaCatalogoDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Consultas.ConsultaCatalogoDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Consultas.ConsultaCatalogoDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/consultas/{consultaId}": {
      "get": {
        "tags": [
          "Consultas"
        ],
        "summary": "Detalhe de uma consulta do catalogo.",
        "parameters": [
          {
            "name": "consultaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Consultas.ConsultaCatalogoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Consultas.ConsultaCatalogoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Consultas.ConsultaCatalogoDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Consultas"
        ],
        "summary": "Executa a consulta. A resposta traz os dados no schema canonico e, em `meta`, a\nprocedencia: provedor que respondeu, URL de origem, data de referencia do dado e custo.",
        "parameters": [
          {
            "name": "consultaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarConsultaInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarConsultaInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarConsultaInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Consultas.EnvelopeConsultaDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Consultas.EnvelopeConsultaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Consultas.EnvelopeConsultaDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/consultas/{consultaId}/lote": {
      "post": {
        "tags": [
          "Consultas"
        ],
        "summary": "Lote: a mesma consulta para ate 50 entradas. Cada item traz envelope ou codigo de erro.",
        "parameters": [
          {
            "name": "consultaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarLoteInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarLoteInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarLoteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Consultas.ItemDeLoteDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Consultas.ItemDeLoteDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Consultas.ItemDeLoteDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/empresas/socios": {
      "post": {
        "tags": [
          "Empresas"
        ],
        "summary": "QSA da empresa e, de cada socio, as outras empresas em que ele figura. Sem custo.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Societario.SociosDaEmpresaInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Societario.SociosDaEmpresaInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Societario.SociosDaEmpresaInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Societario.SociosDaEmpresaDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Societario.SociosDaEmpresaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Societario.SociosDaEmpresaDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/historico/consultar": {
      "post": {
        "tags": [
          "Historico"
        ],
        "summary": "Linha do tempo do documento: o que foi consultado, quando, por qual fonte.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Historico.ObterHistoricoInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Historico.ObterHistoricoInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Historico.ObterHistoricoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Historico.HistoricoDoDocumentoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Historico.HistoricoDoDocumentoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Historico.HistoricoDoDocumentoDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/historico/comparar": {
      "post": {
        "tags": [
          "Historico"
        ],
        "summary": "O que mudou no documento entre duas datas.\n\nPara cada consulta, compara o retorno mais recente que existia em `de` com o mais\nrecente que existia em `ate`. Consulta presente em apenas um dos momentos aparece\ncomo nao comparavel — nao se sabe se o dado mudou ou se nao foi perguntado.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Historico.CompararHistoricoInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Historico.CompararHistoricoInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Historico.CompararHistoricoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Historico.ComparacaoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Historico.ComparacaoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Historico.ComparacaoDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/investigacoes": {
      "post": {
        "tags": [
          "Investigacoes"
        ],
        "summary": "Abre a investigacao. O documento vai no CORPO, nunca na rota (CPF em URL vaza para log).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Investigacoes.IniciarInvestigacaoInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Investigacoes.IniciarInvestigacaoInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Investigacoes.IniciarInvestigacaoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Investigacoes"
        ],
        "summary": "Minhas investigacoes, da mais recente para a mais antiga.",
        "parameters": [
          {
            "name": "maximo",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/investigacoes/{id}": {
      "get": {
        "tags": [
          "Investigacoes"
        ],
        "summary": "Estado e o que chegou depois do cursor `desde` (0 devolve tudo).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "desde",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/investigacoes/{id}/itens": {
      "get": {
        "tags": [
          "Investigacoes"
        ],
        "summary": "Resultado de cada consulta feita para um no. O `noId` vai na query (tem dois-pontos e barra).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "noId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ItemDoNoDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ItemDoNoDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ItemDoNoDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/investigacoes/{id}/expandir": {
      "post": {
        "tags": [
          "Investigacoes"
        ],
        "summary": "\"Expandir teia\": sobe e desce a partir de um no, na mesma investigacao.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ExpandirInvestigacaoInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ExpandirInvestigacaoInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ExpandirInvestigacaoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Investigacoes.InvestigacaoResumoDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/investigacoes/{id}/cancelar": {
      "post": {
        "tags": [
          "Investigacoes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/pacotes": {
      "get": {
        "tags": [
          "Pacotes"
        ],
        "summary": "Catalogo de pacotes. Cada um traz o custo, os campos de retorno e quais itens ja estao\ncobertos por alguma fonte.",
        "parameters": [
          {
            "name": "documento",
            "in": "query",
            "description": "Filtra por tipo de documento: `cpf` ou `cnpj`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Pacotes.PacoteCatalogoDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Pacotes.PacoteCatalogoDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Pacotes.PacoteCatalogoDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pacotes/{pacoteId}": {
      "get": {
        "tags": [
          "Pacotes"
        ],
        "summary": "Detalhe de um pacote.",
        "parameters": [
          {
            "name": "pacoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Pacotes.PacoteCatalogoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Pacotes.PacoteCatalogoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Pacotes.PacoteCatalogoDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pacotes"
        ],
        "summary": "Executa o pacote e devolve o dossie consolidado: os dados por bloco e a procedencia de\ncada bloco, com o desfecho de cada item.",
        "parameters": [
          {
            "name": "pacoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Pacotes.ExecutarPacoteInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Pacotes.ExecutarPacoteInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Pacotes.ExecutarPacoteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Pacotes.EnvelopePacoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Pacotes.EnvelopePacoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Pacotes.EnvelopePacoteDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retroativo/vigentes": {
      "post": {
        "tags": [
          "Retroativo"
        ],
        "summary": "O ultimo resultado guardado de cada consulta do documento, para o load imediato.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Versionamento.VigentesInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Versionamento.VigentesInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Versionamento.VigentesInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Versionamento.VersaoDeResultadoDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Versionamento.VersaoDeResultadoDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Versionamento.VersaoDeResultadoDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retroativo/historico": {
      "post": {
        "tags": [
          "Retroativo"
        ],
        "summary": "Todas as versoes de uma consulta para o documento (historico de alteracoes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Versionamento.HistoricoInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Versionamento.HistoricoInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Versionamento.HistoricoInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Versionamento.VersaoDeResultadoDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Versionamento.VersaoDeResultadoDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsultasHub.Versionamento.VersaoDeResultadoDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/teia": {
      "post": {
        "tags": [
          "Teia"
        ],
        "summary": "Monta a teia. O documento vai no CORPO, nunca na rota (CPF em URL vaza para log).\nProfundidade 1 a 4 (padrao 2); teto de entidades ate 300 (padrao 80).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Teia.MontarTeiaInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Teia.MontarTeiaInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Teia.MontarTeiaInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Teia.TeiaDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Teia.TeiaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Teia.TeiaDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/transportadores/ficha": {
      "post": {
        "tags": [
          "Transportadores"
        ],
        "summary": "Tudo o que o hub sabe da transportadora, com desfecho por bloco.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Transporte.FichaDeTransportadorInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Transporte.FichaDeTransportadorInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultasHub.Transporte.FichaDeTransportadorInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Transporte.FichaDeTransportadorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Transporte.FichaDeTransportadorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultasHub.Transporte.FichaDeTransportadorDto"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ConsultasHub.Consultas.ConsultaCatalogoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "parametros": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Consultas.ParametroCatalogoDto"
            },
            "nullable": true
          },
          "fontes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Consultas.FonteCatalogoDto"
            },
            "description": "Fontes que respondem esta consulta, na ordem da cascata.",
            "nullable": true
          },
          "custoMinimoCreditos": {
            "type": "integer",
            "description": "Menor custo possivel, quando ha ao menos uma fonte utilizavel e gratuita.",
            "format": "int32"
          },
          "exigeConfirmacaoDeCusto": {
            "type": "boolean",
            "description": "Se toda fonte disponivel cobra — nesse caso a consulta exige confirmacao de custo."
          }
        },
        "additionalProperties": false,
        "description": "Uma consulta como a documentacao a apresenta: o que ela recebe, o que devolve, e todas as\nfontes que sabem responde-la, com o custo de cada uma."
      },
      "ConsultasHub.Consultas.CustoDto": {
        "type": "object",
        "properties": {
          "creditos": {
            "type": "integer",
            "description": "Creditos efetivamente debitados nesta chamada.",
            "format": "int32"
          },
          "modelo": {
            "type": "string",
            "description": "Como o provedor cobra: gratuito, assinatura, pre-pago, por consulta.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Consultas.EnvelopeConsultaDto": {
        "type": "object",
        "properties": {
          "dados": {
            "description": "Dados no schema canonico da consulta. Nulo quando nao encontrado.",
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/ConsultasHub.Consultas.MetaConsultaDto"
          }
        },
        "additionalProperties": false,
        "description": "Toda resposta do hub. Os dados vem acompanhados da procedencia: qual fonte respondeu, de\nquando e o dado, e quanto custou — o requisito de \"deixar claro o retorno e o custo\"."
      },
      "ConsultasHub.Consultas.ExecutarConsultaInput": {
        "required": [
          "parametros"
        ],
        "type": "object",
        "properties": {
          "parametros": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Parametros declarados pela consulta no catalogo, ex.: `{ \"cnpj\": \"...\" }`."
          },
          "confirmarCusto": {
            "type": "boolean",
            "description": "Autoriza gastar credito. Sem isto o hub RECUSA qualquer provedor pago e usa apenas os\ngratuitos — trava deliberada para que nenhuma aplicacao queime saldo por descuido."
          },
          "provedor": {
            "maxLength": 64,
            "minLength": 0,
            "type": "string",
            "description": "Forca um provedor especifico em vez de seguir a cascata. Util para comparar fontes ou\nreconsultar quem trouxe um dado suspeito.",
            "nullable": true
          },
          "ignorarCache": {
            "type": "boolean",
            "description": "Ignora o cache e vai a fonte. Em consulta paga, isto custa dinheiro de novo."
          }
        },
        "additionalProperties": false,
        "description": "Pedido de execucao de uma consulta do catalogo."
      },
      "ConsultasHub.Consultas.ExecutarLoteInput": {
        "required": [
          "itens"
        ],
        "type": "object",
        "properties": {
          "itens": {
            "maxItems": 50,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Consultas.ExecutarConsultaInput"
            }
          }
        },
        "additionalProperties": false,
        "description": "Lote de entradas para a MESMA consulta. Teto de 50, como no MCP consultas-br."
      },
      "ConsultasHub.Consultas.FonteCatalogoDto": {
        "type": "object",
        "properties": {
          "provedorId": {
            "type": "string",
            "nullable": true
          },
          "provedorNome": {
            "type": "string",
            "nullable": true
          },
          "baseUrl": {
            "type": "string",
            "nullable": true
          },
          "urlDocumentacao": {
            "type": "string",
            "nullable": true
          },
          "prioridade": {
            "type": "integer",
            "format": "int32"
          },
          "custoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "modeloCusto": {
            "type": "string",
            "nullable": true
          },
          "camposCobertos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Campos do schema canonico que ESTA fonte preenche.",
            "nullable": true
          },
          "informaDataDeReferencia": {
            "type": "boolean",
            "description": "Se a fonte informa quando o dado foi atualizado na origem."
          },
          "cacheHoras": {
            "type": "number",
            "description": "Horas de cache declaradas. Zero significa sem cache.",
            "format": "double"
          },
          "disponivel": {
            "type": "boolean"
          },
          "observacao": {
            "type": "string",
            "description": "Por que nao esta disponivel — nao implementada ou provedor desligado.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Consultas.ItemDeLoteDto": {
        "type": "object",
        "properties": {
          "indice": {
            "type": "integer",
            "format": "int32"
          },
          "envelope": {
            "$ref": "#/components/schemas/ConsultasHub.Consultas.EnvelopeConsultaDto"
          },
          "erro": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Resultado de um item do lote: envelope quando respondeu, codigo de erro quando nao."
      },
      "ConsultasHub.Consultas.MetaConsultaDto": {
        "type": "object",
        "properties": {
          "consulta": {
            "type": "string",
            "description": "Id canonico da consulta, ex.: `cnpj.cadastro`.",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "description": "Schema versionado dos dados, ex.: `cnpj_cadastral@v1`.",
            "nullable": true
          },
          "provedor": {
            "type": "string",
            "description": "Provedor que efetivamente respondeu.",
            "nullable": true
          },
          "origem": {
            "type": "string",
            "description": "URL consultada, com a credencial redigida.",
            "nullable": true
          },
          "dataReferencia": {
            "type": "string",
            "description": "Quando a FONTE atualizou o dado. Nulo quando a fonte nao informa — nesse caso nao ha como\nsaber a idade do dado, e o hub prefere admitir isso a fingir atualidade.",
            "format": "date-time",
            "nullable": true
          },
          "obtidoEm": {
            "type": "string",
            "description": "Quando o hub obteve o dado. Numa resposta de cache, e a data da coleta original.",
            "format": "date-time"
          },
          "cache": {
            "type": "boolean",
            "description": "Se veio do cache, sem tocar a fonte."
          },
          "parcial": {
            "type": "boolean",
            "description": "A fonte respondeu, mas parte do que a consulta confere NAO foi conferida nesta chamada; o\ntexto de cobertura dos dados diz o que faltou. Resposta parcial nao e guardada pelo hub:\nrepetir a chamada tenta de novo a parte que faltou."
          },
          "resultadoSalvo": {
            "type": "boolean",
            "description": "Nenhuma fonte respondeu NESTA chamada e os dados sao o ultimo resultado que o hub tinha\nguardado para a mesma pergunta (titular, 07/10/2026). Nao e verificacao de agora: as falhas\nreais estao em ConsultasHub.Consultas.MetaConsultaDto.Tentativas e a idade do dado em ConsultasHub.Consultas.MetaConsultaDto.SalvoEm."
          },
          "salvoEm": {
            "type": "string",
            "description": "Quando uma consulta ao vivo confirmou pela ultima vez o resultado devolvido como reserva.\nNulo quando ConsultasHub.Consultas.MetaConsultaDto.ResultadoSalvo e falso.",
            "format": "date-time",
            "nullable": true
          },
          "custo": {
            "$ref": "#/components/schemas/ConsultasHub.Consultas.CustoDto"
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          },
          "correlationId": {
            "type": "string",
            "description": "Correlaciona esta resposta com a auditoria.",
            "nullable": true
          },
          "tentativas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Consultas.TentativaDto"
            },
            "description": "Provedores tentados, em ordem. Com um so item na maioria das vezes; com varios quando\nhouve cascata — e ai mostra exatamente por que cada anterior falhou.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Consultas.ParametroCatalogoDto": {
        "type": "object",
        "properties": {
          "nome": {
            "type": "string",
            "nullable": true
          },
          "descricao": {
            "type": "string",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "obrigatorio": {
            "type": "boolean"
          },
          "exemplo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Consultas.TentativaDto": {
        "type": "object",
        "properties": {
          "provedor": {
            "type": "string",
            "nullable": true
          },
          "resultado": {
            "type": "string",
            "description": "Ok, NaoEncontrado, ErroLogico, ErroRede, ErroAutenticacao, LimiteExcedido — o que a fonte\ndisse. Ou o motivo de ela NAO ter sido chamada: ParametroAusente, CredencialAusente,\nProvedorExcluido, FilaCheia (a vez na fila da fonte nao chegou a tempo).",
            "nullable": true
          },
          "httpStatus": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          },
          "mensagem": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Historico.ComparacaoDto": {
        "type": "object",
        "properties": {
          "documento": {
            "type": "string",
            "nullable": true
          },
          "de": {
            "type": "string",
            "format": "date-time"
          },
          "ate": {
            "type": "string",
            "format": "date-time"
          },
          "comparadas": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Consultas que existem nos dois momentos e puderam ser comparadas.\n\nConsulta presente em apenas um dos lados NAO vira diferenca: nao se sabe se o dado mudou\nou se apenas nao foi perguntado daquela vez. Ela aparece aqui como nao comparavel.",
            "nullable": true
          },
          "naoComparaveis": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "totalDeDiferencas": {
            "type": "integer",
            "format": "int32"
          },
          "diferencas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Historico.DiferencaDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "O que mudou entre dois momentos de um documento."
      },
      "ConsultasHub.Historico.CompararHistoricoInput": {
        "required": [
          "documento"
        ],
        "type": "object",
        "properties": {
          "documento": {
            "maxLength": 18,
            "minLength": 11,
            "type": "string",
            "description": "CPF ou CNPJ, com ou sem mascara."
          },
          "de": {
            "type": "string",
            "format": "date-time"
          },
          "ate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Documento e as duas datas a comparar. Mesmo motivo de ConsultasHub.Historico.ObterHistoricoInput."
      },
      "ConsultasHub.Historico.ConsultaNoHistoricoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "correlationId": {
            "type": "string",
            "nullable": true
          },
          "quando": {
            "type": "string",
            "description": "Quando a consulta foi feita.",
            "format": "date-time"
          },
          "consultaId": {
            "type": "string",
            "nullable": true
          },
          "provedorId": {
            "type": "string",
            "nullable": true
          },
          "resultado": {
            "type": "string",
            "description": "Ok, NaoEncontrado, ErroRede, ErroLogico, ErroAutenticacao, LimiteExcedido.",
            "nullable": true
          },
          "veioDoCache": {
            "type": "boolean",
            "description": "Se a resposta veio do cache em vez da fonte."
          },
          "pacoteId": {
            "type": "string",
            "description": "Pacote a que esta consulta pertenceu, quando veio de um.",
            "nullable": true
          },
          "itemPacote": {
            "type": "string",
            "nullable": true
          },
          "dataReferencia": {
            "type": "string",
            "description": "Quando a FONTE atualizou o dado, quando ela informa.",
            "format": "date-time",
            "nullable": true
          },
          "temRetorno": {
            "type": "boolean",
            "description": "Se ha retorno guardado para comparar."
          }
        },
        "additionalProperties": false,
        "description": "Uma consulta feita sobre um documento, na linha do tempo."
      },
      "ConsultasHub.Historico.DiferencaDto": {
        "type": "object",
        "properties": {
          "consultaId": {
            "type": "string",
            "description": "Consulta em que a diferenca apareceu, ex.: `cnpj.cadastro`.",
            "nullable": true
          },
          "campo": {
            "type": "string",
            "description": "Caminho do campo no retorno, ex.: `situacao` ou `socios[2].nome`.",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "description": "`Alterado`, `Incluido` ou `Removido`.",
            "nullable": true
          },
          "antes": {
            "type": "string",
            "nullable": true
          },
          "depois": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Uma diferenca encontrada entre dois momentos."
      },
      "ConsultasHub.Historico.HistoricoDoDocumentoDto": {
        "type": "object",
        "properties": {
          "documento": {
            "type": "string",
            "nullable": true
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "primeiraConsulta": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "ultimaConsulta": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "consultas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Historico.ConsultaNoHistoricoDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A linha do tempo de um documento."
      },
      "ConsultasHub.Historico.ObterHistoricoInput": {
        "required": [
          "documento"
        ],
        "type": "object",
        "properties": {
          "documento": {
            "maxLength": 18,
            "minLength": 11,
            "type": "string",
            "description": "CPF ou CNPJ, com ou sem mascara."
          }
        },
        "additionalProperties": false,
        "description": "Documento cujo historico se quer ler. Vai no CORPO, nunca no caminho da URL: CPF no caminho\nacaba no log de requisicao do Kestrel e no do proxy reverso a frente."
      },
      "ConsultasHub.Investigacoes.ArestaDaInvestigacaoDto": {
        "type": "object",
        "properties": {
          "empresa": {
            "type": "string",
            "nullable": true
          },
          "membro": {
            "type": "string",
            "nullable": true
          },
          "qualificacao": {
            "type": "string",
            "nullable": true
          },
          "dataDeEntrada": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "fonte": {
            "type": "string",
            "nullable": true
          },
          "confianca": {
            "type": "string",
            "nullable": true
          },
          "sequencia": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Investigacoes.ExpandirInvestigacaoInput": {
        "required": [
          "noId"
        ],
        "type": "object",
        "properties": {
          "noId": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "saltos": {
            "maximum": 4,
            "minimum": 1,
            "type": "integer",
            "description": "Saltos a partir do no (1 a 4). Padrao 2.",
            "format": "int32"
          },
          "acrescimoDeEntidades": {
            "maximum": 200,
            "minimum": 0,
            "type": "integer",
            "description": "Quanto o teto de entidades cresce com o pedido. Padrao 60.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Pedido de \"Expandir teia\": sobe e desce a partir de um no, na mesma investigacao."
      },
      "ConsultasHub.Investigacoes.IniciarInvestigacaoInput": {
        "required": [
          "documento"
        ],
        "type": "object",
        "properties": {
          "documento": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string"
          },
          "nome": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "Nome do titular (CPF); ajuda quando o cadastro nao o traz.",
            "nullable": true
          },
          "dataNascimento": {
            "maxLength": 10,
            "minLength": 0,
            "type": "string",
            "description": "dd/mm/aaaa (CPF). Destrava o cadastro da SintegraWS.",
            "nullable": true
          },
          "saltos": {
            "maximum": 8,
            "minimum": 1,
            "type": "integer",
            "description": "Saltos a partir da raiz (1 a 8). Padrao 6.",
            "format": "int32"
          },
          "maximoDeEntidades": {
            "maximum": 500,
            "minimum": 5,
            "type": "integer",
            "description": "Teto de entidades (5 a 500). Padrao 200.",
            "format": "int32"
          },
          "sentido": {
            "maxLength": 10,
            "minLength": 0,
            "type": "string",
            "description": "Ambos, Sobe ou Desce.",
            "nullable": true
          },
          "camadas": {
            "maxLength": 12,
            "minLength": 0,
            "type": "string",
            "description": "EmCamadas (padrao), Completa ou Nucleo.",
            "nullable": true
          },
          "incluirInativas": {
            "type": "boolean"
          },
          "confiancaMinima": {
            "maxLength": 14,
            "minLength": 0,
            "type": "string",
            "description": "Documento ou MascaraENome (padrao).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Pedido de investigacao a partir de um CPF ou CNPJ. Documento no CORPO, nunca na rota."
      },
      "ConsultasHub.Investigacoes.InvestigacaoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tipoDaRaiz": {
            "type": "string",
            "nullable": true
          },
          "nome": {
            "type": "string",
            "nullable": true
          },
          "documento": {
            "type": "string",
            "nullable": true
          },
          "situacao": {
            "type": "string",
            "nullable": true
          },
          "motivoDaParada": {
            "type": "string",
            "nullable": true
          },
          "saltos": {
            "type": "integer",
            "format": "int32"
          },
          "maximoDeEntidades": {
            "type": "integer",
            "format": "int32"
          },
          "sentido": {
            "type": "string",
            "nullable": true
          },
          "camadas": {
            "type": "string",
            "nullable": true
          },
          "descobertas": {
            "type": "integer",
            "format": "int32"
          },
          "investigadas": {
            "type": "integer",
            "format": "int32"
          },
          "criada": {
            "type": "string",
            "format": "date-time"
          },
          "inicio": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "fim": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sequencia": {
            "type": "integer",
            "description": "Use como `desde` na proxima leitura.",
            "format": "int64"
          },
          "nos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Investigacoes.NoDaInvestigacaoDto"
            },
            "nullable": true
          },
          "arestas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Investigacoes.ArestaDaInvestigacaoDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A investigacao com o que chegou depois do cursor `desde`."
      },
      "ConsultasHub.Investigacoes.InvestigacaoResumoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tipoDaRaiz": {
            "type": "string",
            "nullable": true
          },
          "nome": {
            "type": "string",
            "nullable": true
          },
          "documento": {
            "type": "string",
            "nullable": true
          },
          "situacao": {
            "type": "string",
            "nullable": true
          },
          "motivoDaParada": {
            "type": "string",
            "nullable": true
          },
          "saltos": {
            "type": "integer",
            "format": "int32"
          },
          "maximoDeEntidades": {
            "type": "integer",
            "format": "int32"
          },
          "sentido": {
            "type": "string",
            "nullable": true
          },
          "camadas": {
            "type": "string",
            "nullable": true
          },
          "descobertas": {
            "type": "integer",
            "format": "int32"
          },
          "investigadas": {
            "type": "integer",
            "format": "int32"
          },
          "criada": {
            "type": "string",
            "format": "date-time"
          },
          "inicio": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "fim": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Investigacoes.ItemDoNoDto": {
        "type": "object",
        "properties": {
          "chave": {
            "type": "string",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "bloco": {
            "type": "string",
            "nullable": true
          },
          "consultaId": {
            "type": "string",
            "nullable": true
          },
          "resultado": {
            "type": "string",
            "nullable": true
          },
          "motivo": {
            "type": "string",
            "nullable": true
          },
          "mensagem": {
            "type": "string",
            "nullable": true
          },
          "provedor": {
            "type": "string",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "cache": {
            "type": "boolean"
          },
          "creditos": {
            "type": "integer",
            "format": "int32"
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          },
          "obtidoEm": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "dataDeReferencia": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "dados": {
            "description": "Retorno da fonte (so nas consultas que responderam com dado).",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Investigacoes.NoDaInvestigacaoDto": {
        "type": "object",
        "properties": {
          "noId": {
            "type": "string",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "classes": {
            "type": "string",
            "nullable": true
          },
          "documento": {
            "type": "string",
            "nullable": true
          },
          "nome": {
            "type": "string",
            "nullable": true
          },
          "situacao": {
            "type": "string",
            "nullable": true
          },
          "capitalSocial": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "uf": {
            "type": "string",
            "nullable": true
          },
          "salto": {
            "type": "integer",
            "format": "int32"
          },
          "camada": {
            "type": "string",
            "nullable": true
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "confianca": {
            "type": "string",
            "nullable": true
          },
          "origemDaIdentidade": {
            "type": "string",
            "nullable": true
          },
          "paiNoId": {
            "type": "string",
            "nullable": true
          },
          "expandido": {
            "type": "boolean"
          },
          "truncado": {
            "type": "boolean"
          },
          "motivo": {
            "type": "string",
            "nullable": true
          },
          "itensConcluidos": {
            "type": "integer",
            "format": "int32"
          },
          "sequencia": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.CustoExecucaoDto": {
        "type": "object",
        "properties": {
          "creditosGastos": {
            "type": "integer",
            "format": "int32"
          },
          "creditosEstimadoMaximo": {
            "type": "integer",
            "format": "int32"
          },
          "confirmado": {
            "type": "boolean"
          },
          "teto": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "confirmacaoPendente": {
            "type": "boolean",
            "description": "Havia item pago e faltou confirmacao: ele voltou como nao executado."
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.CustoItemDto": {
        "type": "object",
        "properties": {
          "chave": {
            "type": "string",
            "nullable": true
          },
          "creditosMinimo": {
            "type": "integer",
            "format": "int32"
          },
          "creditosMaximo": {
            "type": "integer",
            "format": "int32"
          },
          "modeloCusto": {
            "type": "string",
            "nullable": true
          },
          "disponivel": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.CustoPacoteDto": {
        "type": "object",
        "properties": {
          "creditosMinimo": {
            "type": "integer",
            "description": "Todas as fontes mais baratas de cada item respondem.",
            "format": "int32"
          },
          "creditosMaximo": {
            "type": "integer",
            "description": "Pior caso. E este o valor que a trava de teto compara.",
            "format": "int32"
          },
          "creditosPorSocio": {
            "type": "integer",
            "description": "Custo maximo de cada socio expandido. Zero quando o pacote nao expande QSA.",
            "format": "int32"
          },
          "maxSocios": {
            "type": "integer",
            "format": "int32"
          },
          "custoVariavel": {
            "type": "boolean",
            "description": "Custo que so se conhece na execucao, porque depende de quantos socios existem."
          },
          "requerConfirmacao": {
            "type": "boolean",
            "description": "Se e preciso confirmar custo para que os itens pagos sejam executados."
          },
          "porItem": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Pacotes.CustoItemDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.DocumentoPacoteDto": {
        "type": "object",
        "properties": {
          "nome": {
            "type": "string",
            "description": "Nome do parametro na chamada de execucao: `cpf` ou `cnpj`.",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "exemplo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.EnvelopePacoteDto": {
        "type": "object",
        "properties": {
          "dados": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "description": "Um bloco por item que respondeu, na chave declarada pelo pacote.",
            "nullable": true
          },
          "itens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Pacotes.ItemExecutadoDto"
            },
            "nullable": true
          },
          "meta": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.MetaPacoteDto"
          }
        },
        "additionalProperties": false,
        "description": "O dossie: os dados por bloco, a procedencia de cada bloco e o resumo da execucao.\n\nA forma e dupla de proposito. `Dados` e o mapa de blocos, ergonomico para consumo\ntipado; `Itens` e iteravel, para montar a tela de \"o que foi verificado e o que nao\nfoi\". A chave do item liga os dois."
      },
      "ConsultasHub.Pacotes.ExecutarPacoteInput": {
        "required": [
          "documento"
        ],
        "type": "object",
        "properties": {
          "documento": {
            "maxLength": 32,
            "minLength": 0,
            "type": "string",
            "description": "CPF ou CNPJ, conforme o pacote. Aceita com ou sem pontuacao."
          },
          "confirmarCusto": {
            "type": "boolean",
            "description": "Autoriza gastar credito. Sem isso, item pago volta como nao executado."
          },
          "tetoCreditos": {
            "maximum": 100000,
            "minimum": 0,
            "type": "integer",
            "description": "Teto de creditos para esta execucao. Obrigatorio quando o custo do pacote e variavel —\nautorizar \"N vezes o custo do socio\" as cegas nao e autorizacao.",
            "format": "int32",
            "nullable": true
          },
          "nome": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "Nome do titular, quando o solicitante ja o conhece. Opcional.\n\nExiste porque varias fontes casam por NOME e nao por documento — as listas de sancoes\ninternacionais, o indice judicial, a imprensa. Para CNPJ o hub resolve sozinho, lendo a\nrazao social do cadastro da Receita. Para CPF nao existe fonte gratuita que traduza\ndocumento em nome, entao o item fica sem chave de busca — a menos que quem pergunta ja\ntenha o nome, que e o caso de quem faz onboarding de uma pessoa com contrato em maos.\n<b>Este nome NAO e dado de fonte.</b> Ele vem de quem pergunta, e por isso um acerto\nobtido por ele nunca sobe a `DocumentoExato`: fica em `NomeExato`, e a cobertura\ndo item declara que a busca usou nome fornecido pelo solicitante. Homonimo continua\npossivel e quem le precisa saber disso para decidir.",
            "nullable": true
          },
          "dataNascimento": {
            "maxLength": 10,
            "minLength": 0,
            "type": "string",
            "description": "Data de nascimento do titular, quando o solicitante a conhece. Opcional.\n\nAceita `aaaa-mm-dd`, `dd/mm/aaaa` ou `ddmmaaaa`. Existe porque o cadastro de\npessoa fisica na Receita so responde com ela — e essa exigencia e uma virtude: a fonte so\ndevolve dado quando documento e nascimento sao da mesma pessoa, entao o retorno ja confirma\nidentidade, o que o nome sozinho nunca faria.",
            "nullable": true
          },
          "ignorarCache": {
            "type": "boolean"
          },
          "itens": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Subconjunto de chaves de item. Nulo executa o pacote inteiro.",
            "nullable": true
          },
          "semTeia": {
            "type": "boolean",
            "description": "Nao expande a teia (drill-up/down do QSA). O lote de pacotes usa: as empresas ligadas ja estao\nna propria lista, e expandir cada uma multiplicaria as chamadas."
          }
        },
        "additionalProperties": false,
        "description": "Entrada da execucao de um pacote."
      },
      "ConsultasHub.Pacotes.FonteItemDto": {
        "type": "object",
        "properties": {
          "provedorId": {
            "type": "string",
            "nullable": true
          },
          "provedorNome": {
            "type": "string",
            "nullable": true
          },
          "urlDocumentacao": {
            "type": "string",
            "nullable": true
          },
          "prioridade": {
            "type": "integer",
            "format": "int32"
          },
          "custoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "modeloCusto": {
            "type": "string",
            "nullable": true
          },
          "disponivel": {
            "type": "boolean"
          },
          "observacao": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.ItemExecutadoDto": {
        "type": "object",
        "properties": {
          "chave": {
            "type": "string",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "bloco": {
            "type": "string",
            "nullable": true
          },
          "resultado": {
            "type": "string",
            "description": "Um dos valores de ConsultasHub.Pacotes.ResultadoItem.",
            "nullable": true
          },
          "motivo": {
            "type": "string",
            "description": "Codigo estavel que explica o desfecho quando ele nao e `Ok`.",
            "nullable": true
          },
          "mensagem": {
            "type": "string",
            "nullable": true
          },
          "consultaId": {
            "type": "string",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "provedor": {
            "type": "string",
            "description": "Fonte que respondeu. Nulo quando nao houve chamada.",
            "nullable": true
          },
          "origem": {
            "type": "string",
            "description": "URL chamada, com a credencial redigida.",
            "nullable": true
          },
          "dataReferencia": {
            "type": "string",
            "description": "Quando a FONTE atualizou o dado. Nulo quando ela nao informa.",
            "format": "date-time",
            "nullable": true
          },
          "obtidoEm": {
            "type": "string",
            "description": "Quando o hub obteve o dado.",
            "format": "date-time",
            "nullable": true
          },
          "cache": {
            "type": "boolean"
          },
          "resultadoSalvo": {
            "type": "boolean",
            "description": "Nenhuma fonte respondeu nesta execucao e existe um resultado SALVO da mesma pergunta\n(07/10/2026). O item continua `NaoConclusivo`, com motivo `ResultadoSalvo`: dado\nantigo nao conta como conferencia de agora. Espelha `meta.resultadoSalvo` da consulta."
          },
          "salvoEm": {
            "type": "string",
            "description": "Quando o resultado salvo foi confirmado pela ultima vez. Nulo fora da reserva.",
            "format": "date-time",
            "nullable": true
          },
          "custo": {
            "$ref": "#/components/schemas/ConsultasHub.Consultas.CustoDto"
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          },
          "tentativas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Consultas.TentativaDto"
            },
            "description": "Uma entrada por fonte percorrida na cascata deste item.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.ItemPacoteDto": {
        "type": "object",
        "properties": {
          "chave": {
            "type": "string",
            "description": "Chave do bloco em `dados` na resposta da execucao.",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "descricao": {
            "type": "string",
            "nullable": true
          },
          "bloco": {
            "type": "string",
            "description": "Categoria de risco, para agrupar o dossie.",
            "nullable": true
          },
          "consultaId": {
            "type": "string",
            "description": "Consulta que responde este item hoje. Nulo quando o item nao esta coberto.",
            "nullable": true
          },
          "consultaPrevista": {
            "type": "string",
            "description": "Consulta que vai responder este item quando a fonte entrar.",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "campos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Campos que este item entrega — a uniao do que as fontes da cascata cobrem.",
            "nullable": true
          },
          "fontes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Pacotes.FonteItemDto"
            },
            "description": "Fontes declaradas para este item, na ordem da cascata.",
            "nullable": true
          },
          "dependeDe": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Chaves de itens que precisam responder antes deste.",
            "nullable": true
          },
          "custoMinimoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "custoMaximoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "cacheHoras": {
            "type": "number",
            "description": "TTL de cache do item em horas. Zero significa sem cache.",
            "format": "double"
          },
          "disponivel": {
            "type": "boolean"
          },
          "observacao": {
            "type": "string",
            "description": "Por que o item nao esta coberto, quando nao esta.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Um item do pacote: uma verificacao que vira um bloco no dossie."
      },
      "ConsultasHub.Pacotes.MetaPacoteDto": {
        "type": "object",
        "properties": {
          "pacote": {
            "type": "string",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "tipoDocumento": {
            "type": "string",
            "nullable": true
          },
          "documento": {
            "type": "string",
            "description": "Documento normalizado, como foi usado nas chamadas.",
            "nullable": true
          },
          "correlationId": {
            "type": "string",
            "description": "Amarra, na auditoria, todas as chamadas de todos os itens deste dossie.",
            "nullable": true
          },
          "iniciadoEm": {
            "type": "string",
            "format": "date-time"
          },
          "concluidoEm": {
            "type": "string",
            "format": "date-time"
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          },
          "completo": {
            "type": "boolean",
            "description": "Falso quando algum item nao concluiu. E o sinal de uma linha para quem consome saber que o\ndossie esta incompleto sem varrer a lista de itens."
          },
          "custo": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.CustoExecucaoDto"
          },
          "resumo": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.ResumoExecucaoDto"
          },
          "qsa": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.QsaExecucaoDto"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.PacoteCatalogoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "resumo": {
            "type": "string",
            "nullable": true
          },
          "descricao": {
            "type": "string",
            "nullable": true
          },
          "tipoDocumento": {
            "type": "string",
            "description": "`Cpf` ou `Cnpj`.",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "ordem": {
            "type": "integer",
            "format": "int32"
          },
          "documento": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.DocumentoPacoteDto"
          },
          "custo": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.CustoPacoteDto"
          },
          "comTeia": {
            "type": "boolean",
            "description": "Expande o QSA (drill-up e drill-down) e consulta as empresas ligadas."
          },
          "itensTotais": {
            "type": "integer",
            "description": "Quantos itens o pacote promete.",
            "format": "int32"
          },
          "itensCobertos": {
            "type": "integer",
            "description": "Quantos deles alguma fonte responde hoje. A diferenca para ConsultasHub.Pacotes.PacoteCatalogoDto.ItensTotais nao e\ndefeito: e o roadmap, item a item, com o motivo de cada lacuna.",
            "format": "int32"
          },
          "tempoMinimoMs": {
            "type": "integer",
            "description": "Piso de tempo imposto pela cadencia declarada das fontes, em milissegundos. Nao inclui\nlatencia de rede — e o minimo que a fila vai impor, nao uma previsao.",
            "format": "int32"
          },
          "itens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Pacotes.ItemPacoteDto"
            },
            "nullable": true
          },
          "qsa": {
            "$ref": "#/components/schemas/ConsultasHub.Pacotes.QsaPacoteDto"
          },
          "disponivel": {
            "type": "boolean",
            "description": "Se o pacote esta na vitrine."
          },
          "observacao": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Um pacote como a vitrine o apresenta: o que recebe, o que devolve, quanto custa e quanto da\npromessa esta coberta hoje."
      },
      "ConsultasHub.Pacotes.QsaExecucaoDto": {
        "type": "object",
        "properties": {
          "expandido": {
            "type": "boolean"
          },
          "motivo": {
            "type": "string",
            "description": "Por que a expansao nao ocorreu, quando nao ocorreu.",
            "nullable": true
          },
          "maxSocios": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.QsaPacoteDto": {
        "type": "object",
        "properties": {
          "itemAncora": {
            "type": "string",
            "description": "Item que traz os socios e da inicio a expansao.",
            "nullable": true
          },
          "pacotePorSocioPf": {
            "type": "string",
            "description": "Pacote executado para cada socio pessoa fisica.",
            "nullable": true
          },
          "pacotePorSocioPj": {
            "type": "string",
            "description": "Pacote executado para socio pessoa juridica. Nulo significa que nao ha expansao.",
            "nullable": true
          },
          "maxSocios": {
            "type": "integer",
            "format": "int32"
          },
          "advertencia": {
            "type": "string",
            "description": "Alerta honesto na propria vitrine: a expansao so produz dossie de socio quando a fonte que\nresponde o item ancora traz o documento do socio integro.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Pacotes.ResumoExecucaoDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "ok": {
            "type": "integer",
            "format": "int32"
          },
          "naoEncontrado": {
            "type": "integer",
            "format": "int32"
          },
          "naoConclusivo": {
            "type": "integer",
            "format": "int32"
          },
          "naoExecutado": {
            "type": "integer",
            "format": "int32"
          },
          "naoCoberto": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Societario.ParticipacaoDoSocioDto": {
        "type": "object",
        "properties": {
          "socia": {
            "type": "string",
            "description": "No socio: `pf:consultado` (o proprio socio) ou `pj:raiz` num nivel acima.",
            "nullable": true
          },
          "empresa": {
            "type": "string",
            "description": "Empresa pela raiz (`pj:raiz`).",
            "nullable": true
          },
          "cnpjBasico": {
            "type": "string",
            "nullable": true
          },
          "cnpjDaMatrizPresumido": {
            "type": "string",
            "description": "Raiz + 0001 com verificadores calculados: PRESUMIDO, nao conferido.",
            "nullable": true
          },
          "nivel": {
            "type": "integer",
            "format": "int32"
          },
          "qualificacao": {
            "type": "string",
            "nullable": true
          },
          "dataEntrada": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "confiancaCasamento": {
            "type": "string",
            "nullable": true
          },
          "razaoSocial": {
            "type": "string",
            "description": "Razao social da empresa, da base local, quando conhecida.",
            "nullable": true
          },
          "situacao": {
            "type": "string",
            "description": "Situacao cadastral da MATRIZ (ex.: `BAIXADA`), da base local. So vale com\nConsultasHub.Societario.ParticipacaoDoSocioDto.SituacaoVerificada verdadeiro; `null` = nao conferida, nunca \"ativa\".",
            "nullable": true
          },
          "dataSituacao": {
            "type": "string",
            "description": "Data da situacao cadastral da matriz.",
            "format": "date-time",
            "nullable": true
          },
          "situacaoVerificada": {
            "type": "boolean",
            "description": "`false` = situacao NAO verificada (carga nao concluida, raiz fora da base ou grafo antigo\n            do cache): ausencia de dado, nunca \"ativa\". Filiais nao sao cobertas."
          },
          "situacaoCompetencia": {
            "type": "string",
            "description": "Competencia (AAAA-MM) da carga de onde veio a situacao.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Societario.SocioComParticipacoesDto": {
        "type": "object",
        "properties": {
          "nome": {
            "type": "string",
            "nullable": true
          },
          "documento": {
            "type": "string",
            "description": "Como a fonte publica: CPF mascarado (`***NNNNNN**`) ou CNPJ do socio PJ.",
            "nullable": true
          },
          "qualificacao": {
            "type": "string",
            "nullable": true
          },
          "dataEntrada": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "desfecho": {
            "type": "string",
            "description": "`ok`: drill-up feito. `sem_documento`: a fonte nao trouxe mascara nem CNPJ do socio.\n            `nao_verificado`: o drill-up falhou, o que nunca significa \"nao e socio de outra empresa\".\n            `sem_permissao`: a aplicacao nao alcanca o drill-up. `fora_do_teto`: teto de socios ou prazo.",
            "nullable": true
          },
          "motivo": {
            "type": "string",
            "nullable": true
          },
          "empresas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Societario.ParticipacaoDoSocioDto"
            },
            "description": "Vinculos acima do socio: empresas em que ele figura e, com profundidade maior, as maes delas.",
            "nullable": true
          },
          "truncado": {
            "type": "boolean"
          },
          "competencia": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Societario.SociosDaEmpresaDto": {
        "type": "object",
        "properties": {
          "cnpj": {
            "type": "string",
            "nullable": true
          },
          "razaoSocial": {
            "type": "string",
            "nullable": true
          },
          "situacao": {
            "type": "string",
            "nullable": true
          },
          "fonteDoQsa": {
            "type": "string",
            "description": "Provedor que respondeu o QSA.",
            "nullable": true
          },
          "qsaObtidoEm": {
            "type": "string",
            "description": "Quando o hub obteve o QSA. Numa resposta de cache (ate 90 dias), a data da coleta original.",
            "format": "date-time",
            "nullable": true
          },
          "qsaDoCache": {
            "type": "boolean"
          },
          "custoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "truncado": {
            "type": "boolean",
            "description": "Teto de socios ou prazo atingido: os que ficaram de fora vem com desfecho `fora_do_teto`."
          },
          "socios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Societario.SocioComParticipacoesDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "O QSA da empresa e, para cada socio, em que outras empresas ele figura. Sem custo: o QSA vem da\nBrasilAPI (que traz o CPF MASCARADO do socio PF) e o drill-up usa mascara + nome na base de\nsocios da Receita hospedada no hub. Nenhum CPF completo sai daqui: a Receita nao o publica."
      },
      "ConsultasHub.Societario.SociosDaEmpresaInput": {
        "type": "object",
        "properties": {
          "cnpj": {
            "type": "string",
            "nullable": true
          },
          "profundidade": {
            "type": "integer",
            "description": "Niveis do drill-up de cada socio (1 a 10). Padrao 1: so as empresas em que ele e socio direto.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Pedido: a empresa cujo quadro de socios sera aberto. O CNPJ vai no CORPO, nunca na URL."
      },
      "ConsultasHub.Teia.ArestaDaTeiaDto": {
        "type": "object",
        "properties": {
          "empresa": {
            "type": "string",
            "description": "Id do no da EMPRESA.",
            "nullable": true
          },
          "membro": {
            "type": "string",
            "description": "Id do no do MEMBRO (socio PF ou PJ).",
            "nullable": true
          },
          "qualificacao": {
            "type": "string",
            "nullable": true
          },
          "dataEntrada": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "fonte": {
            "type": "string",
            "description": "Fonte que afirmou o vinculo.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Teia.MontarTeiaInput": {
        "type": "object",
        "properties": {
          "documento": {
            "type": "string",
            "description": "CPF ou CNPJ, com ou sem pontuacao.",
            "nullable": true
          },
          "nome": {
            "type": "string",
            "description": "Nome do titular (CPF). Ajuda quando o cadastro nao traz; opcional.",
            "nullable": true
          },
          "dataNascimento": {
            "type": "string",
            "description": "Data de nascimento (CPF), dd/mm/aaaa. Destrava o QSA da SintegraWS.",
            "nullable": true
          },
          "profundidade": {
            "type": "integer",
            "description": "Quantos saltos a partir da raiz (1 a 4). Padrao 2.",
            "format": "int32"
          },
          "maximoDeEntidades": {
            "type": "integer",
            "description": "Teto de entidades na teia. Padrao 80, maximo 300.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Pedido de teia societaria a partir de um CPF ou CNPJ."
      },
      "ConsultasHub.Teia.NoDaTeiaDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "`pj:{raiz}` ou `pf:{cpf}` / `pf:{mascara}|{nome}`.",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "description": "PF ou PJ.",
            "nullable": true
          },
          "documento": {
            "type": "string",
            "description": "CNPJ da matriz, CPF integro (so o da raiz) ou CPF mascarado.",
            "nullable": true
          },
          "nome": {
            "type": "string",
            "nullable": true
          },
          "situacao": {
            "type": "string",
            "nullable": true
          },
          "capitalSocial": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "atividade": {
            "type": "string",
            "nullable": true
          },
          "municipio": {
            "type": "string",
            "nullable": true
          },
          "uf": {
            "type": "string",
            "nullable": true
          },
          "abertura": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "nivel": {
            "type": "integer",
            "description": "Distancia (em saltos) ate a raiz.",
            "format": "int32"
          },
          "expandido": {
            "type": "boolean",
            "description": "A teia ja percorreu os vinculos deste no."
          },
          "raiz": {
            "type": "boolean",
            "description": "E a raiz consultada."
          },
          "origem": {
            "type": "string",
            "description": "De onde o no veio: consulta da fonte, base aberta da Receita ou QSA de outra empresa.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Teia.TeiaDto": {
        "type": "object",
        "properties": {
          "raiz": {
            "type": "string",
            "nullable": true
          },
          "nos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Teia.NoDaTeiaDto"
            },
            "nullable": true
          },
          "arestas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Teia.ArestaDaTeiaDto"
            },
            "nullable": true
          },
          "avisos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "O que a teia nao conseguiu conferir (fonte fora, teto atingido, base incompleta).",
            "nullable": true
          },
          "consultas": {
            "type": "integer",
            "description": "Consultas feitas as fontes para montar esta teia.",
            "format": "int32"
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Transporte.BlocoDaFichaDto": {
        "type": "object",
        "properties": {
          "chave": {
            "type": "string",
            "nullable": true
          },
          "titulo": {
            "type": "string",
            "nullable": true
          },
          "consulta": {
            "type": "string",
            "description": "A consulta do catalogo que respondeu por este bloco.",
            "nullable": true
          },
          "cnpj": {
            "type": "string",
            "description": "O CNPJ usado NESTE bloco: o consultado ou o da matriz.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "`ok`, `nada_encontrado` (a fonte foi conferida e nao ha registro),\n            `nao_verificado` (a conferencia NAO foi feita), `sem_permissao`.",
            "nullable": true
          },
          "motivo": {
            "type": "string",
            "nullable": true
          },
          "fonte": {
            "type": "string",
            "nullable": true
          },
          "custoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "confiancaCasamento": {
            "type": "string",
            "description": "`DocumentoExato`, `NomeExato`... como a consulta devolveu. Nulo se ela nao informa.",
            "nullable": true
          },
          "dados": {
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Um bloco da ficha, com desfecho proprio: um bloco que falha nao derruba os demais."
      },
      "ConsultasHub.Transporte.FichaDeTransportadorDto": {
        "type": "object",
        "properties": {
          "resumo": {
            "$ref": "#/components/schemas/ConsultasHub.Transporte.ResumoDaFichaDto"
          },
          "blocos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultasHub.Transporte.BlocoDaFichaDto"
            },
            "nullable": true
          },
          "avisos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "correlationId": {
            "type": "string",
            "description": "O mesmo em todos os blocos desta ficha; e por ele que a auditoria os junta.",
            "nullable": true
          },
          "custoCreditos": {
            "type": "integer",
            "format": "int32"
          },
          "latenciaMs": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Transporte.FichaDeTransportadorInput": {
        "type": "object",
        "properties": {
          "cnpj": {
            "type": "string",
            "nullable": true
          },
          "rntrc": {
            "type": "string",
            "description": "Numero do RNTRC declarado no CT-e (oito ou nove digitos). Opcional: quando vem, a ficha diz\nse ele e o registrado na ANTT para a empresa.",
            "nullable": true
          },
          "incluirEstabelecimentos": {
            "type": "boolean",
            "description": "Lista matriz e filiais pela raiz. Custa 1 credito (CNPJa), por isso e opcional."
          },
          "incluirProcessos": {
            "type": "boolean",
            "description": "Processos e processos criminais em nome da razao social. Busca por NOME: aproximada e mais lenta."
          },
          "semCadastro": {
            "type": "boolean",
            "description": "Pula o cadastro na Receita, que e o gargalo em lote (3 por minuto na fonte principal). Os\nblocos de base local respondem na hora; a aptidao fica sem a conferencia de CNAE."
          }
        },
        "additionalProperties": false,
        "description": "Pedido da ficha: o CNPJ que emite o CT-e, de matriz ou de filial."
      },
      "ConsultasHub.Transporte.ResumoDaFichaDto": {
        "type": "object",
        "properties": {
          "cnpjConsultado": {
            "type": "string",
            "nullable": true
          },
          "cnpjDaMatriz": {
            "type": "string",
            "description": "CNPJ da matriz, quando CONFIRMADO pela Receita ou pela lista de estabelecimentos. Nulo se nao confirmado.",
            "nullable": true
          },
          "consultadoEhMatriz": {
            "type": "boolean",
            "nullable": true
          },
          "razaoSocial": {
            "type": "string",
            "nullable": true
          },
          "numeroRntrc": {
            "type": "string",
            "nullable": true
          },
          "numeroRntrcNoDocumentoFiscal": {
            "type": "string",
            "description": "O numero com oito digitos, como vai no CT-e e no MDF-e. Nulo se nao couber em oito.",
            "nullable": true
          },
          "situacaoRntrc": {
            "type": "string",
            "description": "`ATIVO` ou `PENDENTE`: sao as duas situacoes que a ANTT publica. Nao ha \"vencido\".",
            "nullable": true
          },
          "categoriaRntrc": {
            "type": "string",
            "description": "`ETC` (empresa) ou `CTC` (cooperativa). O autonomo (`TAC`) nao e pessoa juridica.",
            "nullable": true
          },
          "equiparadoNoRntrc": {
            "type": "boolean",
            "description": "Se a ANTT marca o transportador como equiparado a autonomo — relevante para a exigencia de CIOT.",
            "nullable": true
          },
          "cnpjRegistradoNoRntrc": {
            "type": "string",
            "description": "O CNPJ que consta na ANTT e como casou (`Documento` ou `Raiz`).",
            "nullable": true
          },
          "casamentoDoRntrc": {
            "type": "string",
            "nullable": true
          },
          "rntrcInformadoConfere": {
            "type": "boolean",
            "description": "Nulo se nenhum numero foi informado ou o RNTRC nao foi conferido; `false` e alerta.",
            "nullable": true
          },
          "podeGravarRntrc": {
            "type": "boolean",
            "description": "Verdadeiro so quando o bloco do RNTRC foi conferido e achou registro. Falso com bloco\n`nao_verificado` NAO significa \"sem RNTRC\"."
          },
          "validadeDoRntrc": {
            "type": "string",
            "description": "A ANTT nao publica validade do registro; o campo existe para a tela nao procurar.",
            "nullable": true
          },
          "parecerDeAptidao": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "O que a tela precisa sem abrir bloco nenhum."
      },
      "ConsultasHub.Versionamento.HistoricoInput": {
        "required": [
          "consulta",
          "documento"
        ],
        "type": "object",
        "properties": {
          "documento": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string"
          },
          "consulta": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ConsultasHub.Versionamento.VersaoDeResultadoDto": {
        "type": "object",
        "properties": {
          "consulta": {
            "type": "string",
            "nullable": true
          },
          "versao": {
            "type": "integer",
            "format": "int32"
          },
          "resultado": {
            "type": "string",
            "description": "Ok ou NaoEncontrado.",
            "nullable": true
          },
          "provedor": {
            "type": "string",
            "nullable": true
          },
          "schema": {
            "type": "string",
            "nullable": true
          },
          "obtidoEm": {
            "type": "string",
            "format": "date-time"
          },
          "confirmadoEm": {
            "type": "string",
            "description": "Ultima vez em que uma consulta ao vivo reconfirmou esta versao.",
            "format": "date-time"
          },
          "dataReferencia": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "idadeEmDias": {
            "type": "integer",
            "format": "int32"
          },
          "retroativo": {
            "type": "boolean",
            "description": "Sempre verdadeiro nesta API: e dado guardado, nao consulta feita agora."
          },
          "dados": {
            "description": "Retorno canonico da consulta. Nulo quando o desfecho foi \"nada consta\".",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Uma versao guardada de uma consulta. Sempre com a data: retroativo nunca se passa por atual."
      },
      "ConsultasHub.Versionamento.VigentesInput": {
        "required": [
          "documento"
        ],
        "type": "object",
        "properties": {
          "documento": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string"
          },
          "consultas": {
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Consultas desejadas (ex.: `cnpj.cadastro`). Vazio = todas as que o documento tem.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Pedido dos resultados vigentes (ultimos guardados) de um documento. Documento no CORPO."
      },
      "Volo.Abp.Http.RemoteServiceErrorInfo": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": { },
            "nullable": true
          },
          "validationErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceValidationErrorInfo"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Volo.Abp.Http.RemoteServiceErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorInfo"
          }
        },
        "additionalProperties": false
      },
      "Volo.Abp.Http.RemoteServiceValidationErrorInfo": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "nullable": true
          },
          "members": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.jabuticaba.cloud/connect/authorize",
            "tokenUrl": "https://api.jabuticaba.cloud/connect/token",
            "scopes": {
              "ConsultasHub": "ConsultasHub API"
            }
          }
        }
      },
      "client_credentials": {
        "type": "oauth2",
        "description": "Credencial da aplicação consumidora (client_id e client_secret emitidos pelo administrador do hub).",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.jabuticaba.cloud/connect/token",
            "scopes": {
              "ConsultasHub": "Consultas Hub API"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": [ ]
    },
    {
      "client_credentials": [
        "ConsultasHub"
      ]
    }
  ],
  "tags": [
    {
      "name": "Consultas"
    },
    {
      "name": "Empresas"
    },
    {
      "name": "Historico"
    },
    {
      "name": "Investigacoes"
    },
    {
      "name": "Pacotes"
    },
    {
      "name": "Retroativo"
    },
    {
      "name": "Teia"
    },
    {
      "name": "Transportadores"
    }
  ]
}