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

# Read a filing's rows as its file shows them

> Answers every set of a Draft or Final filing, rows in the order the generation wrote them, with the correction trail applied — the values the file carries, read from the rows the draft was rendered from, never from the data source again. Nothing is recomputed: a corrected row's parent account moves only if a person corrects it too. Numbers are strings of their exact digits. Also answers the fields still open, the trail, and, for each hierarchical set, each row's nearest ancestor that is a row of the set. A custom report answers 404; one still generating or failed answers 409.



## OpenAPI

````yaml /en/openapi/v3-current/reporter.yaml get /v1/regulatory/reports/{reportId}/rows
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    This is OpenAPI documentation for Reporter. The unified reporter binary
    serves the REST API (RUN_MODE=api) and/or the RabbitMQ report-generation
    worker (RUN_MODE=worker); RUN_MODE=all runs both in one process for local
    development. All REST endpoints documented here serve only when RUN_MODE=api
    or all (port :4005); the worker (port :4006) exposes health/readyz/version
    only.
  license:
    name: Lerian Studio General License
  title: Midaz Reporter API
  version: 4.0.0
servers:
  - url: https://reporter.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: Generated report instances and their lifecycle.
    name: Reports
  - description: Reusable report definitions.
    name: Templates
  - description: Interactive construction of report templates.
    name: Template Builder
  - description: Scheduled report due-date tracking.
    name: Deadlines
  - description: Configured inputs that feed report data.
    name: Data Sources
  - description: Aggregated reporting metrics.
    name: Metrics
  - description: Published business event catalog and delivery policies.
    name: Streaming
paths:
  /v1/regulatory/reports/{reportId}/rows:
    get:
      tags:
        - Regulatory Reports
      summary: Read a filing's rows as its file shows them
      description: >-
        Answers every set of a Draft or Final filing, rows in the order the
        generation wrote them, with the correction trail applied — the values
        the file carries, read from the rows the draft was rendered from, never
        from the data source again. Nothing is recomputed: a corrected row's
        parent account moves only if a person corrects it too. Numbers are
        strings of their exact digits. Also answers the fields still open, the
        trail, and, for each hierarchical set, each row's nearest ancestor that
        is a row of the set. A custom report answers 404; one still generating
        or failed answers 409.
      operationId: getRegulatoryDraftRows
      parameters:
        - description: Report identifier.
          example: 00000000-0000-0000-0000-000000000001
          in: path
          name: reportId
          required: true
          schema:
            description: Report identifier.
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftRows'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Conflict
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
components:
  schemas:
    DraftRows:
      additionalProperties: false
      properties:
        corrections:
          description: The correction trail, oldest first.
          items:
            $ref: '#/components/schemas/Correction'
          type:
            - array
            - 'null'
        datasets:
          additionalProperties:
            items:
              additionalProperties: {}
              type: object
            type:
              - array
              - 'null'
          description: >-
            Every set of the filing, by name, rows in generation order. Numbers
            are strings of their exact digits; a corrected value is the text the
            person supplied.
          type: object
        documentId:
          description: Curated document the filing files.
          examples:
            - br.bcb.cadoc-4010
          type: string
        documentVersion:
          description: Pinned document version the filing was generated against.
          examples:
            - 1.4.2
          type: string
        draftVersion:
          description: Draft version these rows are. A correction presents it as If-Match.
          examples:
            - 2
          format: int64
          type: integer
        openGaps:
          description: >-
            Fields still unfilled after the corrections; the draft cannot be
            approved while a required one is open.
          items:
            $ref: '#/components/schemas/Gap'
          type:
            - array
            - 'null'
        parents:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          description: >-
            For each hierarchical set, each row's key mapped to the key of its
            nearest ancestor that is itself a row of the set. Rows with none are
            absent. Always an object.
          type: object
        reportId:
          description: Report identifier.
          examples:
            - 00000000-0000-0000-0000-000000000001
          type: string
        status:
          description: Draft or Final.
          examples:
            - Draft
          type: string
      required:
        - reportId
        - documentId
        - documentVersion
        - status
        - draftVersion
        - datasets
        - openGaps
        - corrections
        - parents
      type: object
    Detail:
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          examples:
            - - location: body.templateId
                message: expected string to match 'uuid' format
                value: not-a-uuid
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    Correction:
      additionalProperties: false
      properties:
        appliedAt:
          description: When it was applied, UTC.
          examples:
            - '2026-03-12T09:40:00Z'
          format: date-time
          type: string
        appliedBy:
          description: >-
            Who applied it, as the Access Manager subject identifier the bearer
            token named.
          examples:
            - 3f9a1c2e-0f5b-4d9a-9b8e-1a2b3c4d5e6f
          type: string
        dataset:
          description: Set the correction landed on.
          examples:
            - cosif_balances
          type: string
        draftVersion:
          description: Draft version this correction produced.
          examples:
            - 4
          format: int64
          type: integer
        field:
          description: Field of that set.
          examples:
            - saldo
          type: string
        previousValue:
          description: What the draft carried before this correction.
          examples:
            - '1420.00'
          type: string
        reason:
          description: Why — the sentence an auditor reads.
          examples:
            - Estorno lançado após o fechamento.
          type: string
        row:
          additionalProperties:
            type: string
          description: >-
            Which row of a repeated set, by the set's grain keys. Absent for a
            singleton.
          examples:
            - cosifCode: '1120000006'
          type: object
        value:
          description: The value the person supplied.
          examples:
            - '1500.00'
          type: string
      required:
        - draftVersion
        - dataset
        - field
        - value
        - appliedAt
        - appliedBy
      type: object
    Gap:
      additionalProperties: false
      properties:
        field:
          description: Position in the contract the draft cannot fill, as "dataset.field".
          examples:
            - saldos_cosif.valor
          type: string
        reason:
          description: What the person completing the draft is told about this position.
          examples:
            - a consulta mapeada não devolve esta coluna
          type: string
        required:
          description: >-
            True when the document requires this position, which is what stops
            the draft being approved or downloaded.
          type: boolean
      required:
        - field
        - reason
        - required
      type: object
    ErrorDetail:
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          examples:
            - body.templateId
          type: string
        message:
          description: Error message text
          examples:
            - expected string to match 'uuid' format
          type: string
        value:
          description: The value at the given location
          examples:
            - not-a-uuid
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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