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

# Replace the mapping

> 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.



## OpenAPI

````yaml /es/openapi/v3-current/reporter.yaml put /v1/regulatory/subscriptions/{subscriptionId}/binding
openapi: 3.1.0
info:
  contact:
    name: Discord community
    url: https://discord.gg/DnhqKwkGv3
  description: >-
    This is OpenAPI documentation for Reporter. The unified reporter binary
    serves the REST API (RUN_MODE=api) and/or the RabbitMQ report-generation
    worker (RUN_MODE=worker); RUN_MODE=all runs both in one process for local
    development. All REST endpoints documented here serve only when RUN_MODE=api
    or all (port :4005); the worker (port :4006) exposes health/readyz/version
    only.
  license:
    name: Lerian Studio General License
  title: Midaz Reporter API
  version: 4.0.0
servers:
  - url: http://localhost:4005
  - url: https://localhost:4005
security:
  - BearerAuth: []
tags:
  - description: Generated report instances and their lifecycle.
    name: Reports
  - description: Reusable report definitions.
    name: Templates
  - description: Interactive construction of report templates.
    name: Template Builder
  - description: Scheduled report due-date tracking.
    name: Deadlines
  - description: Configured inputs that feed report data.
    name: Data Sources
  - description: Aggregated reporting metrics.
    name: Metrics
  - description: Published business event catalog and delivery policies.
    name: Streaming
paths:
  /v1/regulatory/subscriptions/{subscriptionId}/binding:
    put:
      tags:
        - Regulatory Bindings
      summary: Replace the mapping
      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
components:
  schemas:
    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
    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
    Readiness:
      additionalProperties: false
      properties:
        contractVersion:
          type: string
        document:
          type: string
        gaps:
          items:
            $ref: '#/components/schemas/Gap'
          type:
            - array
            - 'null'
        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
    ErrorDetail:
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          examples:
            - body.templateId
          type: string
        message:
          description: Error message text
          examples:
            - expected string to match 'uuid' format
          type: string
        value:
          description: The value at the given location
          examples:
            - not-a-uuid
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
    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
    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
        query:
          type: string
        resolvedTable:
          type: string
        status:
          type: string
        table:
          type: string
      required:
        - query
        - status
        - columnsChecked
      type: object
    ColumnReadiness:
      additionalProperties: false
      properties:
        column:
          type: string
        found:
          type: boolean
      required:
        - column
        - found
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````