{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/balancos-ai/json-schema/balancos-ai-apps-api-cvm-modelos-envelope-balancos-schema.json",
  "title": "EnvelopeBalancos",
  "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__cvm__modelos__EnvelopeBalancos",
  "properties": {
    "dados": {
      "$ref": "#/$defs/apps__api__cvm__modelos__Balancos"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "dados",
    "meta"
  ],
  "$defs": {
    "BalancoCVM": {
      "properties": {
        "exercicio": {
          "type": "integer",
          "title": "Exercicio"
        },
        "data_referencia": {
          "type": "string",
          "title": "Data Referencia"
        },
        "visao": {
          "type": "string",
          "title": "Visao"
        },
        "versao": {
          "type": "integer",
          "title": "Versao"
        },
        "id_doc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id Doc"
        },
        "familia": {
          "type": "string",
          "title": "Familia"
        },
        "escala_publicada": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Escala Publicada"
        },
        "eq_ativo_passivo": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Eq Ativo Passivo"
        },
        "valores_em_reais": {
          "$ref": "#/$defs/ValoresBalanco"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "exercicio",
        "data_referencia",
        "visao",
        "versao",
        "id_doc",
        "familia",
        "escala_publicada",
        "eq_ativo_passivo",
        "valores_em_reais"
      ],
      "title": "BalancoCVM"
    },
    "CompanhiaResumo": {
      "properties": {
        "cnpj": {
          "type": "string",
          "title": "Cnpj"
        },
        "cd_cvm": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cd Cvm"
        },
        "denominacao": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Denominacao"
        },
        "empresa": {
          "anyOf": [
            {
              "$ref": "#/$defs/EmpresaResumo"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "cnpj",
        "cd_cvm",
        "denominacao",
        "empresa"
      ],
      "title": "CompanhiaResumo"
    },
    "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."
    },
    "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"
    },
    "ValoresBalanco": {
      "properties": {
        "ativo_total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ativo Total"
        },
        "ativo_circulante": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ativo Circulante"
        },
        "ativo_nao_circulante": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ativo Nao Circulante"
        },
        "passivo_circulante": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Passivo Circulante"
        },
        "passivo_nao_circulante": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Passivo Nao Circulante"
        },
        "passivo_total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Passivo Total"
        },
        "patrimonio_liquido": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Patrimonio Liquido"
        },
        "passivo_e_pl_total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Passivo E Pl Total"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "ativo_total",
        "ativo_circulante",
        "ativo_nao_circulante",
        "passivo_circulante",
        "passivo_nao_circulante",
        "passivo_total",
        "patrimonio_liquido",
        "passivo_e_pl_total"
      ],
      "title": "ValoresBalanco"
    },
    "apps__api__cvm__modelos__Balancos": {
      "properties": {
        "companhia": {
          "$ref": "#/$defs/CompanhiaResumo"
        },
        "balancos": {
          "items": {
            "$ref": "#/$defs/BalancoCVM"
          },
          "type": "array",
          "title": "Balancos"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "companhia",
        "balancos"
      ],
      "title": "Balancos"
    }
  }
}