components:
  schemas:
    Adjustment:
      additionalProperties: false
      properties:
        added:
          items:
            type: string
          type:
            - array
            - "null"
        compared:
          type: boolean
        rebound:
          items:
            type: string
          type:
            - array
            - "null"
        removed:
          items:
            type: string
          type:
            - array
            - "null"
        retargeted:
          items:
            type: string
          type:
            - array
            - "null"
        total:
          format: int64
          type: integer
        untouched:
          format: int64
          type: integer
      required:
        - compared
        - untouched
        - total
      type: object
    AdoptRegulatoryVersionHumaInputBody:
      additionalProperties: false
      properties:
        version:
          description: Catalog version to adopt. Omitted, the newest the origin has.
          examples:
            - 1.1.0
          type: string
      type: object
    Adoption:
      additionalProperties: false
      properties:
        adoptedAt:
          description: When it was adopted
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        adoptedBy:
          description: Who adopted it
          examples:
            - operator@bank.example
          type: string
        supersedes:
          description: Version it replaced, absent on the first adoption
          examples:
            - 1.0.0
          type: string
        version:
          description: Document version adopted
          examples:
            - 1.1.0
          type: string
      required:
        - version
        - adoptedAt
        - adoptedBy
      type: object
    ApplyRegulatoryOverridesHumaInputBody:
      additionalProperties: false
      properties:
        overrides:
          description: Corrections to apply, each one a value for one field of one row. At most 500 per request; corrections accumulate across requests, so send more requests rather than a bigger one.
          items:
            $ref: "#/components/schemas/OverrideInput"
          maxItems: 500
          minItems: 1
          type:
            - array
            - "null"
      required:
        - overrides
      type: object
    BindingPreview:
      additionalProperties: false
      properties:
        columns:
          description: "The columns the query answers, in order: its groups then its sums when it aggregates; the columns it selects, else the ones it reads, when it does not."
          examples:
            -   - cosif
                - natureza
                - saldo
          items:
            type: string
          type:
            - array
            - "null"
        durationMs:
          description: How long the read took.
          examples:
            - 41
          format: int64
          type: integer
        hasMore:
          description: True when the query has more rows than the limit; the rows were cut, never refused.
          examples:
            - false
          type: boolean
        limit:
          description: The limit applied.
          examples:
            - 20
          format: int64
          type: integer
        query:
          description: The query read.
          examples:
            - saldos
          type: string
        rows:
          description: At most limit rows, each keyed by the columns above. A number is its decimal text, never a float; null is null.
          items:
            additionalProperties: {}
            type: object
          type:
            - array
            - "null"
      required:
        - query
        - columns
        - rows
        - limit
        - hasMore
        - durationMs
      type: object
    BlockDefinition:
      properties:
        acceptsChildren:
          description: Whether the block can contain nested template blocks.
          examples:
            - true
          type: boolean
        category:
          description: Builder category used to group related block types.
          examples:
            - control
          type: string
        label:
          description: Human-readable block label displayed by clients.
          examples:
            - Loop
          type: string
        properties:
          description: Additional configuration properties supported by the block type.
          examples:
            -   - name: counterMode
                  required: true
                  type: enum
                  values:
                    - increment
                    - show
          items:
            $ref: "#/components/schemas/BlockProperty"
          type:
            - array
            - "null"
        type:
          description: Stable block type used in template-builder payloads.
          examples:
            - loop
          type: string
      type: object
    BlockProperty:
      properties:
        name:
          description: Configuration property name.
          examples:
            - counterMode
          type: string
        required:
          description: Whether the property must be supplied for the block.
          examples:
            - true
          type: boolean
        type:
          description: Value type accepted by the property.
          examples:
            - enum
          type: string
        values:
          description: Allowed values for enum properties.
          examples:
            -   - increment
                - show
          items:
            type: string
          type:
            - array
            - "null"
      type: object
    BlocksConfigResponse:
      properties:
        blocks:
          description: Block definitions available to template-builder clients.
          examples:
            -   - acceptsChildren: true
                  category: control
                  label: Loop
                  type: loop
          items:
            $ref: "#/components/schemas/BlockDefinition"
          type:
            - array
            - "null"
      type: object
    CatalogDocument:
      additionalProperties: false
      properties:
        country:
          examples:
            - BR
          type: string
        document:
          description: The regulator's own name for it.
          examples:
            - "4010"
          type: string
        family:
          description: Group of filings the document belongs to, as a lowercase code.
          examples:
            - cadoc
          type: string
        hasReferenceBinding:
          description: Whether the catalog ships a starting mapping for this document.
          type: boolean
        id:
          description: Document identifier, as a subscription names it.
          examples:
            - br.bcb.cadoc-4010
          type: string
        institutionTypes:
          description: Types of institution required to file it, as the regulator codes them.
          examples:
            -   - IP
                - SCD
                - SCFI
          items:
            type: string
          type:
            - array
            - "null"
        layout:
          $ref: "#/components/schemas/CatalogLayout"
          description: Layout edition in force, on a document that has more than one.
        officialSource:
          description: The regulator's own page for the document's layout.
          examples:
            - https://www.bcb.gov.br/estabilidadefinanceira/leiautedocumentoscrd
          type: string
        output:
          description: File format the regulator receives; absent means xml.
          examples:
            - xml
          type: string
        periodicity:
          examples:
            - monthly
          type: string
        regulator:
          examples:
            - bcb
          type: string
        status:
          examples:
            - active
          type: string
        summary:
          description: What the document is, in one or two sentences.
          examples:
            - Saldos por rubrica COSIF na data-base.
          type: string
        title:
          description: What the document is called.
          examples:
            - Balancete Patrimonial Analítico
          type: string
        version:
          description: Catalog version of this document.
          examples:
            - 1.0.0
          type: string
      required:
        - id
        - title
        - version
        - hasReferenceBinding
      type: object
    CatalogLayout:
      additionalProperties: false
      properties:
        mandatoryFrom:
          description: First data-base the layout applies to, as AAAA-MM-DD.
          examples:
            - "2025-01-02"
          type: string
        version:
          examples:
            - 2025-01
          type: string
      type: object
    CatalogOrigin:
      additionalProperties: false
      properties:
        bindingOrigin:
          description: Whether the report was generated from the catalog's reference binding, from that reference with additional sources the client added, or from a binding the client made.
          enum:
            - reference
            - referenceWithAdditions
            - customized
          examples:
            - reference
          type: string
        bindingVersion:
          description: Version of the binding the report was generated from.
          examples:
            - 3
          format: int64
          type: integer
        documentId:
          description: Curated document this report files.
          examples:
            - br.bcb.cadoc-4010
          type: string
        documentVersion:
          description: Catalog version of the document in force when it was generated.
          examples:
            - 1.0.0
          type: string
        institution:
          $ref: "#/components/schemas/InstitutionSnapshot"
          description: Institution the filing declares for, as frozen when it was requested. Absent on a filing generated before filings named an institution.
        subscriptionId:
          type: string
      required:
        - documentId
        - documentVersion
        - subscriptionId
        - bindingVersion
      type: object
    CategoryCount:
      additionalProperties: false
      properties:
        category:
          description: Report family
          examples:
            - cadoc
          type: string
        count:
          description: How many live templates are filed under this family
          examples:
            - 3
          format: int64
          type: integer
      required:
        - category
        - count
      type: object
    ColumnReadiness:
      additionalProperties: false
      properties:
        column:
          type: string
        found:
          type: boolean
        unchecked:
          type: boolean
      required:
        - column
        - found
      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
    CreateRegulatoryReportHumaInputBody:
      additionalProperties: false
      properties:
        parameters:
          additionalProperties:
            type: string
          description: Generation parameters, keyed by name as the contract declares them. A parameter the contract does not declare is refused. At most 50 parameters, each value at most 512 characters.
          examples:
            - dataBase: 2026-03
          maxProperties: 50
          type: object
        subscriptionId:
          description: Subscription this filing is generated under.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
      required:
        - subscriptionId
      type: object
    DataSource:
      properties:
        builtIn:
          description: True for a data source the platform provides from the tenant's Lerian module databases; read-only, never registered
          examples:
            - false
          type: boolean
        configName:
          description: Stable business key referenced by templates
          examples:
            - midaz_onboarding
          type: string
        createdAt:
          description: Creation timestamp in UTC
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        databaseName:
          description: Database name
          examples:
            - onboarding
          type: string
        host:
          description: Database host
          examples:
            - db.internal
          type: string
        id:
          description: Unique data source identifier
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        lastConnection:
          $ref: "#/components/schemas/DataSourceConnection"
          description: Outcome of the most recent connectivity probe; absent means never probed, which is not the same as failed
        metadata:
          additionalProperties: {}
          description: Free-form metadata
          type: object
        options:
          description: MongoDB URI options string (e.g. authSource=admin); mongodb only
          examples:
            - authSource=admin
          type: string
        port:
          description: Database port
          examples:
            - 5432
          format: int64
          type: integer
        schemas:
          description: PostgreSQL schemas to expose
          examples:
            -   - public
          items:
            type: string
          type:
            - array
            - "null"
        sslCaBase64:
          description: Base64-encoded PEM CA bundle for MongoDB or PostgreSQL; never a private key. PostgreSQL requires sslMode verify-ca or verify-full.
          examples:
            - ""
          type: string
        sslMode:
          description: "TLS mode: disable, require, verify-ca, or verify-full. The two engines read require differently: MongoDB's driver verifies the server certificate under require (verify-full in effect), PostgreSQL's encrypts without verifying it; verify-full means the same on both."
          examples:
            - require
          type: string
        type:
          description: Data source engine type
          examples:
            - postgresql
          type: string
        updatedAt:
          description: Most recent update timestamp in UTC
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        username:
          description: Database username
          examples:
            - reporter_ro
          type: string
      type: object
    DataSourceConnection:
      additionalProperties: false
      properties:
        checkedAt:
          description: When the last probe ran, in UTC. Distinct from updatedAt, which records configuration edits
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        latencyMs:
          description: Full dial+ping round trip of the last probe, in milliseconds
          examples:
            - 42
          format: int64
          type: integer
        message:
          description: Client-safe classification of the last probe; raw driver errors never appear here
          examples:
            - connection successful
          type: string
        status:
          description: "Outcome of the last probe: connected or failed"
          examples:
            - connected
          type: string
      required:
        - status
        - message
        - latencyMs
        - checkedAt
      type: object
    DataSourceConnectionResult:
      properties:
        latencyMs:
          description: Full dial+ping round trip in milliseconds — the latency the user experiences.
          examples:
            - 42
          format: int64
          type: integer
        message:
          description: Client-safe probe classification; raw driver errors never appear here.
          examples:
            - connection successful
          type: string
        status:
          description: "Probe outcome: connected or failed."
          examples:
            - connected
          type: string
      type: object
    DataSourceListHumaBody:
      properties:
        items:
          description: Data sources in the requested page.
          items:
            $ref: "#/components/schemas/DataSource"
          type:
            - array
            - "null"
        limit:
          description: Maximum number of data sources in the page.
          examples:
            - 10
          format: int64
          type: integer
        page:
          description: Current one-based page number.
          examples:
            - 1
          format: int64
          type: integer
        total:
          description: Total number of registered data sources.
          examples:
            - 10
          format: int64
          type: integer
      type: object
    DataSourceSchemaResult:
      properties:
        configName:
          description: Stable business key referenced by templates.
          examples:
            - midaz_onboarding
          type: string
        databaseName:
          description: Database name.
          examples:
            - onboarding
          type: string
        id:
          description: Unique data source identifier.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        tables:
          description: Queryable tables or collections with typed fields.
          items:
            $ref: "#/components/schemas/SchemaTable"
          type:
            - array
            - "null"
        type:
          description: Data source engine type.
          examples:
            - postgresql
          type: string
      type: object
    DataSourceScope:
      additionalProperties: false
      properties:
        tables:
          additionalProperties:
            $ref: "#/components/schemas/TableScope"
          description: The tables of the data source the institution reads, keyed by table name; empty when it owns the whole data source.
          type: object
        whole:
          description: The institution owns every table of the data source.
          examples:
            - false
          type: boolean
      required:
        - whole
        - tables
      type: object
    Deadline:
      properties:
        active:
          description: Whether the deadline is active.
          examples:
            - true
          type: boolean
        color:
          description: Hex color used to identify the deadline.
          examples:
            - "#FF5733"
          type: string
        createdAt:
          description: Date and time when the deadline was created.
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        deliveredAt:
          description: Date and time when the deadline was delivered.
          examples:
            - "2026-03-15T10:00:00Z"
          format: date-time
          type: string
        description:
          description: Optional deadline description.
          examples:
            - Monthly regulatory compliance report
          type: string
        dueDate:
          description: Date and time when the deadline is due. Its clock time is the hour the reminder starts firing from.
          examples:
            - "2026-03-31T23:59:59Z"
          format: date-time
          type: string
        filters:
          additionalProperties:
            additionalProperties:
              additionalProperties:
                $ref: "#/components/schemas/DeadlineFilterCondition"
              type: object
            type: object
          description: Filter conditions this deadline applies when it fires, grouped by data source, table, and field. Absent when the deadline filters nothing.
          examples:
            - accounts:
                account:
                  vencimento:
                    period: previous_month
          type: object
        frequency:
          description: Deadline recurrence frequency.
          examples:
            - monthly
          type: string
        id:
          description: Unique deadline identifier.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        institution:
          description: "The institution the reports this deadline generates read for: an institution id, or \"all\". Absent, each report takes the tenant's only institution when it fires, reads everything when the tenant has none, and is refused when it has several."
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        monthsOfYear:
          description: Months in which a semiannual or annual deadline occurs.
          examples:
            -   - 1
                - 6
          items:
            format: int64
            type: integer
          type:
            - array
            - "null"
        name:
          description: Human-readable deadline name.
          examples:
            - Monthly Regulatory Report
          type: string
        notifyDaysBefore:
          description: Days before the due date when notifications begin.
          examples:
            - 5
          format: int64
          type: integer
        status:
          description: Current derived deadline status.
          examples:
            - pending
          type: string
        templateId:
          description: Template used to generate the report.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        templateName:
          description: Human-readable name of the associated template.
          examples:
            - Financial Template
          type: string
        timezone:
          description: IANA timezone name that gives the dueDate clock time its meaning, along which the recurrence advances, and in which today's calendar day is counted for the past-day refusal and daysUntilDue. Empty means UTC.
          examples:
            - America/Sao_Paulo
          type: string
        type:
          description: Deadline category.
          examples:
            - regulatory
          type: string
        updatedAt:
          description: Date and time when the deadline was last updated.
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
      type: object
    DeadlineFilterCondition:
      properties:
        between:
          description: Inclusive lower and upper bounds for a range match.
          examples:
            -   - 100
                - 1000
          items: {}
          type:
            - array
            - "null"
        eq:
          description: Values matched for equality; multiple values are combined with OR.
          examples:
            -   - active
                - pending
          items: {}
          type:
            - array
            - "null"
        gt:
          description: Single lower-bound value that the field must exceed.
          examples:
            -   - 100
          items: {}
          type:
            - array
            - "null"
        gte:
          description: Single inclusive lower-bound value for the field.
          examples:
            -   - "2025-06-01"
          items: {}
          type:
            - array
            - "null"
        in:
          description: Values for which the field may match any member of the list.
          examples:
            -   - active
                - pending
                - suspended
          items: {}
          type:
            - array
            - "null"
        isNull:
          description: Matches records where the field holds no value (NULL, or absent in a document). Carries no values and is not combined with other operators on the same field.
          examples:
            - true
          type: boolean
        lt:
          description: Single upper-bound value that the field must remain below.
          examples:
            -   - 1000
          items: {}
          type:
            - array
            - "null"
        lte:
          description: Single inclusive upper-bound value for the field.
          examples:
            -   - "2025-06-30"
          items: {}
          type:
            - array
            - "null"
        nin:
          description: Values excluded from matching records.
          examples:
            -   - deleted
                - archived
          items: {}
          type:
            - array
            - "null"
        notNull:
          description: Matches records where the field holds a value. Carries no values.
          examples:
            - true
          type: boolean
        notStartsWith:
          description: Text prefixes excluded from matching records. Text columns only.
          examples:
            -   - "7"
                - "8"
          items: {}
          type:
            - array
            - "null"
        period:
          description: Relative date window resolved into a concrete range when a deadline fires. Mutually exclusive with every other operator on the same field.
          examples:
            - previous_month
          type: string
        startsWith:
          description: Text prefixes the field may begin with; any one of them matches. Text columns only.
          examples:
            -   - "1"
                - "2"
          items: {}
          type:
            - array
            - "null"
      type: object
    DeadlineListHumaBody:
      properties:
        items:
          description: Deadlines in the requested page.
          examples:
            -   - active: true
                  color: "#FF5733"
                  createdAt: "2026-01-01T00:00:00Z"
                  description: Monthly regulatory compliance report
                  dueDate: "2026-07-31T00:00:00Z"
                  frequency: monthly
                  id: 00000000-0000-0000-0000-000000000001
                  name: Monthly Regulatory Report
                  notifyDaysBefore: 5
                  status: pending
                  type: regulatory
                  updatedAt: "2026-01-01T00:00:00Z"
          items:
            $ref: "#/components/schemas/Deadline"
          type:
            - array
            - "null"
        limit:
          description: Maximum number of deadlines in the page.
          examples:
            - 10
          format: int64
          type: integer
        page:
          description: Current one-based page number.
          examples:
            - 1
          format: int64
          type: integer
        total:
          description: Total number of deadlines matching the filters.
          examples:
            - 10
          format: int64
          type: integer
      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
    DraftCorrected:
      additionalProperties: false
      properties:
        openGaps:
          items:
            $ref: "#/components/schemas/Gap"
          type:
            - array
            - "null"
        report:
          $ref: "#/components/schemas/Report"
      required:
        - report
        - openGaps
      type: object
    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
    ElifBranch:
      properties:
        children:
          description: Blocks rendered when this branch matches.
          examples:
            -   - content: Pending
                  type: text
          items:
            $ref: "#/components/schemas/TemplateBlock"
          type:
            - array
            - "null"
        condition:
          description: Boolean expression evaluated for this branch.
          examples:
            - account.pending
          type: string
      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
    ErrorMetricsHumaResponse:
      properties:
        previousPeriodTotal:
          description: Errors recorded during the immediately preceding period of equal length.
          examples:
            - 12
          format: int64
          type: integer
        total:
          description: Errors recorded during the current period.
          examples:
            - 7
          format: int64
          type: integer
      type: object
    FilterChain:
      properties:
        args:
          description: Arguments passed to the filter.
          examples:
            - "\"2006-01-02\""
          type: string
        name:
          description: Pongo2 filter name.
          examples:
            - date
          type: string
      type: object
    FilterCondition:
      properties:
        between:
          description: Inclusive lower and upper bounds for a range match.
          examples:
            -   - 100
                - 1000
          items: {}
          type:
            - array
            - "null"
        eq:
          description: Values matched for equality; multiple values are combined with OR.
          examples:
            -   - active
                - pending
          items: {}
          type:
            - array
            - "null"
        gt:
          description: Single lower-bound value that the field must exceed.
          examples:
            -   - 100
          items: {}
          type:
            - array
            - "null"
        gte:
          description: Single inclusive lower-bound value for the field.
          examples:
            -   - "2025-06-01"
          items: {}
          type:
            - array
            - "null"
        in:
          description: Values for which the field may match any member of the list.
          examples:
            -   - active
                - pending
                - suspended
          items: {}
          type:
            - array
            - "null"
        isNull:
          description: Matches records where the field holds no value (NULL, or absent in a document). Carries no values and is not combined with other operators on the same field.
          examples:
            - true
          type: boolean
        lt:
          description: Single upper-bound value that the field must remain below.
          examples:
            -   - 1000
          items: {}
          type:
            - array
            - "null"
        lte:
          description: Single inclusive upper-bound value for the field.
          examples:
            -   - "2025-06-30"
          items: {}
          type:
            - array
            - "null"
        nin:
          description: Values excluded from matching records.
          examples:
            -   - deleted
                - archived
          items: {}
          type:
            - array
            - "null"
        notNull:
          description: Matches records where the field holds a value. Carries no values.
          examples:
            - true
          type: boolean
        notStartsWith:
          description: Text prefixes excluded from matching records. Text columns only.
          examples:
            -   - "7"
                - "8"
          items: {}
          type:
            - array
            - "null"
        startsWith:
          description: Text prefixes the field may begin with; any one of them matches. Text columns only.
          examples:
            -   - "1"
                - "2"
          items: {}
          type:
            - array
            - "null"
      type: object
    FilterDefinition:
      properties:
        args:
          description: Arguments accepted by the filter, in declaration order.
          examples:
            -   - denominator
          items:
            type: string
          type:
            - array
            - "null"
        description:
          description: Human-readable explanation of the filter behavior.
          examples:
            - Calcula percentual relativo a um valor
          type: string
        example:
          description: Example Pongo2 expression using the filter.
          examples:
            - "{{ value|percent_of:total }}"
          type: string
        name:
          description: Pongo2 filter name used in template expressions.
          examples:
            - percent_of
          type: string
      type: object
    FiltersResponse:
      properties:
        filters:
          description: Pongo2 filters available to template-builder clients.
          examples:
            -   - args:
                    - denominator
                  description: Calcula percentual relativo a um valor
                  example: "{{ value|percent_of:total }}"
                  name: percent_of
          items:
            $ref: "#/components/schemas/FilterDefinition"
          type:
            - array
            - "null"
      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
    GenerateCodeInput:
      properties:
        blocks:
          description: Template builder blocks converted into Pongo2 code.
          examples:
            -   - type: variable
                  variable: account.id
          items:
            $ref: "#/components/schemas/TemplateBlock"
          type:
            - array
            - "null"
        format:
          description: Output format targeted by the generated template.
          examples:
            - html
          type: string
      type: object
    GenerateCodeResponse:
      properties:
        code:
          description: Generated Pongo2 template source.
          examples:
            - "{{ account.id }}"
          type: string
        mappedFields:
          additionalProperties:
            additionalProperties:
              items:
                type: string
              type:
                - array
                - "null"
            type: object
          description: Fields referenced by the generated template, grouped by data source and entity.
          examples:
            - primary:
                account:
                  - id
          type: object
      type: object
    Institution:
      additionalProperties: false
      properties:
        cnpj:
          description: CNPJ of the institution, uppercase and without punctuation; numeric or alphanumeric.
          examples:
            - 12ABC34501DE35
          type: string
        createdAt:
          description: Creation timestamp in UTC.
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        id:
          description: Unique institution identifier.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        name:
          description: Name of the institution.
          examples:
            - Banco Exemplo S.A.
          type: string
        scope:
          additionalProperties:
            $ref: "#/components/schemas/DataSourceScope"
          description: The rows of each data source that belong to this institution.
          type: object
        updatedAt:
          description: Most recent update timestamp in UTC.
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        version:
          description: Version of the institution; an update presents it as If-Match.
          examples:
            - 1
          format: int64
          type: integer
      required:
        - id
        - name
        - cnpj
        - scope
        - version
        - createdAt
        - updatedAt
      type: object
    InstitutionListHumaBody:
      additionalProperties: false
      properties:
        items:
          description: Institutions in the requested page.
          items:
            $ref: "#/components/schemas/Institution"
          type:
            - array
            - "null"
        limit:
          description: Maximum number of institutions in the page.
          examples:
            - 10
          format: int64
          type: integer
        page:
          description: Current one-based page number.
          examples:
            - 1
          format: int64
          type: integer
        total:
          description: Total number of registered institutions.
          examples:
            - 2
          format: int64
          type: integer
      required:
        - items
        - page
        - limit
        - total
      type: object
    InstitutionProposal:
      additionalProperties: false
      properties:
        cnpj:
          description: The organization's legal document, uppercase and without punctuation.
          examples:
            - 12ABC34501DE35
          type: string
        cnpjValid:
          description: Whether the CNPJ's check digits hold. Midaz does not check them, so a false one must be corrected before the proposal is confirmed.
          examples:
            - true
          type: boolean
        name:
          description: The organization's legal name.
          examples:
            - Banco Exemplo S.A.
          type: string
        organizationId:
          description: Midaz organization the proposal is read from.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        scope:
          additionalProperties:
            $ref: "#/components/schemas/DataSourceScope"
          description: "The organization's rows in each named data source: organization by id, every table with an organization_id column by it."
          type: object
      required:
        - organizationId
        - name
        - cnpj
        - cnpjValid
        - scope
      type: object
    InstitutionProposalsHumaBody:
      additionalProperties: false
      properties:
        items:
          description: One proposal per live Midaz organization no institution covers yet.
          items:
            $ref: "#/components/schemas/InstitutionProposal"
          type:
            - array
            - "null"
      required:
        - items
      type: object
    InstitutionSnapshot:
      additionalProperties: false
      properties:
        cnpj:
          description: CNPJ of the institution when the report was requested.
          examples:
            - 12ABC34501DE35
          type: string
        id:
          description: Identifier of the institution the report reads for.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        name:
          description: Name of the institution when the report was requested.
          examples:
            - Banco Exemplo S.A.
          type: string
        scope:
          additionalProperties:
            $ref: "#/components/schemas/DataSourceScope"
          description: "The part of the institution's scope the report applied: each data source and table it reads, keyed as the template maps them."
          type: object
      required:
        - id
        - name
        - cnpj
        - scope
      type: object
    JoinReadiness:
      additionalProperties: false
      properties:
        columns:
          items:
            $ref: "#/components/schemas/ColumnReadiness"
          type:
            - array
            - "null"
        columnsChecked:
          type: boolean
        detail:
          type: string
        resolvedTable:
          type: string
        status:
          type: string
        table:
          type: string
      required:
        - table
        - status
        - columnsChecked
      type: object
    ListReportsHumaOutputBody:
      properties:
        items:
          description: Reports in the current page
          examples:
            -   - completedAt: "2026-01-31T15:04:05Z"
                  createdAt: "2026-01-31T15:00:00Z"
                  deletedAt: "2026-02-01T09:00:00Z"
                  filters: {}
                  id: 00000000-0000-0000-0000-000000000001
                  metadata: {}
                  status: Finished
                  templateId: 00000000-0000-0000-0000-000000000002
                  templateOutputFormat: PDF
                  updatedAt: "2026-01-31T15:04:05Z"
          items:
            $ref: "#/components/schemas/Report"
          type:
            - array
            - "null"
        limit:
          description: Maximum number of reports in the page
          examples:
            - 10
          format: int64
          type: integer
        nextCursor:
          description: Opaque cursor for the following page. Absent on the last page.
          examples:
            - eyJ0IjoiMjAyNi0wMS0zMVQxNTowMDowMFoiLCJpIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAxIn0
          type: string
        prevCursor:
          description: Opaque cursor for the preceding page. Absent on the first page.
          examples:
            - eyJ0IjoiMjAyNi0wMS0zMVQxNTowMDowMFoiLCJpIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAxIiwiYiI6dHJ1ZX0
          type: string
      type: object
    ListTemplateCategoriesHumaOutputBody:
      additionalProperties: false
      properties:
        items:
          description: Families in use, sorted by name
          examples:
            -   - category: cadoc
                  count: 3
          items:
            $ref: "#/components/schemas/CategoryCount"
          type:
            - array
            - "null"
        truncated:
          description: True when the answer was cut at the ceiling and some families in use are not listed
          examples:
            - false
          type: boolean
      required:
        - items
        - truncated
      type: object
    ListTemplatesHumaOutputBody:
      properties:
        items:
          description: Templates in the current page
          examples:
            -   - createdAt: "2026-01-01T00:00:00Z"
                  description: Monthly financial report
                  fileName: monthly-report.tpl
                  id: 00000000-0000-0000-0000-000000000000
                  outputFormat: HTML
                  updatedAt: "2026-01-01T00:00:00Z"
          items:
            $ref: "#/components/schemas/Template"
          type:
            - array
            - "null"
        limit:
          description: Maximum number of templates in the page
          examples:
            - 10
          format: int64
          type: integer
        page:
          description: Current page number
          examples:
            - 1
          format: int64
          type: integer
        total:
          description: Total number of matching templates
          examples:
            - 10
          format: int64
          type: integer
      type: object
    MetricsHumaResponse:
      properties:
        dataSources:
          description: Total number of connected data sources.
          examples:
            - 3
          format: int64
          type: integer
        errors:
          $ref: "#/components/schemas/ErrorMetricsHumaResponse"
          description: Report-error counters for the current and preceding windows.
          examples:
            - previousPeriodTotal: 12
              total: 7
        reports:
          description: Total number of report executions.
          examples:
            - 156
          format: int64
          type: integer
        templates:
          description: Total number of report templates.
          examples:
            - 42
          format: int64
          type: integer
      type: object
    NotificationItem:
      properties:
        color:
          description: Hex color used to identify the deadline.
          examples:
            - "#ef4444"
          type: string
        daysUntilDue:
          description: Days until the deadline, or negative days when overdue.
          examples:
            - 3
          format: int64
          type: integer
        description:
          description: Optional deadline description.
          examples:
            - Monthly regulatory report
          type: string
        dueDate:
          description: Deadline due date and time in RFC 3339 format.
          examples:
            - "2026-07-31T00:00:00Z"
          format: date-time
          type: string
        frequency:
          description: Deadline recurrence frequency.
          examples:
            - monthly
          type: string
        id:
          description: Unique deadline identifier.
          examples:
            - 00000000-0000-0000-0000-000000000001
          type: string
        monthsOfYear:
          description: Months in which a semiannual or annual deadline occurs.
          examples:
            -   - 1
                - 6
                - 12
          items:
            format: int64
            type: integer
          type:
            - array
            - "null"
        name:
          description: Human-readable deadline name.
          examples:
            - CADOC 4010
          type: string
        notifyDaysBefore:
          description: Days before the due date when notifications begin.
          examples:
            - 5
          format: int64
          type: integer
        severity:
          description: Notification urgency level.
          examples:
            - warning
          type: string
        type:
          description: Deadline category.
          examples:
            - regulatory
          type: string
      type: object
    NotificationResponse:
      properties:
        items:
          description: Deadline notifications inside their notification window.
          examples:
            -   - color: "#EF4444"
                  daysUntilDue: 3
                  description: Monthly regulatory report
                  dueDate: "2026-07-31T00:00:00Z"
                  frequency: monthly
                  id: 00000000-0000-0000-0000-000000000001
                  name: CADOC 4010
                  notifyDaysBefore: 5
                  severity: warning
                  type: regulatory
          items:
            $ref: "#/components/schemas/NotificationItem"
          type:
            - array
            - "null"
        total:
          description: Number of notifications returned.
          examples:
            - 3
          format: int64
          type: integer
      type: object
    OverrideInput:
      additionalProperties: false
      properties:
        dataset:
          description: Set the correction lands on.
          examples:
            - cosif_balances
          type: string
        field:
          description: "Field of that set. It may not be a field that identifies a row of the set: correcting one of those re-identifies the row instead of correcting a value in it, and is refused."
          examples:
            - saldo
          type: string
        reason:
          description: Why — the sentence an auditor reads. At most 1024 characters.
          examples:
            - Estorno lançado após o fechamento.
          maxLength: 1024
          type: string
        row:
          additionalProperties:
            type: string
          description: Which row of a repeated set, by the set's grain keys. Omitted for a singleton.
          examples:
            - cosifCode: "1120000006"
          type: object
        value:
          description: The corrected value, read and validated exactly as a value from the database. At most 512 characters.
          examples:
            - "1500.00"
          maxLength: 512
          type: string
      required:
        - dataset
        - field
        - value
      type: object
    ParameterSpec:
      additionalProperties: false
      properties:
        allowedValues:
          description: Closed set of values this parameter accepts, when it has one
          examples:
            -   - I
                - S
          items:
            type: string
          type:
            - array
            - "null"
        appliesTo:
          description: Date/time field whose period this parameter closes, as <dataSource>.<table>.<field>
          examples:
            - midaz_transaction.operation.created_at
          type: string
        default:
          description: Value applied server-side when the request omits this parameter
          examples:
            - I
          type: string
        description:
          description: Human-readable description of the parameter
          type: string
        name:
          description: Parameter name as the request supplies it
          examples:
            - dataBase
          type: string
        required:
          description: Whether a request must supply this parameter
          examples:
            - true
          type: boolean
        type:
          description: One of string, integer, decimal, boolean, date, month
          examples:
            - month
          type: string
      required:
        - name
        - type
        - required
      type: object
    PreviewBindingQueryInput:
      additionalProperties: false
      properties:
        binding:
          description: The whole mapping, as YAML, exactly as a save would send it. It is planned against the subscription's pinned contract and NEVER saved.
          examples:
            - |
              contract: br.example.document
              queries: []
          type: string
        limit:
          description: "How many rows to answer, 1 to 100. Absent: 20."
          examples:
            - 20
          format: int64
          type: integer
        parameters:
          additionalProperties:
            type: string
          description: Generation parameters the query's filters read, as a generation would be given them. Only the ones supplied are validated; the closed-period rule does not apply to a preview.
          type: object
        query:
          description: The query of the mapping to read.
          examples:
            - saldos
          type: string
      required:
        - binding
        - query
      type: object
    PreviewTemplateInput:
      additionalProperties: false
      properties:
        content:
          description: Raw pongo2 template markup to render. At most 512 KiB, measured on the decoded bytes.
          examples:
            - "Total: {{ ledger.accounts.0.balance }}"
          maxLength: 524288
          type: string
        outputFormat:
          description: One of Html, Csv, Txt, Xml or Pdf, matched case-insensitively. Decides the response content type only; defaults to Html when omitted or empty.
          examples:
            - Html
          pattern: ^([Hh][Tt][Mm][Ll]|[Cc][Ss][Vv]|[Tt][Xx][Tt]|[Xx][Mm][Ll]|[Pp][Dd][Ff])?$
          type: string
        sampleData:
          additionalProperties:
            additionalProperties:
              items:
                additionalProperties: {}
                type: object
              type:
                - array
                - "null"
            type: object
          description: Render context shaped as data source, then table, then rows. At most 1 MiB, measured on the raw JSON bytes sent for this member.
          type: object
      required:
        - content
      type: object
    PreviewTemplateResult:
      additionalProperties: false
      properties:
        contentType:
          description: Content type the rendered output should be displayed as.
          examples:
            - text/html
          type: string
        durationMs:
          description: How long the preview took, in milliseconds.
          examples:
            - 12
          format: int64
          type: integer
        rendered:
          description: Rendered output. For a Pdf template this is the HTML stage that would feed the PDF engine.
          examples:
            - "Total: 1500.00"
          type: string
        warnings:
          description: Non-fatal render notes, such as output having been truncated.
          items:
            type: string
          type: array
      required:
        - rendered
        - contentType
        - warnings
        - durationMs
      type: object
    Provenance:
      additionalProperties: false
      description: "Everything a report was made of, frozen at generation. Exactly one origin is present: `catalog` for a filing produced from a curated regulatory document, `template` for one produced from a template whose category makes it regulatory. A record carrying both, or neither, does not exist — it is refused before it is stored."
      oneOf:
        - required:
            - catalog
        - required:
            - template
      properties:
        artifactChecksum:
          description: SHA-256 of the artifact, hex.
          examples:
            - e3b0c44298fc1c149afbf4c8996fb924...
          type: string
        artifactSizeBytes:
          description: Size of the stored artifact in bytes.
          examples:
            - 20480
          format: int64
          type: integer
        catalog:
          $ref: "#/components/schemas/CatalogOrigin"
        generatedAt:
          format: date-time
          type: string
        parameters:
          additionalProperties:
            type: string
          description: Generation parameters as supplied.
          examples:
            - dataBase: 2026-03
          type: object
        template:
          $ref: "#/components/schemas/TemplateOrigin"
      required:
        - generatedAt
      type: object
    QueryReadiness:
      additionalProperties: false
      properties:
        columns:
          items:
            $ref: "#/components/schemas/ColumnReadiness"
          type:
            - array
            - "null"
        columnsChecked:
          type: boolean
        composedOver:
          type: string
        dataSource:
          type: string
        detail:
          type: string
        joins:
          items:
            $ref: "#/components/schemas/JoinReadiness"
          type:
            - array
            - "null"
        mismatches:
          items:
            type: string
          type:
            - array
            - "null"
        query:
          type: string
        resolvedTable:
          type: string
        status:
          type: string
        table:
          type: string
        unexecuted:
          items:
            type: string
          type:
            - array
            - "null"
        warnings:
          items:
            type: string
          type:
            - array
            - "null"
      required:
        - query
        - status
        - columnsChecked
      type: object
    Readiness:
      additionalProperties: false
      properties:
        contractVersion:
          type: string
        document:
          type: string
        gaps:
          items:
            $ref: "#/components/schemas/Gap"
          type:
            - array
            - "null"
        mappingOrigin:
          type: string
        queries:
          items:
            $ref: "#/components/schemas/QueryReadiness"
          type:
            - array
            - "null"
        startedFrom:
          type: string
        unsupported:
          items:
            type: string
          type:
            - array
            - "null"
      required:
        - document
        - contractVersion
        - queries
      type: object
    RegulatoryAppliesToWire:
      additionalProperties: false
      properties:
        institutionTypes:
          items:
            type: string
          type:
            - array
            - "null"
      type: object
    RegulatoryBindingSaved:
      additionalProperties: false
      properties:
        readiness:
          $ref: "#/components/schemas/Readiness"
        version:
          description: Version now in force; the next save must present it.
          examples:
            - 4
          format: int64
          type: integer
      required:
        - version
        - readiness
      type: object
    RegulatoryCalendarWire:
      additionalProperties: false
      properties:
        from:
          description: First day the calendar answers for, as AAAA-MM-DD.
          examples:
            - "2025-01-01"
          type: string
        nonBusinessDays:
          description: Weekdays inside the span that are not business days, in date order.
          items:
            $ref: "#/components/schemas/RegulatoryNonBusinessDayWire"
          type:
            - array
            - "null"
        until:
          description: Last day the calendar answers for, as AAAA-MM-DD.
          examples:
            - "2027-12-31"
          type: string
        weekends:
          description: Saturday and Sunday are never business days.
          type: boolean
      required:
        - weekends
        - from
        - until
        - nonBusinessDays
      type: object
    RegulatoryChildOfWire:
      additionalProperties: false
      properties:
        dataset:
          description: Parent set this one hangs from.
          type: string
      required:
        - dataset
      type: object
    RegulatoryConsolidationWire:
      additionalProperties: false
      properties:
        columns:
          additionalProperties:
            type: string
          description: "What becomes of each field that is neither a key nor derived: sum (the sources' values added), equal (the sources must agree), first (the first source's value)."
          type: object
        key:
          description: "Fields a row is unified by: rows of different sources with the same values here become one row."
          examples:
            -   - code
          items:
            type: string
          type:
            - array
            - "null"
        whenKeyRepeats:
          description: "combine: rows sharing a key are unified by the column rules. refuse: the sources' rows are appended and a key found in two sources refuses the generation."
          enum:
            - combine
            - refuse
          examples:
            - combine
          type: string
      required:
        - key
        - whenKeyRepeats
        - columns
      type: object
    RegulatoryContractWire:
      additionalProperties: false
      properties:
        apiVersion:
          description: Format identifier of the contract document.
          examples:
            - reporter.lerian.io/v1alpha1
          type: string
        calendar:
          $ref: "#/components/schemas/RegulatoryCalendarWire"
          description: Business-day calendar the document is filed by, from the subscription's pinned copy. Null when the contract declares none.
        datasets:
          description: Every set the file carries and every field of it.
          items:
            $ref: "#/components/schemas/RegulatoryDatasetWire"
          type:
            - array
            - "null"
        filing:
          $ref: "#/components/schemas/RegulatoryFilingWire"
          description: What makes two generations the same filing and which remittance is the original, as the contract declares it. Null when the contract declares no filing block.
        kind:
          description: Document kind; always DocumentContract.
          examples:
            - DocumentContract
          type: string
        knownGaps:
          description: What this contract knowingly does not yet cover.
          items:
            $ref: "#/components/schemas/RegulatoryKnownGapWire"
          type:
            - array
            - "null"
        metadata:
          $ref: "#/components/schemas/RegulatoryMetadataWire"
          description: Which obligation this is, at which version.
        parameters:
          description: What the generation must be told, answered per request.
          items:
            $ref: "#/components/schemas/RegulatoryParameterWire"
          type:
            - array
            - "null"
        reportTimezone:
          description: IANA time zone whose calendar decides when a period has closed (REPORT_TIMEZONE).
          examples:
            - America/Sao_Paulo
          type: string
        rules:
          description: "Every rule of the document: what the engine transforms and checks."
          items:
            $ref: "#/components/schemas/RegulatoryRuleWire"
          type:
            - array
            - "null"
        tables:
          description: Lookup tables published beside the contract, which its rules read.
          items:
            $ref: "#/components/schemas/RegulatoryTableWire"
          type:
            - array
            - "null"
      required:
        - metadata
        - parameters
        - datasets
        - rules
        - tables
        - knownGaps
        - calendar
        - reportTimezone
        - filing
      type: object
    RegulatoryDatasetWire:
      additionalProperties: false
      properties:
        childOf:
          $ref: "#/components/schemas/RegulatoryChildOfWire"
          description: Present when this set is a nested list on each row of another.
        consolidation:
          $ref: "#/components/schemas/RegulatoryConsolidationWire"
          description: How this set's rows, read from more than one source, become one set, as the document's curator declared it. Null when the set reads from one source.
        description:
          type: string
        fields:
          items:
            $ref: "#/components/schemas/RegulatoryFieldWire"
          type:
            - array
            - "null"
        grain:
          $ref: "#/components/schemas/RegulatoryGrainWire"
          description: Row shape the file requires of this set.
        means:
          description: What the set represents, in prose, for whoever writes the mapping.
          type: string
        name:
          examples:
            - cosif_balances
          type: string
        rowSet:
          $ref: "#/components/schemas/RegulatoryRowSetWire"
          description: Present when the ROWS come from the catalog rather than the client.
      required:
        - name
        - grain
        - consolidation
        - fields
      type: object
    RegulatoryDocumentsBody:
      additionalProperties: false
      properties:
        items:
          description: Documents this deployment can file.
          items:
            $ref: "#/components/schemas/CatalogDocument"
          type:
            - array
            - "null"
      required:
        - items
      type: object
    RegulatoryFieldWire:
      additionalProperties: false
      properties:
        checkDigit:
          description: Check-digit rule the value satisfies; cnpj verifies a numeric or alphanumeric CNPJ.
          examples:
            - cnpj
          type: string
        description:
          type: string
        domain:
          items:
            type: string
          type:
            - array
            - "null"
        expects:
          description: "What the mapping must deliver into the field before the document's rules run, in prose: the convention a value arrives in when a rule depends on it."
          type: string
        format:
          $ref: "#/components/schemas/RegulatoryFormatWire"
        identifiesInstitution:
          description: true when this value must be the identifier the filing's institution is registered under; a filing whose declarant is another institution is refused (RPT-0196).
          examples:
            - "true"
          type: string
        length:
          description: Exact length the file requires, when it requires one.
          format: int64
          type: integer
        means:
          type: string
        name:
          examples:
            - saldo
          type: string
        normalize:
          type: string
        pattern:
          type: string
        prefixOf:
          description: "Field of the same set this value is cut from: its first length positions. A derived field is never mapped by a binding."
          examples:
            - cnpj
          type: string
        required:
          type: boolean
        type:
          examples:
            - decimal
          type: string
      required:
        - name
        - type
        - required
      type: object
    RegulatoryFilingWire:
      additionalProperties: false
      properties:
        period:
          description: "Parameters that identify the filing period. Empty when the contract does not name them: then every parameter except the remittance one does."
          examples:
            -   - dataBase
          items:
            type: string
          type:
            - array
            - "null"
        remittance:
          $ref: "#/components/schemas/RegulatoryRemittanceWire"
          description: Which parameter says whether a generation is the original or a replacement, and the value of each. Null when the contract declares none.
      required:
        - period
        - remittance
      type: object
    RegulatoryFormatWire:
      additionalProperties: false
      properties:
        decimalSeparator:
          type: string
        groupSeparator:
          type: string
        pattern:
          type: string
        scale:
          format: int64
          type: integer
        scaleDeclared:
          type: boolean
        scaleIsExact:
          type: boolean
      required:
        - scaleDeclared
        - scaleIsExact
      type: object
    RegulatoryGrainWire:
      additionalProperties: false
      properties:
        keys:
          description: Fields whose combination is unique across the set.
          items:
            type: string
          type:
            - array
            - "null"
        singleton:
          description: True when the set is always exactly one row.
          type: boolean
      required:
        - singleton
      type: object
    RegulatoryKnownGapWire:
      additionalProperties: false
      properties:
        description:
          type: string
        id:
          type: string
      required:
        - id
      type: object
    RegulatoryLayoutWire:
      additionalProperties: false
      properties:
        mandatoryFrom:
          description: First data-base this layout applies to, as AAAA-MM-DD.
          examples:
            - "2026-01-01"
          type: string
        version:
          type: string
      type: object
    RegulatoryMetadataWire:
      additionalProperties: false
      properties:
        appliesTo:
          $ref: "#/components/schemas/RegulatoryAppliesToWire"
          description: Which institutions owe this document.
        country:
          examples:
            - BR
          type: string
        document:
          description: The regulator's own number for it.
          examples:
            - "4010"
          type: string
        family:
          description: Group of filings the document belongs to, as a lowercase code.
          examples:
            - cadoc
          type: string
        id:
          description: Document identifier, as a subscription names it.
          examples:
            - br.bcb.cadoc-4010
          type: string
        layout:
          $ref: "#/components/schemas/RegulatoryLayoutWire"
          description: Layout edition this contract is written against, on a document with more than one.
        output:
          description: File format the regulator receives.
          examples:
            - xml
          type: string
        periodicity:
          examples:
            - monthly
          type: string
        regulator:
          examples:
            - BCB
          type: string
        status:
          examples:
            - stable
          type: string
        summary:
          description: What the document is, in one or two sentences.
          type: string
        title:
          examples:
            - Balancete Patrimonial Analítico
          type: string
        version:
          examples:
            - 1.0.0
          type: string
      required:
        - id
        - appliesTo
      type: object
    RegulatoryNonBusinessDayWire:
      additionalProperties: false
      properties:
        date:
          examples:
            - "2026-11-02"
          type: string
        description:
          examples:
            - Finados
          type: string
      required:
        - date
      type: object
    RegulatoryOverridesListBody:
      additionalProperties: false
      properties:
        items:
          description: Every correction ever applied, oldest first.
          items:
            $ref: "#/components/schemas/Correction"
          type:
            - array
            - "null"
      required:
        - items
      type: object
    RegulatoryParameterWire:
      additionalProperties: false
      properties:
        allowedMonths:
          description: Months of any year this parameter may name, as two-digit numbers. Null when any month is allowed.
          items:
            type: string
          type:
            - array
            - "null"
        businessDay:
          description: The parameter is a date that must be a business day of the document's calendar; any other day is refused (RPT-0140).
          examples:
            - true
          type: boolean
        closed:
          description: "The parameter names a period that must already have ended on the report calendar: a month from the first day of the next, a day from the day after. An open period is refused (RPT-0140)."
          examples:
            - true
          type: boolean
        default:
          description: Applied when the request omits the parameter. Null when the parameter has none — an empty string is a declared default of empty, which is a different thing.
          type:
            - string
            - "null"
        description:
          type: string
        domain:
          description: Closed set of values the parameter accepts. Null when it is not narrowed.
          items:
            type: string
          type:
            - array
            - "null"
        name:
          examples:
            - dataBase
          type: string
        required:
          type: boolean
        type:
          examples:
            - month
          type: string
      required:
        - name
        - type
        - required
        - default
        - domain
        - allowedMonths
        - businessDay
        - closed
      type: object
    RegulatoryRemittanceWire:
      additionalProperties: false
      properties:
        original:
          description: Its value for the original filing of a period.
          examples:
            - I
          type: string
        parameter:
          description: The generation parameter that carries the remittance.
          examples:
            - tipoRemessa
          type: string
        replacement:
          description: Its value for a replacement of an approved original.
          examples:
            - S
          type: string
      required:
        - parameter
        - original
        - replacement
      type: object
    RegulatoryReportRequested:
      additionalProperties: false
      properties:
        openGaps:
          items:
            $ref: "#/components/schemas/Gap"
          type:
            - array
            - "null"
        report:
          $ref: "#/components/schemas/Report"
      required:
        - report
        - openGaps
      type: object
    RegulatoryRowSetWire:
      additionalProperties: false
      properties:
        columns:
          description: Every column the published rows carry, sorted.
          items:
            type: string
          type:
            - array
            - "null"
        key:
          description: Field of this set each catalog-supplied row is identified by.
          type: string
        rows:
          description: The published rows, in the catalog's order.
          items:
            additionalProperties:
              type: string
            type: object
          type:
            - array
            - "null"
      required:
        - key
        - columns
        - rows
      type: object
    RegulatoryRuleDoesWire:
      additionalProperties: false
      properties:
        equals:
          examples:
            - debit
          type: string
        field:
          examples:
            - saldo
          type: string
        fields:
          description: The fields a unique check reads.
          examples:
            -   - cosifCode
          items:
            type: string
          type:
            - array
            - "null"
        key:
          examples:
            - cosifCode
          type: string
        kind:
          description: The rule kind.
          enum:
            - negateWhen
            - unique
            - notStartsWith
            - existsIn
            - equalsLookup
          examples:
            - negateWhen
          type: string
        rowSet:
          examples:
            - contas.yaml
          type: string
        table:
          examples:
            - natureza
          type: string
        values:
          items:
            type: string
          type:
            - array
            - "null"
      required:
        - kind
      type: object
    RegulatoryRuleWhereWire:
      additionalProperties: false
      properties:
        equals:
          type: string
        field:
          type: string
        in:
          items:
            type: string
          type:
            - array
            - "null"
        notIn:
          items:
            type: string
          type:
            - array
            - "null"
        rowSet:
          description: A column of the published row set.
          type: string
      type: object
    RegulatoryRuleWire:
      additionalProperties: false
      properties:
        appliesTo:
          type: string
        does:
          $ref: "#/components/schemas/RegulatoryRuleDoesWire"
          description: "What the engine runs: a transform or a check of the closed vocabulary."
        id:
          type: string
        message:
          type: string
        severity:
          description: error refuses the generation. Absent on a transform, which does not fail.
          examples:
            - error
          type: string
        where:
          $ref: "#/components/schemas/RegulatoryRuleWhereWire"
          description: The rows the rule is narrowed to.
      required:
        - id
      type: object
    RegulatorySubscriptionsBody:
      additionalProperties: false
      properties:
        items:
          description: Documents this tenant files.
          items:
            $ref: "#/components/schemas/Subscription"
          type:
            - array
            - "null"
      required:
        - items
      type: object
    RegulatoryTableWire:
      additionalProperties: false
      properties:
        from:
          examples:
            - natureza.yaml
          type: string
        match:
          examples:
            - longestPrefix
          type: string
        name:
          examples:
            - natureza
          type: string
      required:
        - name
        - from
        - match
      type: object
    Report:
      properties:
        allInstitutions:
          description: The caller chose every institution, so the report read every institution's rows unscoped.
          examples:
            - false
          type: boolean
        approvedAt:
          description: When the report was approved, when it was.
          examples:
            - "2026-03-12T10:00:00Z"
          format: date-time
          type: string
        approvedBy:
          description: Who approved it, as the Access Manager subject identifier the bearer token named. Absent until approval; never blank on a Final, because an approval whose actor the request did not identify is refused.
          examples:
            - 9c1d7e34-2b6a-4f81-90a3-5e7f8d0a1b2c
          type: string
        completedAt:
          description: Time when report generation completed, when available.
          examples:
            - "2026-01-31T15:04:05Z"
          format: date-time
          type:
            - string
            - "null"
        correctedAt:
          description: When the draft was last corrected, when it was.
          examples:
            - "2026-03-12T09:40:00Z"
          format: date-time
          type: string
        correctedBy:
          description: Who last corrected it, as the Access Manager subject identifier the bearer token named. Absent until the first correction; never blank on a report that has one, because a correction whose actor the request did not identify is refused.
          examples:
            - 3f9a1c2e-0f5b-4d9a-9b8e-1a2b3c4d5e6f
          type: string
        createdAt:
          description: Time when the report was created.
          examples:
            - "2026-01-31T15:00:00Z"
          format: date-time
          type: string
        deletedAt:
          description: Time when the report was soft-deleted, when applicable.
          examples:
            - "2026-02-01T09:00:00Z"
          format: date-time
          type:
            - string
            - "null"
        documentId:
          description: Curated document this report generates.
          examples:
            - br.bcb.cadoc-4010
          type: string
        documentVersion:
          description: Pinned version of the document it was generated against.
          examples:
            - 1.0.0
          type: string
        draftVersion:
          description: Version of the draft; a correction or an approval must present the one it read.
          examples:
            - 3
          format: int64
          type: integer
        filingPeriod:
          description: "The filing period this generation is for, as the pinned contract's filing.period spells it: name=value of each period parameter in name order, joined by &. Two generations of one subscription with the same filingPeriod and remittance are the same filing. Absent on an operational report and on a filing generated before the period was recorded."
          examples:
            - dataBase=2026-09
          type: string
        filters:
          additionalProperties:
            additionalProperties:
              additionalProperties:
                $ref: "#/components/schemas/FilterCondition"
              type: object
            type: object
          description: Filter conditions grouped by data source, table, and field.
          examples:
            - accounts:
                account:
                  status:
                    eq:
                      - ACTIVE
          type: object
        id:
          description: Stable report identifier.
          examples:
            - 00000000-0000-0000-0000-000000000001
          type: string
        institution:
          $ref: "#/components/schemas/InstitutionSnapshot"
          description: "The institution the report read for, frozen when it was requested: its scope is the part applied to the tables the report reads. Absent on a report that read for no institution."
        metadata:
          additionalProperties: {}
          description: Additional report metadata keyed by attribute name.
          examples:
            - source: ledger
              tenant: sandbox
          type: object
        openGaps:
          description: What a regulatory Draft still cannot fill, computed on read from the same stored state the approval refusal reads, each field flagged required or not. Present when a Draft is read by id; absent on a Final, on a non-regulatory report, and in the list endpoint, which does not compute it. Absent means unknown, an empty list means nothing is missing, and only a required gap refuses an approval.
          items:
            $ref: "#/components/schemas/Gap"
          type: array
        parameters:
          additionalProperties:
            type: string
          description: Generation parameters recorded with the report, when supplied.
          examples:
            - dataBase: 2026-08
          type: object
        provenance:
          $ref: "#/components/schemas/Provenance"
          description: Everything this report was made of, frozen — what answers, months later, why it says what it says.
        remittance:
          description: original or replacement, as the pinned contract's filing.remittance reads the generation's parameters. Absent when the contract declares no remittance.
          examples:
            - original
          type: string
        status:
          description: Current report generation status.
          examples:
            - Processing
          type: string
        subscriptionId:
          description: Subscription this report files under; present only on the regulatory flow.
          type: string
        supersededBy:
          description: The newest Draft or Final of the same subscription, filing period and remittance created after this report, which therefore stands in its place. Computed on read for regulatory filings that are not Final; absent when nothing supersedes the report, on a Final, on a filing without a recorded period and on an operational report.
          examples:
            - 00000000-0000-0000-0000-000000000003
          type: string
        templateDescription:
          description: Description copied from the template when the report was created.
          examples:
            - Monthly accounting report
          type: string
        templateId:
          description: Template snapshot source identifier.
          examples:
            - 00000000-0000-0000-0000-000000000002
          type: string
        templateOutputFormat:
          description: Output format selected for the generated report.
          examples:
            - pdf
          type: string
        updatedAt:
          description: Time when the report was last updated.
          examples:
            - "2026-01-31T15:04:05Z"
          format: date-time
          type: string
      type: object
    ReportResponse:
      additionalProperties: false
      properties:
        allInstitutions:
          description: The caller chose every institution, so the report read every institution's rows unscoped.
          examples:
            - false
          type: boolean
        approvedAt:
          description: When the report was approved, when it was.
          examples:
            - "2026-03-12T10:00:00Z"
          format: date-time
          type: string
        approvedBy:
          description: Who approved it, as the Access Manager subject identifier the bearer token named. Absent until approval; never blank on a Final, because an approval whose actor the request did not identify is refused.
          examples:
            - 9c1d7e34-2b6a-4f81-90a3-5e7f8d0a1b2c
          type: string
        completedAt:
          description: Time when report generation completed, when available.
          examples:
            - "2026-01-31T15:04:05Z"
          format: date-time
          type:
            - string
            - "null"
        correctedAt:
          description: When the draft was last corrected, when it was.
          examples:
            - "2026-03-12T09:40:00Z"
          format: date-time
          type: string
        correctedBy:
          description: Who last corrected it, as the Access Manager subject identifier the bearer token named. Absent until the first correction; never blank on a report that has one, because a correction whose actor the request did not identify is refused.
          examples:
            - 3f9a1c2e-0f5b-4d9a-9b8e-1a2b3c4d5e6f
          type: string
        createdAt:
          description: Time when the report was created.
          examples:
            - "2026-01-31T15:00:00Z"
          format: date-time
          type: string
        deletedAt:
          description: Time when the report was soft-deleted, when applicable.
          examples:
            - "2026-02-01T09:00:00Z"
          format: date-time
          type:
            - string
            - "null"
        documentId:
          description: Curated document this report generates.
          examples:
            - br.bcb.cadoc-4010
          type: string
        documentVersion:
          description: Pinned version of the document it was generated against.
          examples:
            - 1.0.0
          type: string
        draftVersion:
          description: Version of the draft; a correction or an approval must present the one it read.
          examples:
            - 3
          format: int64
          type: integer
        filingPeriod:
          description: "The filing period this generation is for, as the pinned contract's filing.period spells it: name=value of each period parameter in name order, joined by &. Two generations of one subscription with the same filingPeriod and remittance are the same filing. Absent on an operational report and on a filing generated before the period was recorded."
          examples:
            - dataBase=2026-09
          type: string
        filters:
          additionalProperties:
            additionalProperties:
              additionalProperties:
                $ref: "#/components/schemas/FilterCondition"
              type: object
            type: object
          description: Filter conditions grouped by data source, table, and field.
          examples:
            - accounts:
                account:
                  status:
                    eq:
                      - ACTIVE
          type: object
        id:
          description: Stable report identifier.
          examples:
            - 00000000-0000-0000-0000-000000000001
          type: string
        institution:
          $ref: "#/components/schemas/InstitutionSnapshot"
          description: "The institution the report read for, frozen when it was requested: its scope is the part applied to the tables the report reads. Absent on a report that read for no institution."
        metadata:
          additionalProperties: {}
          description: Additional report metadata keyed by attribute name.
          examples:
            - source: ledger
              tenant: sandbox
          type: object
        openGaps:
          description: What a regulatory Draft still cannot fill, computed on read from the same stored state the approval refusal reads, each field flagged required or not. Present when a Draft is read by id; absent on a Final, on a non-regulatory report, and in the list endpoint, which does not compute it. Absent means unknown, an empty list means nothing is missing, and only a required gap refuses an approval.
          items:
            $ref: "#/components/schemas/Gap"
          type: array
        parameters:
          additionalProperties:
            type: string
          description: Generation parameters recorded with the report, when supplied.
          examples:
            - dataBase: 2026-08
          type: object
        provenance:
          $ref: "#/components/schemas/Provenance"
          description: Everything this report was made of, frozen — what answers, months later, why it says what it says.
        remittance:
          description: original or replacement, as the pinned contract's filing.remittance reads the generation's parameters. Absent when the contract declares no remittance.
          examples:
            - original
          type: string
        status:
          description: Current report generation status.
          examples:
            - Processing
          type: string
        subscriptionId:
          description: Subscription this report files under; present only on the regulatory flow.
          type: string
        supersededBy:
          description: The newest Draft or Final of the same subscription, filing period and remittance created after this report, which therefore stands in its place. Computed on read for regulatory filings that are not Final; absent when nothing supersedes the report, on a Final, on a filing without a recorded period and on an operational report.
          examples:
            - 00000000-0000-0000-0000-000000000003
          type: string
        templateDescription:
          description: Description copied from the template when the report was created.
          examples:
            - Monthly accounting report
          type: string
        templateId:
          description: Template snapshot source identifier.
          examples:
            - 00000000-0000-0000-0000-000000000002
          type: string
        templateOutputFormat:
          description: Output format selected for the generated report.
          examples:
            - pdf
          type: string
        updatedAt:
          description: Time when the report was last updated.
          examples:
            - "2026-01-31T15:04:05Z"
          format: date-time
          type: string
        warnings:
          description: Non-fatal filter-validation warnings returned when a data source is unavailable and the filter could not be checked against its schema
          examples:
            -   - code: DATA_SOURCE_UNAVAILABLE
                  field: my_database
                  message: Data source "my_database" is currently unavailable; validation skipped
          items:
            $ref: "#/components/schemas/ValidationWarning"
          type:
            - array
            - "null"
      required:
        - id
        - templateId
        - filters
        - status
        - metadata
        - completedAt
        - createdAt
        - updatedAt
        - deletedAt
      type: object
    RestartRegulatoryBindingHumaInputBody:
      additionalProperties: false
      properties:
        mapping:
          description: "What the mapping restarts from: reference is the catalog's homologated mapping for the pinned version; blank leaves every field to map. A document whose catalog publishes no reference restarts blank."
          enum:
            - reference
            - blank
          examples:
            - blank
          type: string
      required:
        - mapping
      type: object
    SchemaField:
      properties:
        encrypted:
          description: "True for a field the CRM stores encrypted: read decrypted, never grouped, summed, joined or computed on."
          examples:
            - false
          type: boolean
        family:
          description: "What the declared type holds, in one vocabulary for every engine: date (a day, a clock and a zone), date_without_zone (a day and a clock and no zone), day (a day and no clock at all — PostgreSQL's date), time (a clock reading with no day and no zone in it), time_with_zone (a clock reading carrying its own UTC offset), duration (a length of time), number, boolean, string, object, array, or unknown. A family names which parts of a written value the field holds, and a bound must state exactly those: a day field reduces a bound naming a clock to its day, so offer a day-granularity control there; a field keeping no zone (date_without_zone, day, time) discards a stated UTC offset and the bound is refused instead; a time_with_zone field resolves a bound stating none in the data source's session zone and so requires one; and only a zone-keeping field is compared on the report calendar. A type name cannot be read for any of this — read this rather than parsing type."
          examples:
            - time_with_zone
          type: string
        inArray:
          description: True for a MongoDB path inside the elements of an array; read as it is, it answers the list of the elements' values.
          examples:
            - false
          type: boolean
        name:
          description: Field or column name, exactly as the data source spells it.
          examples:
            - hora_corte
          type: string
        searchable:
          description: True for an encrypted field that keeps a keyed digest, so an equality can be asked of it.
          examples:
            - false
          type: boolean
        type:
          description: Declared type in the data source's own vocabulary, for display.
          examples:
            - time without time zone
          type: string
        types:
          description: Every type the sampled documents held at this path, when they are not the same kind of value; absent otherwise.
          examples:
            -   - number
                - string
          items:
            type: string
          type:
            - array
            - "null"
      type: object
    SchemaTable:
      properties:
        empty:
          description: True for a MongoDB collection with no documents, whose fields cannot be discovered because there is nothing to sample.
          examples:
            - false
          type: boolean
        fields:
          items:
            $ref: "#/components/schemas/SchemaField"
          type:
            - array
            - "null"
        name:
          type: string
        schema:
          type: string
      type: object
    SetSubscriptionInstitutionHumaInputBody:
      additionalProperties: false
      properties:
        institution:
          description: Institution that files the document. Omitted, the tenant's only institution; "all" is refused.
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
      type: object
    StreamingDeliveryPolicyHumaResponse:
      properties:
        direct:
          description: Direct publication mode.
          enum:
            - direct
            - skip
          examples:
            - direct
          type: string
        dlq:
          description: Dead-letter handling mode.
          enum:
            - never
            - on_routable_failure
          examples:
            - on_routable_failure
          type: string
        enabled:
          description: Whether delivery is enabled for the event.
          examples:
            - true
          type: boolean
        outbox:
          description: Transactional outbox publication mode.
          enum:
            - never
            - fallback_on_circuit_open
            - always
          examples:
            - fallback_on_circuit_open
          type: string
      type: object
    StreamingEventHumaResponse:
      properties:
        class:
          description: "Which of the application's two streams the event rides, and therefore what a consumer with no handler for it does: \"fact\" is ignored, \"command\" is quarantined. Always present. Reporter emits only facts."
          examples:
            - fact
          type: string
        dataContentType:
          description: Media type of the event data payload.
          examples:
            - application/json
          type: string
        dataSchema:
          description: Optional URI identifying the event data schema.
          examples:
            - https://schemas.lerian.studio/reporter/report-requested.json
          type: string
        defaultPolicy:
          $ref: "#/components/schemas/StreamingDeliveryPolicyHumaResponse"
          description: Default delivery policy for this event.
          examples:
            - direct: direct
              dlq: on_routable_failure
              enabled: true
              outbox: fallback_on_circuit_open
        description:
          description: Human-readable purpose of the event.
          examples:
            - A report generation request was accepted.
          type: string
        eventKey:
          description: "The \"<resourceType>.<eventType>\" dispatch selector a consumer registers a handler under. Not unique across the manifest: two definitions may share it and differ only in schemaVersion major, so branch on schemaVersion."
          examples:
            - report.requested
          type: string
        eventType:
          description: Past-tense business action represented by the event.
          examples:
            - requested
          type: string
        key:
          description: Stable catalog key for the event definition.
          examples:
            - report.requested
          type: string
        resourceType:
          description: Business resource represented by the event.
          examples:
            - report
          type: string
        schemaVersion:
          description: Version of the event payload schema.
          examples:
            - 1.0.0
          type: string
        systemEvent:
          description: Whether the event represents system activity instead of a client-triggered business action.
          examples:
            - false
          type: boolean
      type: object
    StreamingManifestHumaResponse:
      properties:
        events:
          description: Business events Reporter can publish.
          examples:
            -   - dataContentType: application/json
                  defaultPolicy:
                    direct: direct
                    dlq: on_routable_failure
                    enabled: true
                    outbox: fallback_on_circuit_open
                  eventKey: report.requested
                  eventType: requested
                  key: report.requested
                  resourceType: report
                  schemaVersion: 1.0.0
                  systemEvent: false
          items:
            $ref: "#/components/schemas/StreamingEventHumaResponse"
          type:
            - array
            - "null"
        publisher:
          $ref: "#/components/schemas/StreamingPublisherHumaResponse"
          description: Metadata identifying the Reporter event publisher.
          examples:
            - outboxSupported: true
              routePath: /v1/streaming/events
              serviceName: reporter
              source: reporter
        routes:
          description: Sanitized delivery routes when topology publication is enabled; Reporter omits this field.
          examples:
            - []
          items:
            $ref: "#/components/schemas/StreamingRouteHumaResponse"
          type:
            - array
            - "null"
        version:
          description: Semantic version of the manifest wire format.
          examples:
            - 1.0.0
          type: string
      type: object
    StreamingPublisherHumaResponse:
      properties:
        appVersion:
          description: Reporter application version.
          examples:
            - 4.0.0
          type: string
        libVersion:
          description: lib-streaming manifest version used by Reporter.
          examples:
            - 1.0.0
          type: string
        outboxSupported:
          description: Whether the publisher supports transactional outbox delivery.
          examples:
            - true
          type: boolean
        producerId:
          description: Opaque process identifier when a live producer supplies one.
          examples:
            - reporter-7f5d9c
          type: string
        routePath:
          description: Authenticated HTTP path serving this manifest.
          examples:
            - /v1/streaming/events
          type: string
        serviceName:
          description: Name of the service publishing the events.
          examples:
            - reporter
          type: string
        source:
          description: "The producing application's CloudEvents ce-source: a single dot-free lowercase segment."
          examples:
            - reporter
          type: string
      type: object
    StreamingRouteHumaResponse:
      properties:
        definitionKey:
          description: Event definition key served by the route.
          examples:
            - report.requested
          type: string
        destination:
          description: Sanitized transport destination.
          examples:
            - reporter.events
          type: string
        dlqConfigured:
          description: Whether the route has a dead-letter destination.
          examples:
            - true
          type: boolean
        key:
          description: Stable route key.
          examples:
            - reports-rabbitmq
          type: string
        required:
          description: Whether route failure makes the logical emit fail.
          examples:
            - true
          type: boolean
        target:
          description: Logical delivery target name.
          examples:
            - primary
          type: string
        transport:
          description: Outbound transport family.
          enum:
            - kafka
            - sqs
            - rabbitmq
            - eventbridge
            - custom
          examples:
            - rabbitmq
          type: string
      type: object
    SubscribeRegulatoryHumaInputBody:
      additionalProperties: false
      properties:
        documentId:
          description: Document to activate, as the catalog publishes it.
          examples:
            - br.bcb.cadoc-4010
          type: string
        institution:
          description: "Institution that files the document. Omitted, the tenant's only institution files it; with none or several the request is refused. \"all\" is refused: a filing declares one institution."
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        mapping:
          description: "Where the mapping starts: reference is the catalog's mapping for the Lerian ecosystem (Midaz), homologated; blank leaves every field for the client to map from their own database. Omitted, reference. A document whose catalog publishes no reference starts blank either way."
          enum:
            - reference
            - blank
          examples:
            - reference
          type: string
        version:
          description: Document version to pin; omitted pins the newest the origin publishes.
          examples:
            - 1.0.0
          type: string
      required:
        - documentId
      type: object
    Subscription:
      additionalProperties: false
      properties:
        adoptedVersion:
          description: Version of the document this tenant generates against
          examples:
            - 1.0.0
          type: string
        adoptionHistory:
          description: Append-only record of which version was adopted, by whom and when
          items:
            $ref: "#/components/schemas/Adoption"
          type:
            - array
            - "null"
        bindingVersion:
          description: Version of the mapping in force, the one its ETag carries; 0 when none was written
          examples:
            - 3
          format: int64
          type: integer
        createdAt:
          description: Creation timestamp in UTC
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        deactivatedAt:
          description: When the subscription was last deactivated, in UTC; absent if never
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        deactivatedBy:
          description: Authenticated subject that last deactivated it; absent if never, or if that request identified nobody
          examples:
            - acme/00000000-0000-0000-0000-000000000000
          type: string
        documentId:
          description: Curated document this subscription files
          examples:
            - br.bcb.cadoc-4010
          type: string
        id:
          description: Unique subscription identifier
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        institutionId:
          description: "Institution that files the document. Absent on a subscription made before filings named an institution: it generates for the tenant's only institution, and with none or several it waits until one is set."
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        reactivatedAt:
          description: When the subscription was last reactivated, in UTC; absent if never
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        reactivatedBy:
          description: Authenticated subject that last reactivated it; absent if never
          examples:
            - acme/00000000-0000-0000-0000-000000000000
          type: string
        status:
          description: active or inactive
          examples:
            - active
          type: string
        updatedAt:
          description: Most recent update timestamp in UTC
          examples:
            - "2026-01-01T00:00:00Z"
          format: date-time
          type: string
        version:
          description: Version of the subscription; setting its institution presents it as If-Match. 0 on a subscription never written since versions were counted.
          examples:
            - 1
          format: int64
          type: integer
      required:
        - id
        - documentId
        - version
        - adoptedVersion
        - status
        - adoptionHistory
        - bindingVersion
        - createdAt
        - updatedAt
      type: object
    SubscriptionActivation:
      additionalProperties: false
      properties:
        readiness:
          $ref: "#/components/schemas/Readiness"
        subscription:
          $ref: "#/components/schemas/Subscription"
      required:
        - subscription
        - readiness
      type: object
    TableScope:
      additionalProperties: false
      properties:
        conditions:
          additionalProperties:
            $ref: "#/components/schemas/FilterCondition"
          description: Conditions a row must meet to belong to the institution, keyed by field, in the report filter vocabulary; at least one is eq or in, and the others may narrow with any operator. Empty on a shared table.
          examples:
            - organization_id:
                eq:
                  - 00000000-0000-0000-0000-000000000000
          type: object
        shared:
          description: The table is reference data every institution reads whole.
          examples:
            - false
          type: boolean
      required:
        - shared
        - conditions
      type: object
    Template:
      properties:
        category:
          description: Report family this template belongs to, lower-case; empty on a template stored before categories existed
          examples:
            - cadoc
          type: string
        createdAt:
          description: Template creation timestamp in UTC
          examples:
            - "2021-01-01T00:00:00Z"
          format: date-time
          type: string
        description:
          description: Human-readable template description
          examples:
            - Monthly financial report
          type: string
        fileName:
          description: Stored template filename
          examples:
            - 0196159b-4f26-7300-b3d9-f4f68a7c85f3_1744119295.tpl
          type: string
        id:
          description: Unique template identifier
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        outputFormat:
          description: Format generated from this template
          examples:
            - HTML
          type: string
        parameters:
          description: Generation parameters this template declares; a report request must answer each required one. Empty when the template declares none
          items:
            $ref: "#/components/schemas/ParameterSpec"
          type:
            - array
            - "null"
        updatedAt:
          description: Most recent template update timestamp in UTC
          examples:
            - "2021-01-01T00:00:00Z"
          format: date-time
          type: string
      type: object
    TemplateBlock:
      properties:
        assignment:
          description: Assignment expression emitted by a set block.
          examples:
            - total = account.balance
          type: string
        blockId:
          description: Client-defined identifier used to locate validation errors.
          examples:
            - customer-name
          type: string
        children:
          description: Nested blocks rendered inside this block.
          examples:
            -   - content: Transaction
                  type: text
          items:
            $ref: "#/components/schemas/TemplateBlock"
          type:
            - array
            - "null"
        collection:
          description: Collection expression traversed by a loop block.
          examples:
            - account.transactions
          type: string
        condition:
          description: Boolean expression evaluated by a conditional block.
          examples:
            - account.active
          type: string
        content:
          description: Literal content rendered by text blocks.
          examples:
            - "Account holder: "
          type: string
        elifBranches:
          description: Additional conditional branches evaluated in order.
          examples:
            -   - children:
                    - content: Pending
                      type: text
                  condition: account.pending
          items:
            $ref: "#/components/schemas/ElifBranch"
          type:
            - array
            - "null"
        elseChildren:
          description: Blocks rendered when the primary condition is false.
          examples:
            -   - content: Inactive
                  type: text
          items:
            $ref: "#/components/schemas/TemplateBlock"
          type:
            - array
            - "null"
        expression:
          description: Expression emitted by an expression block.
          examples:
            - account.balance > 0
          type: string
        field:
          description: Data field referenced by the block.
          examples:
            - transaction.amount
          type: string
        filters:
          description: Ordered filters applied to the variable.
          examples:
            -   - name: upper
          items:
            $ref: "#/components/schemas/FilterChain"
          type:
            - array
            - "null"
        format:
          description: Formatting option applied by the block.
          examples:
            - "2006-01-02"
          type: string
        function:
          description: Template function invoked by the block.
          examples:
            - format_currency
          type: string
        inline:
          description: Whether the block renders without adding a line break.
          examples:
            - true
          type: boolean
        iterator:
          description: Iterator variable name used by loop blocks.
          examples:
            - transaction
          type: string
        properties:
          additionalProperties: {}
          description: Block-specific configuration properties.
          examples:
            - class: summary
          type: object
        tagArgs:
          description: Arguments passed to the Pongo2 tag.
          examples:
            - "\"summary.html\""
          type: string
        tagName:
          description: Pongo2 tag name emitted by a custom-tag block.
          examples:
            - include
          type: string
        trimWhitespace:
          description: Whether surrounding whitespace is removed during rendering.
          examples:
            - true
          type: boolean
        type:
          description: Template builder block type.
          examples:
            - variable
          type: string
        variable:
          description: Variable expression rendered by the block.
          examples:
            - account.holderName
          type: string
      type: object
    TemplateContent:
      additionalProperties: false
      properties:
        content:
          description: Stored template source, verbatim as it was uploaded
          examples:
            - <html><body>{{ total }}</body></html>
          type: string
        id:
          description: Identifier of the template the content belongs to
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        outputFormat:
          description: Format this template renders to; a Pdf template is authored as HTML
          examples:
            - html
          type: string
      required:
        - id
        - outputFormat
        - content
      type: object
    TemplateOrigin:
      additionalProperties: false
      properties:
        category:
          description: Template category, which is what makes the filing regulatory.
          examples:
            - cadoc4010
          type: string
        revision:
          description: Revision of the template the report was generated from.
          examples:
            - 4
          format: int64
          type: integer
        revisionChecksum:
          description: SHA-256 of the template revision used.
          examples:
            - 9f2c...
          type: string
        templateId:
          description: Template this report was generated from.
          examples:
            - 7c1e2f40-77d1-4a8a-9d0f-6b0e2c4a1111
          type: string
      required:
        - templateId
        - category
        - revision
        - revisionChecksum
      type: object
    TemplateResponse:
      properties:
        category:
          description: Report family this template belongs to, lower-case; empty on a template stored before categories existed
          examples:
            - cadoc
          type: string
        createdAt:
          description: Template creation timestamp in UTC
          examples:
            - "2021-01-01T00:00:00Z"
          format: date-time
          type: string
        description:
          description: Human-readable template description
          examples:
            - Monthly financial report
          type: string
        fileName:
          description: Stored template filename
          examples:
            - 0196159b-4f26-7300-b3d9-f4f68a7c85f3_1744119295.tpl
          type: string
        id:
          description: Unique template identifier
          examples:
            - 00000000-0000-0000-0000-000000000000
          type: string
        outputFormat:
          description: Format generated from this template
          examples:
            - HTML
          type: string
        parameters:
          description: Generation parameters this template declares; a report request must answer each required one. Empty when the template declares none
          items:
            $ref: "#/components/schemas/ParameterSpec"
          type:
            - array
            - "null"
        updatedAt:
          description: Most recent template update timestamp in UTC
          examples:
            - "2021-01-01T00:00:00Z"
          format: date-time
          type: string
        warnings:
          description: Non-fatal mapped-field validation warnings returned when a data source is unavailable
          examples:
            -   - code: DATA_SOURCE_UNAVAILABLE
                  field: account.balance
                  message: data source is temporarily unavailable
          items:
            $ref: "#/components/schemas/ValidationWarning"
          type:
            - array
            - "null"
      type: object
    UpdateTemplateCategoriesHumaInputBody:
      properties:
        category:
          description: Report family to file every listed template under. Case and surrounding spaces are corrected; a spelling that cannot be canonicalised is refused.
          examples:
            - cadoc
          type: string
        templateIds:
          description: Templates to file under the family. Ids that name no live template are reported through matched rather than refused.
          examples:
            -   - 00000000-0000-0000-0000-000000000000
          items:
            type: string
          type:
            - array
            - "null"
      required:
        - category
        - templateIds
      type: object
    UpdateTemplateCategoriesHumaOutputBody:
      additionalProperties: false
      properties:
        category:
          description: The canonical family the templates were filed under
          examples:
            - cadoc
          type: string
        matched:
          description: How many of the ids named a live template
          examples:
            - 38
          format: int64
          type: integer
        modified:
          description: How many documents actually changed; zero when the batch was already applied
          examples:
            - 38
          format: int64
          type: integer
      required:
        - category
        - matched
        - modified
      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
    ValidateBlocksInput:
      properties:
        blocks:
          description: Template builder blocks to validate.
          examples:
            -   - type: variable
                  variable: account.id
          items:
            $ref: "#/components/schemas/TemplateBlock"
          type:
            - array
            - "null"
      type: object
    ValidateBlocksResponse:
      properties:
        errors:
          description: Semantic validation failures, in block traversal order.
          examples:
            -   - blockId: customer-name
                  field: variable
                  message: variable must not be empty
          items:
            $ref: "#/components/schemas/ValidationError"
          type:
            - array
            - "null"
        valid:
          description: Whether every supplied block is semantically valid.
          examples:
            - false
          type: boolean
      type: object
    ValidationError:
      properties:
        blockId:
          description: Identifier of the invalid block, empty for request-level errors.
          examples:
            - customer-name
          type: string
        field:
          description: Invalid block or request field.
          examples:
            - variable
          type: string
        message:
          description: Human-readable validation failure.
          examples:
            - variable must not be empty
          type: string
      type: object
    ValidationWarning:
      properties:
        code:
          description: Machine-readable warning code.
          examples:
            - DATA_SOURCE_UNAVAILABLE
          type: string
        field:
          description: Field or data source reference affected by the warning.
          examples:
            - customers.email
          type: string
        message:
          description: Human-readable description of the warning.
          examples:
            - Data source is temporarily unavailable.
          type: string
      type: object
    VersionAdoption:
      additionalProperties: false
      properties:
        adjustment:
          $ref: "#/components/schemas/Adjustment"
        mappingBroken:
          description: Why the existing mapping no longer plans against the adopted contract, when it does not.
          examples:
            - "dataset 'saldos': field 'novoCampo' is not a field..."
          type: string
        readiness:
          $ref: "#/components/schemas/Readiness"
        subscription:
          $ref: "#/components/schemas/Subscription"
      required:
        - subscription
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: Use this API to manage the data sources, templates, and reports of Reporter.
  license:
    name: Lerian Studio General License
  title: Midaz Reporter API
  version: 4.0.0
openapi: 3.1.0
paths:
  /v1/data-sources:
    get:
      description: Returns a page of registered data sources. Connection credentials never appear in responses.
      operationId: listDataSources
      parameters:
        - description: Sort order by creation time, asc or desc; sortOrder is also accepted.
          example: desc
          explode: false
          in: query
          name: sort_order
          schema:
            description: Sort order by creation time, asc or desc; sortOrder is also accepted.
            type: string
        - description: Maximum number of data sources in the page.
          example: 10
          explode: false
          in: query
          name: limit
          schema:
            default: 10
            description: Maximum number of data sources in the page.
            type: integer
        - description: One-based page number.
          example: 1
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: One-based page number.
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataSourceListHumaBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List data sources
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/list-data-sources
    post:
      description: "Registers a data source connection. The password is write-only: it is encrypted at rest and never returned by any operation."
      operationId: createDataSource
      requestBody:
        content:
          application/json:
            schema:
              properties:
                configName:
                  description: Stable business key referenced by templates; unique among live data sources.
                  examples:
                    - midaz_onboarding
                  type: string
                databaseName:
                  description: Database name.
                  examples:
                    - onboarding
                  type: string
                host:
                  description: Database host.
                  examples:
                    - db.internal
                  type: string
                metadata:
                  additionalProperties: {}
                  description: Free-form metadata.
                  type: object
                options:
                  description: MongoDB URI options string (e.g. authSource=admin). Not applicable to postgresql.
                  examples:
                    - authSource=admin
                  type: string
                password:
                  description: "Write-only credential: encrypted at rest, never returned by any operation."
                  examples:
                    - "-"
                  type: string
                port:
                  description: Database port.
                  examples:
                    - 5432
                  format: int64
                  type: integer
                schemas:
                  description: PostgreSQL schemas to expose; defaults to [public]. Not applicable to mongodb.
                  examples:
                    -   - public
                  items:
                    type: string
                  type:
                    - array
                    - "null"
                sslCaBase64:
                  description: "MongoDB or PostgreSQL: standard Base64 of a PEM CA bundle. Mutually exclusive with an existing CA file; requires verified TLS (postgresql requires sslMode verify-ca or verify-full)."
                  examples:
                    - ""
                  type: string
                sslMode:
                  description: "TLS mode: disable, require, verify-ca, or verify-full. Defaults to verify-full for PostgreSQL with sslCaBase64; otherwise defaults to require when omitted."
                  examples:
                    - require
                  type: string
                type:
                  description: "Data source engine type: postgresql or mongodb."
                  examples:
                    - postgresql
                  type: string
                username:
                  description: Database username.
                  examples:
                    - reporter_ro
                  type: string
              required:
                - configName
                - databaseName
                - host
                - password
                - port
                - type
                - username
              type: object
        description: JSON request payload.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataSource"
          description: Created
        "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
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "412":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Failed
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Create a data source
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/create-data-source
  /v1/data-sources/{dataSourceId}:
    delete:
      description: "Soft-deletes a data source. A data source still referenced by live templates is protected and the delete is refused with a conflict. Deleting is a one-way revocation of the name: the name is immediately free for a new data source to claim, but until one does, anything still referencing it fails instead of resolving against a different database. A revocation cannot be undone."
      operationId: deleteDataSource
      parameters:
        - description: Unique data source identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: dataSourceId
          required: true
          schema:
            description: Unique data source identifier.
            type: string
      responses:
        "204":
          description: No Content
        "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
      summary: Delete a data source
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/delete-data-source
    get:
      description: Returns the connection configuration of one registered data source. The queryable schema lives behind the /schema sub-resource.
      operationId: getDataSource
      parameters:
        - description: Unique data source identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: dataSourceId
          required: true
          schema:
            description: Unique data source identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataSource"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get a data source
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/retrieve-data-source
    patch:
      description: "Partially updates a data source. An omitted password preserves the stored credential; a present password is re-encrypted. Renaming configName revokes the previous name exactly as a delete does: the previous name is free for a new data source to claim, but until one does, anything still referencing it fails instead of resolving against a different database."
      operationId: updateDataSource
      parameters:
        - description: Unique data source identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: dataSourceId
          required: true
          schema:
            description: Unique data source identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                configName:
                  description: Updated stable business key; unique among live data sources.
                  examples:
                    - midaz_onboarding
                  type: string
                databaseName:
                  description: Updated database name.
                  examples:
                    - onboarding
                  type: string
                host:
                  description: Updated database host.
                  examples:
                    - db.internal
                  type: string
                metadata:
                  additionalProperties: {}
                  description: Updated free-form metadata. Omit the member to leave the stored metadata unchanged; send an empty object to clear it.
                  type: object
                options:
                  description: Updated MongoDB URI options string. Not applicable to postgresql.
                  examples:
                    - authSource=admin
                  type: string
                password:
                  description: Write-only credential; omitted means keep the stored credential.
                  examples:
                    - "-"
                  type: string
                port:
                  description: Updated database port.
                  examples:
                    - 5432
                  format: int64
                  type: integer
                schemas:
                  description: Updated PostgreSQL schemas to expose.
                  examples:
                    -   - public
                  items:
                    type: string
                  type:
                    - array
                    - "null"
                sslCaBase64:
                  description: "MongoDB or PostgreSQL: replace the Base64 PEM CA bundle; omit to preserve, empty string to clear. Requires password when changed."
                  examples:
                    - ""
                  type: string
                sslMode:
                  description: "Updated TLS mode: disable, require, verify-ca, or verify-full."
                  examples:
                    - require
                  type: string
                type:
                  description: "Updated engine type: postgresql or mongodb."
                  examples:
                    - postgresql
                  type: string
                username:
                  description: Updated database username.
                  examples:
                    - reporter_ro
                  type: string
              type: object
        description: JSON request payload.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataSource"
          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
        "412":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Failed
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Update a data source
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/update-data-source
  /v1/data-sources/{dataSourceId}/schema:
    get:
      description: "Introspects the live schema of a data source: queryable tables (or collections) with typed fields."
      operationId: getDataSourceSchema
      parameters:
        - description: Unique data source identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: dataSourceId
          required: true
          schema:
            description: Unique data source identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataSourceSchemaResult"
          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
        "412":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Failed
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get a data source schema
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/get-data-source-schema
  /v1/data-sources/{dataSourceId}/test-connection:
    post:
      description: Probes connectivity with an ephemeral connection. A failed probe is a 200 with status "failed" and a client-safe message; latencyMs measures the full dial+ping round trip.
      operationId: testDataSourceConnection
      parameters:
        - description: Unique data source identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: dataSourceId
          required: true
          schema:
            description: Unique data source identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataSourceConnectionResult"
          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
        "412":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Failed
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Test a data source connection
      tags:
        - Data Sources
      x-mint:
        href: /pt/reference/products/reporter/test-data-source-connection
  /v1/deadlines:
    get:
      description: Returns a filtered page of deadlines.
      operationId: listDeadlines
      parameters:
        - description: Deadline status filter; one of pending, overdue or delivered. Any other value is refused.
          example: pending
          explode: false
          in: query
          name: status
          schema:
            description: Deadline status filter; one of pending, overdue or delivered. Any other value is refused.
            enum:
              - pending
              - overdue
              - delivered
            type: string
        - description: Restricts the page to active or inactive deadlines.
          example: "true"
          explode: false
          in: query
          name: active
          schema:
            description: Restricts the page to active or inactive deadlines.
            type: string
        - description: Deadline type.
          example: regulatory
          explode: false
          in: query
          name: type
          schema:
            description: Deadline type.
            type: string
        - description: Earliest due date in YYYY-MM-DD format, inclusive; startDate is also accepted.
          example: "2026-01-01"
          explode: false
          in: query
          name: start_date
          schema:
            description: Earliest due date in YYYY-MM-DD format, inclusive; startDate is also accepted.
            type: string
        - description: Latest due date in YYYY-MM-DD format, inclusive; endDate is also accepted.
          example: "2026-01-31"
          explode: false
          in: query
          name: end_date
          schema:
            description: Latest due date in YYYY-MM-DD format, inclusive; endDate is also accepted.
            type: string
        - description: Sort order by creation time, asc or desc; sortOrder is also accepted.
          example: desc
          explode: false
          in: query
          name: sort_order
          schema:
            description: Sort order by creation time, asc or desc; sortOrder is also accepted.
            type: string
        - description: Maximum number of deadlines in the page.
          example: 10
          explode: false
          in: query
          name: limit
          schema:
            default: 10
            description: Maximum number of deadlines in the page.
            type: integer
        - description: One-based page number.
          example: 1
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: One-based page number.
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeadlineListHumaBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List deadlines
      tags:
        - Deadlines
      x-mint:
        href: /pt/reference/products/reporter/retrieve-deadlines
    post:
      description: Creates a deadline and returns the persisted entity.
      operationId: createDeadline
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  description: Whether the deadline is active.
                  examples:
                    - true
                  type: boolean
                color:
                  description: Hex color used to identify the deadline.
                  examples:
                    - "#FF5733"
                  type: string
                description:
                  description: Optional deadline description.
                  examples:
                    - Monthly regulatory compliance report
                  type: string
                dueDate:
                  description: Date and time when the deadline is due.
                  examples:
                    - "2026-03-31T23:59:59Z"
                  format: date-time
                  type: string
                filters:
                  additionalProperties:
                    additionalProperties:
                      additionalProperties:
                        $ref: "#/components/schemas/DeadlineFilterCondition"
                      type: object
                    type: object
                  description: "Filter conditions this deadline applies when it fires, grouped by data source, table, and field. Optional: omit it for a deadline that filters nothing."
                  examples:
                    - accounts:
                        account:
                          vencimento:
                            period: previous_month
                  type: object
                frequency:
                  description: Deadline recurrence frequency.
                  examples:
                    - monthly
                  type: string
                monthsOfYear:
                  description: Months in which a semiannual or annual deadline occurs.
                  examples:
                    -   - 1
                        - 6
                  items:
                    format: int64
                    type: integer
                  type:
                    - array
                    - "null"
                name:
                  description: Human-readable deadline name.
                  examples:
                    - Monthly Regulatory Report
                  type: string
                notifyDaysBefore:
                  description: Days before the due date when notifications begin.
                  examples:
                    - 5
                  format: int64
                  type: integer
                templateId:
                  description: Template used to generate the deadline report.
                  examples:
                    - 00000000-0000-0000-0000-000000000001
                  type: string
                type:
                  description: Deadline category.
                  examples:
                    - regulatory
                  type: string
              required:
                - color
                - dueDate
                - frequency
                - name
                - type
              type: object
        description: JSON request payload.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Deadline"
          description: Created
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Create a deadline
      tags:
        - Deadlines
      x-mint:
        href: /pt/reference/products/reporter/create-deadline
  /v1/deadlines/notifications:
    get:
      description: Returns active deadlines inside their notification window, ordered by urgency.
      operationId: listDeadlineNotifications
      parameters:
        - description: Maximum number of notifications to return, from 1 through 100.
          example: 10
          explode: false
          in: query
          name: limit
          schema:
            default: 10
            description: Maximum number of notifications to return, from 1 through 100.
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotificationResponse"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List deadline notifications
      tags:
        - Deadlines
      x-mint:
        href: /pt/reference/products/reporter/retrieve-deadline-notifications
  /v1/deadlines/{id}:
    delete:
      description: Soft-deletes a deadline.
      operationId: deleteDeadline
      parameters:
        - description: Unique deadline identifier.
          example: 00000000-0000-0000-0000-000000000001
          in: path
          name: id
          required: true
          schema:
            description: Unique deadline identifier.
            type: string
      responses:
        "204":
          description: No Content
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Delete a deadline
      tags:
        - Deadlines
      x-mint:
        href: /pt/reference/products/reporter/delete-deadline
    patch:
      description: Partially updates a deadline and returns the persisted entity.
      operationId: updateDeadline
      parameters:
        - description: Unique deadline identifier.
          example: 00000000-0000-0000-0000-000000000001
          in: path
          name: id
          required: true
          schema:
            description: Unique deadline identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  description: Updated active state.
                  examples:
                    - false
                  type: boolean
                color:
                  description: Updated hex color.
                  examples:
                    - "#00FF00"
                  type: string
                description:
                  description: Updated deadline description.
                  examples:
                    - Updated description
                  type: string
                dueDate:
                  description: Updated deadline due date and time.
                  examples:
                    - "2026-06-30T23:59:59Z"
                  format: date-time
                  type: string
                filters:
                  additionalProperties:
                    additionalProperties:
                      additionalProperties:
                        $ref: "#/components/schemas/DeadlineFilterCondition"
                      type: object
                    type: object
                  description: "Updated filter conditions, grouped by data source, table, and field. Omit the member, or send null, to leave the stored filter unchanged; send an empty object to remove it. A filter that is sent REPLACES the stored one whole: there is no merge, and no way to remove one branch while keeping the rest."
                  examples:
                    - accounts:
                        account:
                          vencimento:
                            period: previous_month
                  type: object
                frequency:
                  description: Updated recurrence frequency.
                  examples:
                    - annual
                  type: string
                monthsOfYear:
                  description: Updated recurrence months.
                  examples:
                    -   - 6
                  items:
                    format: int64
                    type: integer
                  type:
                    - array
                    - "null"
                name:
                  description: Updated human-readable deadline name.
                  examples:
                    - Updated Report Name
                  type: string
                notifyDaysBefore:
                  description: Updated notification lead time in days.
                  examples:
                    - 10
                  format: int64
                  type: integer
                templateId:
                  description: Updated template identifier.
                  examples:
                    - 00000000-0000-0000-0000-000000000001
                  type: string
                type:
                  description: Updated deadline category.
                  examples:
                    - custom
                  type: string
              type: object
        description: JSON request payload.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Deadline"
          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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Update a deadline
      tags:
        - Deadlines
      x-mint:
        href: /pt/reference/products/reporter/update-deadline
  /v1/deadlines/{id}/deliver:
    patch:
      description: Marks a deadline as delivered or reverts its delivery state.
      operationId: deliverDeadline
      parameters:
        - description: Unique deadline identifier.
          example: 00000000-0000-0000-0000-000000000001
          in: path
          name: id
          required: true
          schema:
            description: Unique deadline identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                delivered:
                  description: Whether to mark the deadline delivered or revert its delivery.
                  examples:
                    - true
                  type:
                    - boolean
                    - "null"
              required:
                - delivered
              type: object
        description: JSON request payload.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Deadline"
          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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Set deadline delivery state
      tags:
        - Deadlines
      x-mint:
        href: /pt/reference/products/reporter/deliver-deadline
  /v1/institutions:
    get:
      description: Returns a page of the tenant's institutions. Paginated by page and limit; cursor is refused.
      operationId: listInstitutions
      parameters:
        - description: Sort order by creation time, asc or desc; sortOrder is also accepted.
          example: desc
          explode: false
          in: query
          name: sort_order
          schema:
            description: Sort order by creation time, asc or desc; sortOrder is also accepted.
            type: string
        - description: Maximum number of institutions in the page.
          example: 10
          explode: false
          in: query
          name: limit
          schema:
            default: 10
            description: Maximum number of institutions in the page.
            type: integer
        - description: One-based page number.
          example: 1
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: One-based page number.
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InstitutionListHumaBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List institutions
      tags:
        - Institutions
      x-mint:
        href: /pt/reference/products/reporter/list-institutions
    post:
      description: "Registers one of the tenant's financial institutions: one regulatory declarant, one CNPJ, numeric or alphanumeric. The CNPJ is stored uppercase and without punctuation, and a second live institution with the same CNPJ is refused with 409. Each data source named in the scope must be one the tenant can read; its tables and columns are not checked here. The answer carries the version in the ETag."
      operationId: createInstitution
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                cnpj:
                  description: CNPJ of the institution, numeric or alphanumeric, with or without punctuation.
                  examples:
                    - 12.ABC.345/01DE-35
                  type: string
                name:
                  description: Name of the institution.
                  examples:
                    - Banco Exemplo S.A.
                  type: string
                scope:
                  additionalProperties:
                    $ref: "#/components/schemas/DataSourceScope"
                  description: The rows of each data source that belong to this institution, keyed by data source name. May be empty.
                  type: object
              required:
                - name
                - cnpj
                - scope
              type: object
        description: JSON request payload.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Institution"
          description: Created
          headers:
            ETag:
              schema:
                description: Version of the institution; present it as If-Match to update on top of it.
                examples:
                  - "\"1\""
                type: string
        "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
        "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
      summary: Register an institution
      tags:
        - Institutions
      x-mint:
        href: /pt/reference/products/reporter/create-institution
  /v1/institutions/proposals:
    get:
      description: "Proposes one institution per live Midaz organization that no institution of the tenant covers yet: none holds its CNPJ, and none names its id in the scope of the data source holding Midaz's organization table. The name is the legal name and the CNPJ the legal document, which Midaz does not check, so cnpjValid says whether its check digits hold. The scope covers the organization table by id and every table of the named data sources with an organization_id column by it; a table with neither is left out. Nothing is written: confirming a proposal is an ordinary create."
      operationId: proposeInstitutions
      parameters:
        - description: Required. Comma-separated names of the registered data sources the proposed scope covers; one of them holds Midaz's organization table.
          example: midaz_onboarding,midaz_transaction
          explode: false
          in: query
          name: dataSources
          schema:
            description: Required. Comma-separated names of the registered data sources the proposed scope covers; one of them holds Midaz's organization table.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InstitutionProposalsHumaBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Propose institutions from Midaz
      tags:
        - Institutions
      x-mint:
        href: /pt/reference/products/reporter/propose-institutions
  /v1/institutions/{institutionId}:
    delete:
      description: Soft-deletes an institution. Its CNPJ is free to register again at once.
      operationId: deleteInstitution
      parameters:
        - description: Unique institution identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: institutionId
          required: true
          schema:
            description: Unique institution identifier.
            type: string
      responses:
        "204":
          description: No Content
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Delete an institution
      tags:
        - Institutions
      x-mint:
        href: /pt/reference/products/reporter/delete-institution
    get:
      description: Returns one institution, with its version in the ETag.
      operationId: getInstitution
      parameters:
        - description: Unique institution identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: institutionId
          required: true
          schema:
            description: Unique institution identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Institution"
          description: OK
          headers:
            ETag:
              schema:
                description: Version of the institution; present it as If-Match to update on top of it.
                examples:
                  - "\"1\""
                type: string
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get an institution
      tags:
        - Institutions
      x-mint:
        href: /pt/reference/products/reporter/get-institution
    put:
      description: Replaces the institution's name, CNPJ and scope, IF If-Match carries the version the caller read. Without a readable If-Match the request is refused with 428; a stale version is refused with 409 naming both versions. The answer carries the new version in the ETag.
      operationId: updateInstitution
      parameters:
        - description: Unique institution identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: institutionId
          required: true
          schema:
            description: Unique institution identifier.
            type: string
        - description: Version the caller read, from the ETag of a previous read. Required.
          example: "\"1\""
          in: header
          name: If-Match
          schema:
            description: Version the caller read, from the ETag of a previous read. Required.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                cnpj:
                  description: CNPJ of the institution, numeric or alphanumeric, with or without punctuation.
                  examples:
                    - 12.ABC.345/01DE-35
                  type: string
                name:
                  description: Name of the institution.
                  examples:
                    - Banco Exemplo S.A.
                  type: string
                scope:
                  additionalProperties:
                    $ref: "#/components/schemas/DataSourceScope"
                  description: The rows of each data source that belong to this institution, keyed by data source name. May be empty.
                  type: object
              required:
                - name
                - cnpj
                - scope
              type: object
        description: JSON request payload.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Institution"
          description: OK
          headers:
            ETag:
              schema:
                description: Version of the institution; present it as If-Match to update on top of it.
                examples:
                  - "\"1\""
                type: string
        "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
        "428":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Required
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Replace an institution
      tags:
        - Institutions
      x-mint:
        href: /pt/reference/products/reporter/replace-institution
  /v1/metrics:
    get:
      description: Returns aggregate template, report, data-source, and report-error counters.
      operationId: getMetrics
      parameters:
        - description: Number of days in the current error-counting window. Defaults to 7 and accepts values from 1 through 365.
          example: 7
          in: query
          name: errorPeriodDays
          schema:
            default: 7
            description: Number of days in the current error-counting window. Defaults to 7 and accepts values from 1 through 365.
            maximum: 365
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MetricsHumaResponse"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get system metrics
      tags:
        - Metrics
      x-mint:
        href: /pt/reference/products/reporter/get-metrics
  /v1/regulatory/documents:
    get:
      description: Returns the curated documents mounted on this deployment, each once, whether or not this tenant subscribed to it; which ones the tenant files is the subscriptions list. A document that ships a reference binding is activated by correcting a mapping; one that does not is mapped from nothing, and the difference is on each item.
      operationId: listRegulatoryDocuments
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryDocumentsBody"
          description: OK
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List the regulatory documents this deployment can file
      tags:
        - Regulatory Catalog
      x-mint:
        href: /pt/reference/products/reporter/list-regulatory-documents
  /v1/regulatory/documents/{documentId}:
    get:
      description: Returns what a document is and which version of it this deployment carries. What the file NEEDS, field by field, is the contract sub-resource.
      operationId: getRegulatoryDocument
      parameters:
        - description: Document identifier, as the catalog publishes it.
          example: br.bcb.cadoc-4010
          in: path
          name: documentId
          required: true
          schema:
            description: Document identifier, as the catalog publishes it.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogDocument"
          description: OK
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get one regulatory document
      tags:
        - Regulatory Catalog
      x-mint:
        href: /pt/reference/products/reporter/get-regulatory-document
  /v1/regulatory/documents/{documentId}/contract:
    get:
      description: "Returns the contract: every set the file carries, every field of it, its type, whether it is required and how it is formatted. It is what a client reads to understand what they are mapping, and it is curated — never uploaded."
      operationId: getRegulatoryDocumentContract
      parameters:
        - description: Document identifier, as the catalog publishes it.
          example: br.bcb.cadoc-4010
          in: path
          name: documentId
          required: true
          schema:
            description: Document identifier, as the catalog publishes it.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryContractWire"
          description: OK
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get what a document's file needs
      tags:
        - Regulatory Catalog
      x-mint:
        href: /pt/reference/products/reporter/get-document-contract
  /v1/regulatory/reports:
    post:
      description: "Asks the worker to generate one filing: the binding in force is frozen into the request, the version is the one the subscription pinned, and the report comes out a DRAFT a person corrects and approves. The answer carries the fields nothing fills yet, so the blanks in the draft arrive expected rather than looking broken. Everything refusable cheaply is refused here: an inactive subscription, a missing required parameter, a binding that no longer plans."
      operationId: createRegulatoryReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateRegulatoryReportHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryReportRequested"
          description: Created
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Generate a filing of a subscribed document
      tags:
        - Regulatory Reports
      x-mint:
        href: /pt/reference/products/reporter/create-regulatory-report
  /v1/regulatory/reports/{reportId}/approve:
    post:
      description: "Requires the 'regulatory-approval' permission, which is deliberately NOT the one that generates and corrects — that separation is what lets a client put approval in a second pair of hands. Freezes the draft as Final — the file a person accepted, at the version they read (If-Match, required). A draft with a REQUIRED field still blank is refused with 409: an incomplete file must never become the filing. A second approval of the same version by the SAME approver answers 200 again — that is a retry, and the report is approved either way; by a DIFFERENT approver it is refused, because the record would otherwise name whoever won a race. A different version is a conflict, because what they read is not what they would be approving. After approval nothing changes it: corrections are refused and the provenance is frozen for good."
      operationId: approveRegulatoryReport
      parameters:
        - description: Report identifier.
          example: 00000000-0000-0000-0000-000000000001
          in: path
          name: reportId
          required: true
          schema:
            description: Report identifier.
            type: string
        - description: Draft version the caller read and is approving. Required.
          example: "\"3\""
          in: header
          name: If-Match
          schema:
            description: Draft version the caller read and is approving. Required.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report"
          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
        "428":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Required
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Approve a draft as the filing
      tags:
        - Regulatory Reports
      x-mint:
        href: /pt/reference/products/reporter/approve-regulatory-report
  /v1/regulatory/reports/{reportId}/overrides:
    get:
      description: "Answers every correction ever applied to this report, oldest first: who changed which field of which row, from what, to what, and why. Append-only — a correction of a correction is a second entry, never an edit of the first. It is the record that explains to an auditor why a figure in the filing differs from the ledger behind it."
      operationId: listRegulatoryOverrides
      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/RegulatoryOverridesListBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Read the trail of corrections
      tags:
        - Regulatory Reports
      x-mint:
        href: /pt/reference/products/reporter/list-report-corrections
    post:
      description: "Applies corrections to a regulatory draft and re-renders the file from the SAME rows the draft was generated from — correcting one field never re-extracts, so no other number moves under the reviewer; new data is a new generation. If-Match must carry the draft version the caller read (the report's draftVersion): a stale version is refused with 409 naming both, and without the header the request is refused with 428. Every correction goes through the contract's own rules — type, scale, pattern, and the row it names must exist, exactly one of it — and a correction that does not fit is refused with nothing changed. A correction may not name a field that identifies a row of its set: that would re-identify the row rather than correct a value in it, leaving the recorded trail pointing at a row that no longer exists, so it is refused and the mapping or the source is what gets fixed. The answer carries the new draft version in the ETag and the fields still unfilled."
      operationId: applyRegulatoryOverrides
      parameters:
        - description: Report identifier, from the generation's answer.
          example: 00000000-0000-0000-0000-000000000001
          in: path
          name: reportId
          required: true
          schema:
            description: Report identifier, from the generation's answer.
            type: string
        - description: Draft version the caller read, from the report's draftVersion. Required.
          example: "\"1\""
          in: header
          name: If-Match
          schema:
            description: Draft version the caller read, from the report's draftVersion. Required.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApplyRegulatoryOverridesHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DraftCorrected"
          description: OK
          headers:
            ETag:
              schema:
                description: Draft version now in force; present it as If-Match to correct or approve on top of it.
                examples:
                  - "\"2\""
                type: string
        "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
        "428":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Required
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Correct a draft and re-render it
      tags:
        - Regulatory Reports
      x-mint:
        href: /pt/reference/products/reporter/correct-regulatory-report
  /v1/regulatory/reports/{reportId}/provenance:
    get:
      description: "Answers the report's provenance: which document at which pinned version, under which subscription, with which binding version and generation parameters, and the SHA-256 of the artifact that was stored. It is what answers, months later, why the filing says what it says — and whether the file in hand is the file that was approved. A custom report has none and answers 404."
      operationId: getRegulatoryProvenance
      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/Provenance"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Read what a report was made of, frozen
      tags:
        - Regulatory Reports
      x-mint:
        href: /pt/reference/products/reporter/get-report-provenance
  /v1/regulatory/reports/{reportId}/rows:
    get:
      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
      summary: Read a filing's rows as its file shows them
      tags:
        - Regulatory Reports
      x-mint:
        href: /pt/reference/products/reporter/read-a-filings-rows-as-its-file-shows-them
  /v1/regulatory/subscriptions:
    get:
      description: "Returns the tenant's subscriptions, newest first. A cancelled one is kept and listed as inactive: reports already generated point at it, and their provenance has to stay readable."
      operationId: listRegulatorySubscriptions
      parameters:
        - description: Narrow to active or inactive; omitted returns both.
          example: active
          explode: false
          in: query
          name: status
          schema:
            description: Narrow to active or inactive; omitted returns both.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatorySubscriptionsBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List the documents this tenant files
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/list-subscriptions
    post:
      description: "Activates a document for this tenant, pinning the catalog version in force today, and writes the starting binding — the catalog's reference mapping when one is published, and an empty one when none is. The answer carries the readiness of that starting point: which tables and columns it already finds, and which fields nothing fills yet. A document already activated is refused with a conflict."
      operationId: subscribeRegulatoryDocument
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SubscribeRegulatoryHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionActivation"
          description: Created
        "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
      summary: Activate a regulatory document
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/create-subscription
  /v1/regulatory/subscriptions/{subscriptionId}:
    delete:
      description: Marks the subscription inactive and records when, and who when the request carries an authenticated subject. The record is KEPT — reports already generated point at it, and its mapping and adopted version stay with it, so reactivating brings them back as they were. The document also becomes available to subscribe to afresh, which starts a NEW subscription from the catalog's reference mapping. Deactivating a subscription that is already inactive changes nothing.
      operationId: deactivateRegulatorySubscription
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      responses:
        "204":
          description: No Content
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Stop filing a document
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/deactivate-subscription
    get:
      description: Returns the subscription, the version of the document it generates against, and the append-only record of which versions were adopted, by whom and when.
      operationId: getRegulatorySubscription
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: OK
          headers:
            ETag:
              schema:
                description: Version of the subscription; present it as If-Match to set its institution.
                examples:
                  - "\"2\""
                type: string
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get one activated document
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/get-subscription
  /v1/regulatory/subscriptions/{subscriptionId}/adopt:
    post:
      description: "Moves the subscription's pin to another catalog version — a DELIBERATE act: a release published upstream changes nothing here until somebody adopts it. The new version is fetched from the origin, verified and materialized BESIDE the old copy, never over it, so every report already generated stays explainable by its provenance. The answer carries what the new version does to the EXISTING mapping: its readiness against the adopted contract, the exact reason when it no longer plans at all (as information — the adoption stands), and how much of the new reference mapping it already agrees with. Omitting version adopts the newest the origin has; adopting the version already in force re-materializes the copy and leaves the history untouched."
      operationId: adoptRegulatoryVersion
      parameters:
        - description: Subscription whose pin moves.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Subscription whose pin moves.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AdoptRegulatoryVersionHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VersionAdoption"
          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
      summary: Adopt another version of the subscribed document
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/adopt-document-version
  /v1/regulatory/subscriptions/{subscriptionId}/binding:
    get:
      description: Returns the binding document itself, as YAML, with its version in the ETag. Present that ETag as If-Match to save on top of it.
      operationId: getRegulatoryBinding
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      responses:
        "200":
          content:
            application/yaml:
              schema:
                description: The binding document, in the same grammar the catalog publishes it in.
                type: string
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                description: Version of the binding; present it as If-Match to save on top of it.
                examples:
                  - "\"3\""
                type: string
            X-Mapping-Origin:
              schema:
                description: reference when the document is the catalog's homologated mapping for the pinned version, referenceWithAdditions when it is that mapping with additional sources the client added to consolidable sets, customized when the client made it; absent when it cannot be told.
                examples:
                  - reference
                type: string
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get the mapping in force
      tags:
        - Regulatory Bindings
      x-mint:
        href: /pt/reference/products/reporter/get-subscription-mapping
    put:
      description: "Replaces the binding with the document in the request body, IF If-Match carries the version the caller read. Without If-Match the request is refused with 428: saving a mapping without saying what you were editing is how one person's afternoon disappears. A stale version is refused with 409 naming both versions. The body is capped at 262144 bytes and a larger one is refused with 413 before it is parsed. The answer carries the new version and what the mapping just written can and cannot read."
      operationId: replaceRegulatoryBinding
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
        - description: Version the caller read, from the ETag of a previous GET. Required.
          example: "\"3\""
          in: header
          name: If-Match
          schema:
            description: Version the caller read, from the ETag of a previous GET. Required.
            type: string
      requestBody:
        content:
          application/yaml:
            schema:
              description: The binding document, in the same grammar the catalog publishes it in.
              type: string
        description: The binding document, replacing the mapping in force.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryBindingSaved"
          description: OK
          headers:
            ETag:
              schema:
                description: Version now in force.
                examples:
                  - "\"4\""
                type: string
        "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
        "413":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Request Entity Too Large
        "428":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Required
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Replace the mapping
      tags:
        - Regulatory Bindings
      x-mint:
        href: /pt/reference/products/reporter/replace-subscription-mapping
  /v1/regulatory/subscriptions/{subscriptionId}/binding/preview:
    post:
      description: "Reads the first rows ONE query of a mapping returns — the mapping as sent, saved or not, and never saved by this call — exactly as a generation reads it: planned against the subscription's pinned contract, with its filters (a parameter edge cut by the contract's calendar), joins, computed columns, aggregation and closed-set narrowing, scoped to the institution the subscription files for. The closed-period rule does not apply, so the current period can be previewed. At most `limit` rows (1 to 100, default 20) are answered; `hasMore` says the query has more. A query that reads another query's rows, a construct the engine does not execute, and the CRM source are refused. Previews share PREVIEW_MAX_CONCURRENT slots and answer 429 when they are busy. The body is capped at 1048576 bytes."
      operationId: previewRegulatoryBindingQuery
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PreviewBindingQueryInput"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BindingPreview"
          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
        "413":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Request Entity Too Large
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "429":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Too Many Requests
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Preview the rows of a query of the mapping
      tags:
        - Regulatory Bindings
      x-mint:
        href: /pt/reference/products/reporter/preview-the-rows-of-a-query-of-the-mapping
  /v1/regulatory/subscriptions/{subscriptionId}/binding/restart:
    post:
      description: Replaces the mapping in force with a starting point — the catalog's reference mapping of the pinned version, or a blank one — IF If-Match carries the version the caller read (428 without it, 409 when stale). It is a save like any other, so the answer carries the new version and its readiness, including whether it is the reference.
      operationId: restartRegulatoryBinding
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
        - description: Version the caller read, from the ETag of a previous GET. Required.
          example: "\"3\""
          in: header
          name: If-Match
          schema:
            description: Version the caller read, from the ETag of a previous GET. Required.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RestartRegulatoryBindingHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryBindingSaved"
          description: OK
          headers:
            ETag:
              schema:
                description: Version now in force.
                examples:
                  - "\"4\""
                type: string
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "428":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Required
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Restart the mapping
      tags:
        - Regulatory Bindings
      x-mint:
        href: /pt/reference/products/reporter/restart-the-mapping
  /v1/regulatory/subscriptions/{subscriptionId}/contract:
    get:
      description: Returns the contract of the version THIS subscription adopted — the same shape as the document's contract route — read from this tenant's own copy. A mapping is made for one subscription, and two institutions may file one document at different versions; the document's route answers the newest active subscription of the document, whichever institution files it, so a client mapping a subscription reads this one. With `version`, it answers a version the subscription adopted earlier, which is how a filing is read against the version it was generated with.
      operationId: getRegulatorySubscriptionContract
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
        - description: "A version this subscription adopted at some point — the one a filing was generated with. Absent: the version in force. One it never adopted answers 404."
          example: 1.7.0
          explode: false
          in: query
          name: version
          schema:
            description: "A version this subscription adopted at some point — the one a filing was generated with. Absent: the version in force. One it never adopted answers 404."
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryContractWire"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get the contract of the version this subscription files
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/get-the-contract-of-the-version-this-subscription-files
  /v1/regulatory/subscriptions/{subscriptionId}/gaps:
    get:
      description: "Re-runs the readiness check: every query with the table it named and the table the database has, every column marked found or not, and every field of the document nothing fills yet. Its own operation because the answer changes without the mapping changing — a table is created, a column renamed, a database comes back up."
      operationId: getRegulatoryBindingGaps
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Readiness"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Check the mapping against the databases as they are now
      tags:
        - Regulatory Bindings
      x-mint:
        href: /pt/reference/products/reporter/check-mapping-readiness
  /v1/regulatory/subscriptions/{subscriptionId}/institution:
    put:
      description: "Names the institution that files the subscribed document, IF If-Match carries the subscription version the caller read: without it the request is refused with 428, and a stale version with 409 naming both. A subscription made before filings named an institution generates for the tenant's only one and waits for this when the tenant has none or several. Refused with a conflict while another active subscription of the same document already files for that institution. Reports already generated keep the institution they froze."
      operationId: setRegulatorySubscriptionInstitution
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
        - description: Subscription version the caller read, from its ETag. Required.
          example: "\"2\""
          in: header
          name: If-Match
          schema:
            description: Subscription version the caller read, from its ETag. Required.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SetSubscriptionInstitutionHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: OK
          headers:
            ETag:
              schema:
                description: Version of the subscription; present it as If-Match to set its institution.
                examples:
                  - "\"2\""
                type: string
        "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
        "428":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Precondition Required
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Set the institution that files a subscription
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/set-subscription-institution
  /v1/regulatory/subscriptions/{subscriptionId}/manual:
    get:
      description: "Returns the curated manual as markdown: what the document is, what the curation assumes of the client's ledger, and what the version does not cover. It is the manual of the ADOPTED version, read from this tenant's own copy — not the catalog's newest, which would explain a document this tenant has not adopted. A document the catalog publishes no manual for answers 404."
      operationId: getRegulatorySubscriptionManual
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      responses:
        "200":
          content:
            text/markdown; charset=utf-8:
              schema:
                description: The document's manual, as the catalog publishes it.
                type: string
          description: OK
          headers:
            Content-Type:
              schema:
                description: Media type of the manual.
                examples:
                  - text/markdown; charset=utf-8
                type: string
            X-Document-Version:
              schema:
                description: The adopted version this manual explains.
                examples:
                  - 1.0.0
                type: string
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Read the manual of the version this subscription files
      tags:
        - Regulatory Catalog
      x-mint:
        href: /pt/reference/products/reporter/read-the-manual-of-the-version-this-subscription-files
  /v1/regulatory/subscriptions/{subscriptionId}/reactivate:
    post:
      description: "Switches a deactivated subscription back on, with the mapping the tenant edited and the version they adopted exactly as they were left — the way back that subscribing again is not, since that starts a new subscription from the catalog's reference mapping. Records who reactivated it and when. Refused with a conflict while ANOTHER subscription of the same document is active: a document is filed by one subscription at a time, and the refusal names the one holding the slot. Reactivating a subscription that is already active answers it unchanged."
      operationId: reactivateRegulatorySubscription
      parameters:
        - description: Unique subscription identifier.
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: subscriptionId
          required: true
          schema:
            description: Unique subscription identifier.
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: OK
          headers:
            ETag:
              schema:
                description: Version of the subscription; present it as If-Match to set its institution.
                examples:
                  - "\"2\""
                type: string
        "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
      summary: Reactivate a deactivated subscription
      tags:
        - Regulatory Subscriptions
      x-mint:
        href: /pt/reference/products/reporter/reactivate-subscription
  /v1/reports:
    get:
      description: Returns reports, narrowed by the published filters and paginated by cursor. Follow nextCursor to read the next page and prevCursor to read the previous one; a cursor is absent when there is no page in that direction.
      operationId: listReports
      parameters:
        - description: "Report status: Processing, Finished, Partial, Error, Draft or Final. Draft and Final belong to the regulatory cycle: a Draft is generated and still editable, a Final was approved."
          example: Finished
          in: query
          name: status
          schema:
            type: string
        - description: Template UUID; templateId is also accepted
          example: 00000000-0000-0000-0000-000000000000
          in: query
          name: template_id
          schema:
            format: uuid
            type: string
        - description: Curated document the report files, for regulatory reports; documentId is also accepted
          example: br.bcb.cadoc-4010
          in: query
          name: document_id
          schema:
            type: string
        - description: Regulatory subscription the report files under; subscriptionId is also accepted
          example: 00000000-0000-0000-0000-000000000000
          in: query
          name: subscription_id
          schema:
            format: uuid
            type: string
        - description: Institution the report read for, as frozen on it when it was requested; a report that read for no institution, or for every one, is left out. institutionId is also accepted
          example: 00000000-0000-0000-0000-000000000000
          in: query
          name: institution_id
          schema:
            format: uuid
            type: string
        - description: true lists only regulatory filings (reports that record a document), false only operational reports
          example: "true"
          in: query
          name: regulatory
          schema:
            enum:
              - "true"
              - "false"
            type: string
        - description: "true lists only the generation of each filing period that stands: a filing that is not Final is left out when a newer Draft or Final of the same subscription, dataBase and tipoRemessa exists. A Final is never left out. Accepted only on a list of filings (regulatory=true, document_id or subscription_id); every filing on such a list also carries supersededBy when something newer stands in its place"
          example: "true"
          in: query
          name: current
          schema:
            enum:
              - "true"
              - "false"
            type: string
        - description: Creation date in YYYY-MM-DD format; createdAt is also accepted
          example: "2026-01-31"
          in: query
          name: created_at
          schema:
            format: date
            type: string
        - description: Sort order. Applies when starting a walk; a cursor carries the order it was cut in, so it need not be repeated. Sending an order that disagrees with the cursor is refused.
          example: desc
          in: query
          name: sort_order
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
        - description: Opaque cursor from a previous response's nextCursor or prevCursor. Omit for the first page. It carries the sort order of the walk it belongs to, so following it resumes that walk.
          example: eyJ0IjoiMjAyNi0wMS0zMVQxNTowMDowMFoiLCJpIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAxIn0
          in: query
          name: cursor
          schema:
            type: string
        - description: Maximum reports per page
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListReportsHumaOutputBody"
          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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List reports
      tags:
        - Reports
      x-mint:
        href: /pt/reference/products/reporter/retrieve-reports
    post:
      description: Creates a report from an existing template and dispatches its generation.
      operationId: createReport
      parameters:
        - description: Client-provided idempotency key that prevents duplicate report creation
          example: report-request-2026-01
          in: header
          name: X-Idempotency
          schema:
            description: Client-provided idempotency key that prevents duplicate report creation
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                filters:
                  additionalProperties:
                    additionalProperties:
                      additionalProperties:
                        $ref: "#/components/schemas/FilterCondition"
                      type: object
                    type: object
                  description: Filter conditions grouped by data source, table, and field.
                  examples:
                    - accounts:
                        account:
                          status:
                            eq:
                              - ACTIVE
                  type: object
                institution:
                  description: "The institution the report reads for: an institution id, or \"all\" to read every institution's rows in one report. Absent, a tenant with no institution reads everything, a tenant with one takes it, and a tenant with several is refused."
                  examples:
                    - 00000000-0000-0000-0000-000000000000
                  type: string
                parameters:
                  additionalProperties:
                    type: string
                  description: Generation parameters keyed by parameter name, answering what the template declares. A parameter the template does not declare is refused; a declared one that is required and absent is refused unless it carries a default. At most 50 parameters, each value at most 512 characters.
                  examples:
                    - dataBase: 2026-08
                  maxProperties: 50
                  type: object
                templateId:
                  description: Template identifier used to generate the report.
                  examples:
                    - 00000000-0000-0000-0000-000000000000
                  type: string
              required:
                - filters
                - templateId
              type: object
        description: Report input
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportResponse"
          description: Created
          headers:
            X-Idempotency-Replayed:
              schema:
                description: Set to true when the response replays a completed idempotent request
                type:
                  - string
                  - "null"
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      summary: Create a report
      tags:
        - Reports
      x-mint:
        href: /pt/reference/products/reporter/create-report
  /v1/reports/{id}:
    get:
      description: Returns report information for the given ID.
      operationId: getReport
      parameters:
        - description: Report ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Report ID
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get a report
      tags:
        - Reports
      x-mint:
        href: /pt/reference/products/reporter/check-report-status
  /v1/reports/{id}/download:
    get:
      description: Downloads the generated report file.
      operationId: downloadReport
      parameters:
        - description: Report ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Report ID
            type: string
      responses:
        "200":
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/xml:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            text/csv:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            text/html:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            text/plain:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Generated report file
          headers:
            Content-Disposition:
              schema:
                description: Attachment filename
                type: string
            Content-Type:
              schema:
                description: Generated report media type
                type: string
            X-Report-Status:
              schema:
                description: "Status of the report this file belongs to: a Draft is under review, a Final is the approved filing."
                examples:
                  - Draft
                type: string
        "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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
      summary: Download a report
      tags:
        - Reports
      x-mint:
        href: /pt/reference/products/reporter/download-report
  /v1/streaming/events:
    get:
      description: Returns the static catalog of business events Reporter can publish without disclosing broker topology.
      operationId: getStreamingEvents
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StreamingManifestHumaResponse"
          description: OK
          headers:
            Cache-Control:
              schema:
                description: Prevents intermediaries and clients from storing the manifest response.
                examples:
                  - no-store
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get the streaming event manifest
      tags:
        - Streaming
      x-mint:
        href: /pt/reference/products/reporter/get-streaming-events
  /v1/templates:
    get:
      description: Returns templates using the existing filter and pagination semantics.
      operationId: listTemplates
      parameters:
        - description: Template output format; outputFormat is also accepted
          example: HTML
          in: query
          name: output_format
          schema:
            type: string
        - description: Case-insensitive substring match on the template description
          example: payroll
          in: query
          name: description
          schema:
            type: string
        - description: Creation date in YYYY-MM-DD format; createdAt is also accepted
          example: "2026-01-31"
          in: query
          name: created_at
          schema:
            format: date
            type: string
        - description: Returns only templates whose mapped fields reference this data source name; dataSourceName is also accepted. Held to the same grammar every registrable data source name is held to, ^[a-zA-Z0-9_-]{1,100}$ — letters, digits, underscores and hyphens only, at most 100 characters. A dotted, operator-shaped, empty, or over-long value is refused as an invalid query parameter.
          example: midaz_onboarding
          in: query
          name: data_source_name
          schema:
            type: string
        - description: "Returns only templates filed under this report family. The value is normalised the same way it is on write, so the case you type does not matter: category=CADOC and category=cadoc return the same templates. A blank value is no filter at all; the words 'null' and 'nil' are family names like any other."
          example: cadoc
          in: query
          name: category
          schema:
            type: string
        - description: Tri-state. Omit it to narrow by nothing. has_category=false returns only templates with NO family — both those stored before the field existed and those carrying an empty one — which is how the templates still needing a family are found; combine it with limit=1 and read `total` to count them. has_category=true is the exact complement. The only accepted values are true and false; anything else is refused as an invalid query parameter.
          example: "false"
          in: query
          name: has_category
          schema:
            type: string
        - description: Sort order by creation time; sortOrder is also accepted
          example: desc
          in: query
          name: sort_order
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
        - description: Page size; parsed by the domain query validator
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            type: integer
        - description: Page number; parsed by the domain query validator
          example: 1
          in: query
          name: page
          schema:
            default: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTemplatesHumaOutputBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List templates
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/list-templates
    post:
      description: Creates a report template from a multipart form upload.
      operationId: createTemplate
      parameters:
        - description: Client-provided idempotency key that prevents duplicate template creation
          example: template-request-2026-01
          in: header
          name: X-Idempotency
          schema:
            description: Client-provided idempotency key that prevents duplicate template creation
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                category:
                  description: "Report family this template belongs to — what a consumer routes by. Held to the grammar ^[a-z0-9_-]{1,100}$ AFTER normalisation: lower-case letters, digits, underscores and hyphens, at most 100 characters. Case and surrounding spaces are corrected, so 'CADOC' and ' cadoc ' are both stored as 'cadoc'; a space inside the value, a dot, a slash or an accent is refused rather than rewritten. Required on create. On update it is required only when the template does not already have a category — one that already carries a category keeps it and need not repeat it, which is why the update operation does not list this field as required."
                  examples:
                    - cadoc
                  pattern: ^[a-z0-9_-]{1,100}$
                  type: string
                description:
                  description: Human-readable template description
                  examples:
                    - Monthly financial report
                  type: string
                outputFormat:
                  description: Generated report output format
                  examples:
                    - html
                  type: string
                template:
                  contentMediaType: application/octet-stream
                  description: Pongo2 template file
                  examples:
                    - monthly-report.tpl
                  format: binary
                  type: string
              required:
                - category
                - description
                - outputFormat
                - template
              type: object
        description: Template multipart form
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateResponse"
          description: Created
          headers:
            X-Idempotency-Replayed:
              schema:
                description: Set to true when the response replays a completed idempotent request
                examples:
                  - "true"
                type:
                  - string
                  - "null"
        "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
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Create a template
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/upload-template
  /v1/templates/blocks-config:
    get:
      description: Returns the block definitions supported by the template builder.
      operationId: getTemplateBlocksConfig
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BlocksConfigResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get template block configuration
      tags:
        - Template Builder
      x-mint:
        href: /pt/reference/products/reporter/list-block-definitions
  /v1/templates/categories:
    get:
      description: "Returns every report family that has at least one live template, sorted by name, with the number of templates filed under each. This endpoint does NOT paginate and refuses page, limit and cursor: it answers with the set of families rather than with a page of the templates collection, and its consumer needs the whole set — a paginated family selector would make an operator page through it to discover that a family already exists, which is the discovery they need to make before creating a duplicate. When the answer reaches the ceiling it is cut and `truncated` says so."
      operationId: listTemplateCategories
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTemplateCategoriesHumaOutputBody"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: List the report families in use
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/list-report-families
  /v1/templates/category:
    patch:
      description: "Associates ONE family with many templates in a single call — the shape of the work when templates stored before families existed are filed one CADOC at a time. It is not all-or-nothing: it applies to the ids that match a live template, and answers with `matched` and `modified` so the caller learns that some of what it sent did not exist or was deleted. An id naming a soft-deleted template does not match and is not resurrected. Sending the same body twice is safe and answers `modified: 0` the second time."
      operationId: updateTemplateCategories
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTemplateCategoriesHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateTemplateCategoriesHumaOutputBody"
          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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: File many templates under one report family
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/assign-report-family
  /v1/templates/filters:
    get:
      description: Returns the filters supported by the template builder.
      operationId: getTemplateFilters
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FiltersResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get template filters
      tags:
        - Template Builder
      x-mint:
        href: /pt/reference/products/reporter/list-filter-definitions
  /v1/templates/generate-code:
    post:
      description: Converts template-builder blocks into Pongo2 template code and mapped fields.
      operationId: generateTemplateCode
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GenerateCodeInput"
        description: Template blocks and target output format.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenerateCodeResponse"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Generate template code
      tags:
        - Template Builder
      x-mint:
        href: /pt/reference/products/reporter/generate-template-code
  /v1/templates/preview:
    post:
      description: Renders template markup against caller-supplied sample data and returns the output, without creating a template or generating a report. A Pdf template previews as the HTML stage that would feed the PDF engine. The whole request body is capped at 3211264 bytes and a larger one is refused with 413 before it is parsed; content and sampleData carry their own ceilings.
      operationId: previewTemplate
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PreviewTemplateInput"
        description: Template markup and the sample data to render it against.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PreviewTemplateResult"
          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
        "413":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Request Entity Too Large
        "429":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Too Many Requests
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Preview a template
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/preview-template
  /v1/templates/validate:
    post:
      description: Validates template-builder blocks and returns semantic validation errors.
      operationId: validateTemplateBlocks
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ValidateBlocksInput"
        description: Template blocks to validate.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidateBlocksResponse"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Validate template blocks
      tags:
        - Template Builder
      x-mint:
        href: /pt/reference/products/reporter/validate-template-blocks
  /v1/templates/{id}:
    delete:
      description: Deletes the template identified by the given ID.
      operationId: deleteTemplate
      parameters:
        - description: Template ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Template ID
            type: string
      responses:
        "204":
          description: No Content
        "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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Delete a template
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/delete-template
    get:
      description: Returns template information for the given ID, including the generation parameters the template declares.
      operationId: getTemplate
      parameters:
        - description: Template ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Template ID
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Template"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get a template
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/retrieve-template-details
    patch:
      description: Updates a template's file, output format, or description.
      operationId: updateTemplate
      parameters:
        - description: Template ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Template ID
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                category:
                  description: "Report family this template belongs to — what a consumer routes by. Held to the grammar ^[a-z0-9_-]{1,100}$ AFTER normalisation: lower-case letters, digits, underscores and hyphens, at most 100 characters. Case and surrounding spaces are corrected, so 'CADOC' and ' cadoc ' are both stored as 'cadoc'; a space inside the value, a dot, a slash or an accent is refused rather than rewritten. Required on create. On update it is required only when the template does not already have a category — one that already carries a category keeps it and need not repeat it, which is why the update operation does not list this field as required."
                  examples:
                    - cadoc
                  pattern: ^[a-z0-9_-]{1,100}$
                  type: string
                description:
                  description: Human-readable template description
                  examples:
                    - Monthly financial report
                  type: string
                outputFormat:
                  description: Generated report output format
                  examples:
                    - html
                  type: string
                template:
                  contentMediaType: application/octet-stream
                  description: Pongo2 template file
                  examples:
                    - monthly-report.tpl
                  format: binary
                  type: string
              type: object
        description: Template multipart form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateResponse"
          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
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Update a template
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/update-templates
  /v1/templates/{id}/content:
    get:
      description: Returns the stored source of a template, verbatim as it was uploaded, alongside the format it renders to. The content is bounded by whatever ceiling that deployment enforces on template upload. A stored file that is not valid UTF-8 is refused rather than returned repaired.
      operationId: getTemplateContent
      parameters:
        - description: Template ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Template ID
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateContent"
          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
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
      summary: Get a template's content
      tags:
        - Templates
      x-mint:
        href: /pt/reference/products/reporter/get-template-content
security:
  - BearerAuth: []
servers:
  - url: https://reporter.sandbox.lerian.net
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
