{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "API CDESP-Empresas: JUCESP e CGE",
    "description" : "Operações relacionadas a pesquisa de empresas: JUCESP e CGE",
    "version" : "1.0"
  },
  "servers" : [ {
    "url" : "https://cdesp-empresas.api-hml.rota.sp.gov.br"
  } ],
  "paths" : {
    "/cge/instituicoes/cnpj/{cnpj}/instituicoes" : {
      "get" : {
        "tags" : [ "Cge" ],
        "summary" : "CGE: Pesquisar instituições pelo CNPJ",
        "description" : "Obtém as instituições com base no CNPJ informado",
        "operationId" : "findInstituicaoByCnpj",
        "parameters" : [ {
          "name" : "cnpj",
          "in" : "path",
          "description" : "Id",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/EmpresaEstabelecimentoDto"
                  }
                }
              }
            }
          },
          "204" : {
            "description" : "instituições não encontradas",
            "content" : { }
          },
          "400" : {
            "description" : "",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ErroDto"
                }
              }
            }
          },
          "401" : {
            "description" : "Acesso não autorizado - token não informado"
          },
          "403" : {
            "description" : "Acesso negado - token sem scope"
          },
          "415" : {
            "description" : "Unsupported Media Type",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ErroDto"
                }
              }
            }
          },
          "500" : {
            "description" : "Erro interno",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ErroDto"
                }
              }
            }
          },
          "503" : {
            "description" : "Circuit breaker aberto - tente novamente após alguns segundos",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ErroDto"
                }
              }
            }
          },
          "504" : {
            "description" : "Timeout no acesso a algum recurso - veja cabeçalho X-System-Error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ErroDto"
                }
              }
            }
          }
        },
        "security" : [ {
          "IDP.SP" : [ "api:cdesp.bigdata.empresaapi.cge.instituicao.search" ]
        } ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "ErroDto" : {
        "type" : "object",
        "properties" : {
          "status" : {
            "type" : "integer",
            "format" : "int32"
          },
          "erros" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        }
      },
      "RepresentanteDto" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEmpresa" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireEmpresa" : {
            "type" : "string"
          },
          "razaoSocial" : {
            "type" : "string"
          },
          "numeroIdentificacao" : {
            "type" : "string"
          },
          "cpfIntegrante" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireIntegrante" : {
            "type" : "integer",
            "format" : "int64"
          },
          "rgIntegrante" : {
            "type" : "string"
          },
          "outroIntegrante" : {
            "type" : "string"
          },
          "nuloIntegrante" : {
            "type" : "string"
          },
          "tipoIdentificacaoId" : {
            "type" : "integer",
            "format" : "int32"
          },
          "tipoIdentificacaoDescricao" : {
            "type" : "string"
          },
          "numeroIdentificacaoRepresentado" : {
            "type" : "string"
          },
          "tipoIdentificacaoRepresentadoId" : {
            "type" : "integer",
            "format" : "int32"
          },
          "tipoRepresentanteId" : {
            "type" : "string"
          }
        }
      },
      "IntegranteDto" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEmpresa" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireEmpresa" : {
            "type" : "string"
          },
          "razaoSocialEmpresa" : {
            "type" : "string"
          },
          "identificacaoNumero" : {
            "type" : "string"
          },
          "cpfIntegrante" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireIntegrante" : {
            "type" : "integer",
            "format" : "int64"
          },
          "rgCartIntegrante" : {
            "type" : "string"
          },
          "integranteOutros" : {
            "type" : "string"
          },
          "integranteNulo" : {
            "type" : "string"
          },
          "identificacaoTipoId" : {
            "type" : "integer",
            "format" : "int32"
          },
          "identificacaoTipoDescricao" : {
            "type" : "string"
          },
          "integranteNome" : {
            "type" : "string"
          },
          "registroPoliciaFederalNumero" : {
            "type" : "string"
          },
          "cnpj" : {
            "type" : "string"
          },
          "integranteCotasValor" : {
            "type" : "number"
          },
          "integranteCotasNumeroAcoes" : {
            "type" : "integer",
            "format" : "int32"
          },
          "integranteEnderecoLogradouro" : {
            "type" : "string"
          },
          "integranteEnderecoNumero" : {
            "type" : "string"
          },
          "integranteEnderecoComplemento" : {
            "type" : "string"
          },
          "integranteEnderecoBairro" : {
            "type" : "string"
          },
          "integranteEnderecoCep" : {
            "type" : "string"
          },
          "integranteEnderecoMunicipio" : {
            "type" : "string"
          },
          "integranteEnderecoEstado" : {
            "type" : "string"
          },
          "nacionalidade" : {
            "type" : "string"
          },
          "naturalidadeEstado" : {
            "type" : "string"
          },
          "naturalidadeMunicipio" : {
            "type" : "string"
          },
          "sexo" : {
            "type" : "string"
          },
          "racaDeclarada" : {
            "type" : "string"
          },
          "operacaoTipo" : {
            "type" : "string"
          },
          "integranteTipoId" : {
            "type" : "integer",
            "format" : "int32"
          },
          "integranteTipoDescricao" : {
            "type" : "string"
          },
          "observacao" : {
            "type" : "string"
          }
        }
      },
      "EmpresaEstabelecimentoDto" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEmpresa" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEstabelecimento" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireEmpresa" : {
            "type" : "string"
          },
          "nireEstabelecimento" : {
            "type" : "string"
          },
          "razaoSocialEmpresa" : {
            "type" : "string"
          },
          "cnpjEstabelecimento" : {
            "type" : "string"
          },
          "valorCapital" : {
            "type" : "number"
          },
          "tipoJuridicoDescricao" : {
            "type" : "string"
          },
          "dataEmpresaConstituicao" : {
            "type" : "string",
            "format" : "date-time"
          },
          "dataEmpresaEncerramento" : {
            "type" : "string",
            "format" : "date-time"
          },
          "dataEstabelecimentoAbertura" : {
            "type" : "string",
            "format" : "date-time"
          },
          "dataEstabelecimentoFechamento" : {
            "type" : "string",
            "format" : "date-time"
          },
          "dataEstabelecimentoAtividadeInicio" : {
            "type" : "string",
            "format" : "date-time"
          },
          "dataEstabelecimentoAtividadeTermino" : {
            "type" : "string",
            "format" : "date-time"
          },
          "empresaEnderecoLogradouro" : {
            "type" : "string"
          },
          "empresaEnderecoNumero" : {
            "type" : "string"
          },
          "empresaEnderecoComplemento" : {
            "type" : "string"
          },
          "empresaEnderecoBairro" : {
            "type" : "string"
          },
          "empresaEnderecoCep" : {
            "type" : "string"
          },
          "empresaEnderecoMunicipio" : {
            "type" : "string"
          },
          "empresaEnderecoEstado" : {
            "type" : "string"
          },
          "situacaoDescricao" : {
            "type" : "string"
          },
          "empresaPorte" : {
            "type" : "string"
          },
          "estabelecimentoInscricaoEstadual" : {
            "type" : "string"
          },
          "matrizDescricao" : {
            "type" : "string"
          },
          "idEndereco" : {
            "type" : "integer",
            "format" : "int64"
          }
        }
      },
      "CnaeDto" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEmpresa" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEstabelecimento" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireEmpresa" : {
            "type" : "string"
          },
          "nireEstabelecimento" : {
            "type" : "string"
          },
          "cnaeNumeroSubClasse" : {
            "type" : "string"
          },
          "cnaeCodigoSubClasse" : {
            "type" : "string"
          },
          "cnaeCodigoCompletoSubClasse" : {
            "type" : "string"
          },
          "cnaeDescricao" : {
            "type" : "string"
          },
          "cnaeTipo" : {
            "type" : "string"
          }
        }
      },
      "CargoDto" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "idEmpresa" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireEmpresa" : {
            "type" : "string"
          },
          "razaoSocialEmpresa" : {
            "type" : "string"
          },
          "identificacao" : {
            "type" : "string"
          },
          "cpfIntegrante" : {
            "type" : "integer",
            "format" : "int64"
          },
          "nireIntegrante" : {
            "type" : "integer",
            "format" : "int64"
          },
          "rgCartIntegrante" : {
            "type" : "string"
          },
          "integranteOutros" : {
            "type" : "string"
          },
          "integranteNulo" : {
            "type" : "string"
          },
          "identificacaoTipo" : {
            "type" : "string"
          },
          "cargoId" : {
            "type" : "integer",
            "format" : "int32"
          },
          "admissaoData" : {
            "type" : "string",
            "format" : "date-time"
          },
          "destituicaoData" : {
            "type" : "string",
            "format" : "date-time"
          },
          "cargoDescricao" : {
            "type" : "string"
          },
          "operacaoTipo" : {
            "type" : "string"
          },
          "operacaoTipoData" : {
            "type" : "string",
            "format" : "date-time"
          }
        }
      },
      "AtoDto" : {
        "type" : "object",
        "properties" : {
          "idEmpresa" : {
            "type" : "number",
            "format" : "double"
          },
          "nireEmpresa" : {
            "type" : "string"
          },
          "razaoSocial" : {
            "type" : "string"
          },
          "arquivamentoId" : {
            "type" : "number",
            "format" : "double"
          },
          "arquivamentoDataRegistro" : {
            "type" : "string",
            "format" : "date-time"
          },
          "atoId" : {
            "type" : "number",
            "format" : "double"
          },
          "atoDescricao" : {
            "type" : "string"
          },
          "atoSigla" : {
            "type" : "string"
          }
        }
      }
    },
    "securitySchemes" : {
      "IDP.SP" : {
        "type" : "oauth2",
        "description" : "Oauth2 flow",
        "flows" : {
          "clientCredentials" : {
            "tokenUrl" : "https://rhsso.idp-hml.sp.gov.br/auth/realms/idpsp/protocol/openid-connect/token",
            "scopes" : {
              "api:cdesp.bigdata.empresaapi.jucesp.estabelecimento.search" : "Pesquisar por empresa estabelecimento",
              "api:cdesp.bigdata.empresaapi.jucesp.integrante.search" : "JUCESP: Obter Integrantes",
              "api:cdesp.bigdata.empresaapi.jucesp.cnae.search" : "JUCESP: Obter CNAES",
              "api:cdesp.bigdata.empresaapi.jucesp.representante.search" : "JUCESP: Obter Representantes",
              "api:cdesp.bigdata.empresaapi.jucesp.ato.search" : "JUCESP: Obter Atos",
              "api:cdesp.bigdata.empresaapi.jucesp.cargo.search" : "JUCESP: Obter Cargos",
              "api:cdesp.bigdata.empresaapi.cge.instituicao.search" : "CGE: Obter Instituições",
              "api:cdesp.bigdata.empresaapi.cge.dirigentes.search" : "CGE: Obter Dirigentes"
            }
          }
        }
      }
    }
  }
}