{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/balancos-ai/json-schema/balancos-ai-apps-api-bcb-modelos-envelope-catalogo-schema.json",
  "title": "EnvelopeCatalogo",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/balancos-ai-openapi.json#/components/schemas/apps__api__bcb__modelos__EnvelopeCatalogo",
  "properties": {
    "dados": {
      "$ref": "#/$defs/apps__api__bcb__modelos__Catalogo"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "dados",
    "meta"
  ],
  "$defs": {
    "Codigo": {
      "properties": {
        "codigo": {
          "type": "string",
          "title": "Codigo"
        },
        "nome": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nome"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "codigo",
        "nome"
      ],
      "title": "Codigo"
    },
    "Conglomerados": {
      "properties": {
        "financeiro": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Financeiro"
        },
        "prudencial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Prudencial"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "financeiro",
        "prudencial"
      ],
      "title": "Conglomerados"
    },
    "EmpresaResumo": {
      "properties": {
        "razao_social": {
          "type": "string",
          "title": "Razao Social"
        },
        "slug": {
          "type": "string",
          "title": "Slug"
        },
        "link": {
          "type": "string",
          "title": "Link"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "razao_social",
        "slug",
        "link"
      ],
      "title": "EmpresaResumo",
      "description": "`{razao_social, slug, link}` — o ponteiro leve usado dentro de\nbalanços, DREs e documentos."
    },
    "InstituicaoResumo": {
      "properties": {
        "codinst": {
          "type": "string",
          "title": "Codinst"
        },
        "nome": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nome"
        },
        "cnpj": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj"
        },
        "cnpj_raiz": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Raiz"
        },
        "tipo": {
          "anyOf": [
            {
              "$ref": "#/$defs/Codigo"
            },
            {
              "type": "null"
            }
          ]
        },
        "consolidado_bancario": {
          "anyOf": [
            {
              "$ref": "#/$defs/Codigo"
            },
            {
              "type": "null"
            }
          ]
        },
        "segmento_prudencial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Segmento Prudencial"
        },
        "sede": {
          "$ref": "#/$defs/Sede"
        },
        "conglomerados": {
          "$ref": "#/$defs/Conglomerados"
        },
        "primeira_data_base": {
          "type": "string",
          "title": "Primeira Data Base"
        },
        "ultima_data_base": {
          "type": "string",
          "title": "Ultima Data Base"
        },
        "n_data_bases": {
          "type": "integer",
          "title": "N Data Bases"
        },
        "empresa": {
          "anyOf": [
            {
              "$ref": "#/$defs/EmpresaResumo"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "codinst",
        "nome",
        "cnpj",
        "cnpj_raiz",
        "tipo",
        "consolidado_bancario",
        "segmento_prudencial",
        "sede",
        "conglomerados",
        "primeira_data_base",
        "ultima_data_base",
        "n_data_bases",
        "empresa"
      ],
      "title": "InstituicaoResumo"
    },
    "Meta": {
      "properties": {
        "versao": {
          "type": "string",
          "title": "Versao",
          "default": "v1"
        },
        "release": {
          "type": "string",
          "title": "Release",
          "default": "1.3.0"
        },
        "dados_atualizados_em": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dados Atualizados Em"
        },
        "requisicao_id": {
          "type": "string",
          "title": "Requisicao Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "dados_atualizados_em",
        "requisicao_id"
      ],
      "title": "Meta"
    },
    "Sede": {
      "properties": {
        "uf": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uf"
        },
        "municipio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Municipio"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "uf",
        "municipio"
      ],
      "title": "Sede"
    },
    "apps__api__bcb__modelos__Catalogo": {
      "properties": {
        "instituicoes": {
          "items": {
            "$ref": "#/$defs/InstituicaoResumo"
          },
          "type": "array",
          "title": "Instituicoes"
        },
        "proximo_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proximo Cursor"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "instituicoes",
        "proximo_cursor"
      ],
      "title": "Catalogo"
    }
  }
}