> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dados.rio/llms.txt
> Use this file to discover all available pages before exploring further.

# Obter informações de uma entidade jurídica por CNPJ

> Recupera informações detalhadas de uma entidade jurídica (pessoa jurídica) pelo CNPJ. O acesso é permitido para administradores ou se o CPF do JWT estiver como responsável ou sócio da entidade.



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/app-rmi/refs/heads/main/docs/openapi-v3.json get /legal-entity/{cnpj}
openapi: 3.0.0
info:
  description: >-
    API para gerenciamento de dados de cidadãos do Rio de Janeiro, incluindo
    autodeclaração de informações e verificação de contato.
  title: API RMI
  termsOfService: http://swagger.io/terms/
  contact:
    name: Suporte RMI
    url: http://www.rio.rj.gov.br
    email: suporte@rio.rj.gov.br
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://services.pref.rio/rmi/v1
    description: Production
  - url: https://services.staging.app.dados.rio/rmi/v1
    description: Staging
security: []
tags:
  - description: >-
      Operações relacionadas a cidadãos, incluindo consulta e atualização de
      dados autodeclarados
    name: citizen
  - description: Operações relacionadas a departamentos/unidades administrativas (UA)
    name: departments
  - description: Gerenciamento de categorias de notificação (admin) e listagem pública
    name: notification-categories
  - description: Gerenciamento de preferências de notificação por CPF e telefone
    name: notification-preferences
  - description: Operações de verificação de saúde da API
    name: health
paths:
  /legal-entity/{cnpj}:
    get:
      tags:
        - legal-entity
      summary: Obter informações de uma entidade jurídica por CNPJ
      description: >-
        Recupera informações detalhadas de uma entidade jurídica (pessoa
        jurídica) pelo CNPJ. O acesso é permitido para administradores ou se o
        CPF do JWT estiver como responsável ou sócio da entidade.
      parameters:
        - description: CNPJ da entidade (14 dígitos)
          name: cnpj
          in: path
          required: true
          schema:
            type: string
            minLength: 14
            maxLength: 14
      responses:
        '200':
          description: Informações da entidade jurídica obtidas com sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.LegalEntity'
        '400':
          description: Formato de CNPJ inválido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '401':
          description: Token de autenticação não fornecido ou inválido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '403':
          description: Acesso negado - sem permissão para visualizar esta entidade
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '404':
          description: Entidade jurídica não encontrada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '429':
          description: Muitas requisições - limite de taxa excedido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '500':
          description: Erro interno do servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    models.LegalEntity:
      type: object
      properties:
        _id: {}
        capital_social:
          type: number
        cnae_fiscal:
          type: string
        cnae_secundarias:
          type: array
          items:
            type: string
        cnpj:
          type: string
        contador:
          $ref: '#/components/schemas/models.Accountant'
        contato:
          $ref: '#/components/schemas/models.LegalEntityContact'
        endereco:
          $ref: '#/components/schemas/models.LegalEntityAddress'
        ente_federativo:
          $ref: '#/components/schemas/models.FederativeEntity'
        formas_atuacao:
          type: array
          items:
            type: string
        inicio_atividade_data:
          type: string
        language:
          type: string
        matriz_filial:
          $ref: '#/components/schemas/models.HeadquartersBranch'
        natureza_juridica:
          $ref: '#/components/schemas/models.LegalNature'
        nire:
          type: string
        nome_fantasia:
          type: string
        orgao_registro:
          $ref: '#/components/schemas/models.RegistrationAuthority'
        porte:
          $ref: '#/components/schemas/models.CompanySize'
        razao_social:
          type: string
        responsavel:
          $ref: '#/components/schemas/models.ResponsiblePerson'
        situacao_cadastral:
          $ref: '#/components/schemas/models.RegistrationStatus'
        situacao_especial:
          $ref: '#/components/schemas/models.SpecialStatus'
        socios:
          type: array
          items:
            $ref: '#/components/schemas/models.Partner'
        socios_quantidade:
          type: integer
        sucessoes:
          type: array
          items: {}
        tipos_unidade:
          type: array
          items:
            type: string
    handlers.ErrorResponse:
      type: object
      properties:
        error:
          type: string
    models.Accountant:
      type: object
      properties:
        pf:
          $ref: '#/components/schemas/models.AccountantIndividual'
        pj:
          $ref: '#/components/schemas/models.AccountantCorporate'
    models.LegalEntityContact:
      type: object
      properties:
        email:
          type: string
        telefone:
          type: array
          items:
            $ref: '#/components/schemas/models.LegalEntityPhone'
    models.LegalEntityAddress:
      type: object
      properties:
        bairro:
          type: string
        cep:
          type: string
        complemento:
          type: string
        id_municipio:
          type: string
        id_pais:
          type: string
        logradouro:
          type: string
        municipio_exterior_nome:
          type: string
        municipio_nome:
          type: string
        numero:
          type: string
        tipo_logradouro:
          type: string
        uf:
          type: string
    models.FederativeEntity:
      type: object
      properties:
        id:
          type: string
        tipo:
          type: string
    models.HeadquartersBranch:
      type: object
      properties:
        descricao:
          type: string
        id:
          type: string
    models.LegalNature:
      type: object
      properties:
        descricao:
          type: string
        id:
          type: string
    models.RegistrationAuthority:
      type: object
      properties:
        descricao:
          type: string
        id:
          type: string
    models.CompanySize:
      type: object
      properties:
        descricao:
          type: string
        id:
          type: string
    models.ResponsiblePerson:
      type: object
      properties:
        cpf:
          type: string
        inclusao_data:
          type: string
        qualificacao_descricao:
          type: string
        qualificacao_id:
          type: string
    models.RegistrationStatus:
      type: object
      properties:
        data:
          type: string
        descricao:
          type: string
        id:
          type: string
        motivo_descricao:
          type: string
        motivo_id:
          type: string
    models.SpecialStatus:
      type: object
      properties:
        data:
          type: string
        descricao:
          type: string
    models.Partner:
      type: object
      properties:
        cnpj_socio:
          type: string
        codigo_pais:
          type: string
        cpf_representante_legal:
          type: string
        cpf_socio:
          type: string
        data_situacao_especial:
          type: string
        nome_socio_estrangeiro:
          type: string
        qualificacao_representante_legal:
          type: string
        qualificacao_socio:
          type: string
        tipo:
          type: string
    models.AccountantIndividual:
      type: object
      properties:
        classificacao_crc:
          type: string
        id:
          type: string
        sequencial_crc:
          type: string
        tipo_crc:
          type: string
    models.AccountantCorporate:
      type: object
      properties:
        classificacao_crc:
          type: string
        id:
          type: string
        sequencial_crc:
          type: string
        tipo_crc:
          type: string
    models.LegalEntityPhone:
      type: object
      properties:
        ddd:
          type: string
        telefone:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````