> ## Documentation Index
> Fetch the complete documentation index at: https://octo-98895abd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# v2 statements

> <Warning>Preview, not deployed. The v2 gateway is built but not deployed yet; this call works once the owner deploys `silo-api`.</Warning>

What did the company file? Income, balance sheet, cash flow, headline figures and every stored version.

Example: `/v2/statements?id=PETR4&kind=income`

Kinds:

- `all`: api.financials: every line, one row per account, latest stored version. Paged by date windows. With no id (every kind): the research universe, whose cnpj links a ticker to its filer.
- `income`: api.income_statements: one row per filed period, with period_months.
- `balance`: api.balance_sheets: one row per filed date. A balance sheet is a point in time, so the source has no period_months.
- `cashflow`: api.cash_flow_statements: one row per filed period, with period_months.
- `headline`: api.company_financials: headline figures per filed period. The function takes no p_doc_type, so period is a selection on the rows' doc_type.
- `versions`: api.financial_statement_history: every stored version of one statement (hidden statement, default DRE), with filing metadata. No as_of: it already shows every version.

With no `from`, a dated kind reads the last 60 months to `to`.

`GET /v2/statements?help` describes the main parameters, `?help=all` adds the hidden ones.



## OpenAPI

````yaml /api-docs/v2/openapi.json get /statements
openapi: 3.1.0
info:
  title: SILO API v2 (preview, not deployed)
  version: v2
  description: >-
    The v2 gateway over SILO's schema `api`: 14 resources, five shared
    parameters, one envelope and one error object. Generated from
    supabase/functions/silo-api/registry.ts by scripts/gen_openapi_v2.py; do not
    edit by hand. Preview, not deployed. The v2 gateway is built but not
    deployed yet; this call works once the owner deploys `silo-api`.
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/functions/v1/silo-api/v2
    description: The silo-api Edge Function (preview, not deployed).
security:
  - apikey: []
  - apikey: []
    bearerAuth: []
paths:
  /statements:
    get:
      summary: v2 statements
      description: >-
        <Warning>Preview, not deployed. The v2 gateway is built but not deployed
        yet; this call works once the owner deploys `silo-api`.</Warning>


        What did the company file? Income, balance sheet, cash flow, headline
        figures and every stored version.


        Example: `/v2/statements?id=PETR4&kind=income`


        Kinds:


        - `all`: api.financials: every line, one row per account, latest stored
        version. Paged by date windows. With no id (every kind): the research
        universe, whose cnpj links a ticker to its filer.

        - `income`: api.income_statements: one row per filed period, with
        period_months.

        - `balance`: api.balance_sheets: one row per filed date. A balance sheet
        is a point in time, so the source has no period_months.

        - `cashflow`: api.cash_flow_statements: one row per filed period, with
        period_months.

        - `headline`: api.company_financials: headline figures per filed period.
        The function takes no p_doc_type, so period is a selection on the rows'
        doc_type.

        - `versions`: api.financial_statement_history: every stored version of
        one statement (hidden statement, default DRE), with filing metadata. No
        as_of: it already shows every version.


        With no `from`, a dated kind reads the last 60 months to `to`.


        `GET /v2/statements?help` describes the main parameters, `?help=all`
        adds the hidden ones.
      operationId: v2_statements
      parameters:
        - name: kind
          in: query
          required: false
          description: >-
            all: every filed line, long (api.financials). income, balance,
            cashflow: the standard lines, wide. headline: revenue, net income,
            assets, equity, margins (api.company_financials). versions: every
            stored version of one statement (api.financial_statement_history).
            Default: all.
          schema:
            type: string
            enum:
              - all
              - income
              - balance
              - cashflow
              - headline
              - versions
            default: all
          example: income
        - name: period
          in: query
          required: false
          description: >-
            quarterly: ITR filings. annual: DFP filings. A quarterly filing
            holds the 3-month and the year-to-date figure; period_months on the
            row says which. Never add the two. Default: both.
          schema:
            type: string
            enum:
              - both
              - quarterly
              - annual
            default: both
        - name: scope
          in: query
          required: false
          description: >-
            Consolidated and individual are separate filings of the same period;
            they are never merged. Default: consolidated.
          schema:
            type: string
            enum:
              - consolidated
              - individual
            default: consolidated
        - name: id
          in: query
          required: false
          description: >-
            By kind: all, income, balance, cashflow, headline, versions take a
            listed company's ticker, 14-digit CNPJ or CVM code. With no id,
            kinds all, income, balance, cashflow, headline, versions read
            api.research_universe (what SILO holds). Default: none.
          schema:
            type: string
          example: PETR4
        - name: from
          in: query
          required: false
          description: >-
            First date of the window, YYYY-MM-DD. Default: the resource's
            default window, counted back from to.
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: false
          description: >-
            Last date of the window, YYYY-MM-DD. Default: the latest complete
            period, from coverage.
          schema:
            type: string
            format: date
        - name: limit
          in: query
          required: false
          description: >-
            The page size. More rows than one page come through next_page_url,
            never cut silently; a call stops at the tier's rows-per-call cap
            with meta.tier_cap_reached. Default: the tier's page maximum (10
            anonymous, 100 signed in); a larger value is coerced to it.
          schema:
            type: integer
            minimum: 1
        - name: cursor
          in: query
          required: false
          description: >-
            The opaque cursor from a previous next_page_url. It carries every
            other parameter: send it alone (another parameter with a different
            value is bad_request). Default: none: the first page.
          schema:
            type: string
        - name: as_of
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). Point in time: only
            documents CVM received before this date, at the highest version
            known then. Not for kind versions. Default: none: the latest stored
            version of every document, which is NOT point in time.
          schema:
            type: string
            format: date
        - name: statement
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind versions: the one
            statement to read (DRE income, BPA assets, BPP liabilities and
            equity, DFC_MD or DFC_MI cash flow, DMPL, DRA, DVA). Default: DRE.
          schema:
            type: string
            enum:
              - DRE
              - BPA
              - BPP
              - DFC_MD
              - DFC_MI
              - DMPL
              - DRA
              - DVA
            default: DRE
      responses:
        '200':
          description: The v2 envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
        default:
          description: >-
            The v2 error object. A SILO refusal (over_limit) keeps its message,
            hint and details verbatim.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Envelope:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items: {}
          description: Always a list. Rows as the endpoint returned them; null stays null.
        meta:
          type: object
          required:
            - resource
            - kind
            - request
            - id_known
          properties:
            resource:
              type: string
            kind:
              type:
                - string
                - 'null'
            request:
              type: object
              description: Every parameter the resource takes, with the default applied.
            id_known:
              type:
                - boolean
                - 'null'
              description: Whether SILO holds the id; null when the call names none.
            endpoint:
              type: string
              description: The api.* endpoint that answered.
          additionalProperties: true
        next_page_url:
          type: string
          description: Present only when more rows remain. It carries one opaque cursor.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - target
            - innererror
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unknown_parameter
                - unknown_id
                - unauthorized
                - forbidden_for_tier
                - over_limit
                - rate_limited
                - timeout
                - unavailable
                - internal
            message:
              type: string
            target:
              type:
                - string
                - 'null'
            innererror:
              type: object
              properties:
                sqlstate:
                  type:
                    - string
                    - 'null'
                hint:
                  type:
                    - string
                    - 'null'
                details:
                  type:
                    - string
                    - 'null'
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        The public publishable key. It identifies the project, not you, and is
        the anonymous tier.
      x-default: sb_publishable__yfFQsykAglrvc9GS6_PYw_B24ex437
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Optional. A user JWT from Supabase Auth, for the signed-in tier. Never a
        secret key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.