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

# Verify audit log chain integrity

> Re-verifies the calling tenant's audit hash chain and returns a structured verdict (intact, verified count, and the first broken tenant_seq when a break is found). The check is strictly read-only: it recomputes nothing into storage and never mutates an audit record. Use the optional maxRecords query parameter to bound how many records are inspected. Use the optional fromSeq query parameter to start the check at that tenant_seq. When the first record the check reads is not sequence 1, the check trusts that record's stored link. It does not verify the records before it. The verdict always echoes the effective fromSeq.



## OpenAPI

````yaml /pt/openapi/v3-current/matcher.yaml get /v1/governance/audit-logs/verify
openapi: 3.1.0
info:
  title: Matcher APIs
  description: >-
    Complete API reference for the Matcher reconciliation engine, providing
    automated transaction matching between Midaz Ledger and external systems.
  version: 5.0.4
  license:
    name: Lerian Studio General License
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/governance/audit-logs/verify:
    get:
      tags:
        - Governance
      summary: Verify audit log chain integrity
      description: >-
        Re-verifies the calling tenant's audit hash chain and returns a
        structured verdict (intact, verified count, and the first broken
        tenant_seq when a break is found). The check is strictly read-only: it
        recomputes nothing into storage and never mutates an audit record. Use
        the optional maxRecords query parameter to bound how many records are
        inspected. Use the optional fromSeq query parameter to start the check
        at that tenant_seq. When the first record the check reads is not
        sequence 1, the check trusts that record's stored link. It does not
        verify the records before it. The verdict always echoes the effective
        fromSeq.
      operationId: verifyAuditLogChain
      parameters:
        - description: >-
            Maximum number of records to inspect; clamped to the server bound.
            Omit to use the default bound.
          explode: false
          in: query
          name: maxRecords
          schema:
            description: >-
              Maximum number of records to inspect; clamped to the server bound.
              Omit to use the default bound.
            format: int64
            maximum: 10000
            minimum: 1
            type: integer
        - description: >-
            Verification floor: the first record inspected is the one with this
            tenant_seq. Omit to start at the chain start (seq 1).
          explode: false
          in: query
          name: fromSeq
          schema:
            description: >-
              Verification floor: the first record inspected is the one with
              this tenant_seq. Omit to start at the chain start (seq 1).
            format: int64
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditChainVerificationResponse'
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    AuditChainVerificationResponse:
      additionalProperties: false
      properties:
        firstBrokenSeq:
          description: >-
            tenant_seq of the first record that failed verification; omitted
            when the chain is intact
          examples:
            - 0
          format: int64
          type: integer
        fromSeq:
          description: >-
            Effective verification floor: the first tenant_seq eligible for
            inspection.
          examples:
            - 1
          format: int64
          type: integer
        intact:
          description: >-
            True when every inspected record links to the previous one and
            matches its stored hash
          examples:
            - true
          type: boolean
        truncated:
          description: >-
            True when the chain has more records than the inspection bound
            allowed; the verdict then covers only a prefix
          examples:
            - false
          type: boolean
        verifiedCount:
          description: >-
            Number of records confirmed intact (full inspected count when
            intact, otherwise the count before the first break)
          examples:
            - 1024
          format: int64
          type: integer
      required:
        - intact
        - fromSeq
        - verifiedCount
        - truncated
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          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
          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
    ErrorResponse:
      description: >-
        Flat error body that Matcher returns when it refuses a request before
        the operation runs.
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Stable error code.
          example: MTCH-0003
        title:
          type: string
          description: HTTP status text.
          example: Unauthorized
        message:
          type: string
          description: Human-readable error message.
          example: missing authorization token
    RateLimitErrorResponse:
      description: >-
        Flat body that the rate limiter returns. `code` is the HTTP status as a
        number.
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: integer
          description: HTTP status code.
          example: 429
        title:
          type: string
          description: Error type.
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable error message.
          example: rate limit exceeded
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      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
  responses:
    Unauthorized:
      description: The request lacks valid authentication credentials.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          examples:
            MissingToken:
              summary: Missing token
              value:
                type: https://errors.lerian.studio/v1/MTCH-0003
                title: Unauthorized
                status: 401
                detail: missing authorization token
                code: MTCH-0003
            InvalidToken:
              summary: Invalid token
              value:
                type: https://errors.lerian.studio/v1/MTCH-0003
                title: Unauthorized
                status: 401
                detail: invalid authorization token
                code: MTCH-0003
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
        text/plain:
          schema:
            type: string
          example: Unauthorized
    Forbidden:
      description: You do not have permission to access this resource.
      content:
        text/plain:
          schema:
            type: string
          example: Forbidden
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          examples:
            TenantClaimRequired:
              summary: Tenant claim missing
              value:
                type: https://errors.lerian.studio/v1/MTCH-0004
                title: Forbidden
                status: 403
                detail: tenant claim required
                code: MTCH-0004
    ValidationFailed:
      description: >-
        The request failed validation. The `errors` list names each value that
        failed.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          example:
            title: Unprocessable Entity
            status: 422
            detail: validation failed
            errors:
              - message: expected required property name to be present
                location: body
    TooManyRequests:
      description: >-
        The request exceeded the rate limit. Wait the number of seconds in
        `Retry-After`, then retry.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
          example:
            code: 429
            title: rate_limit_exceeded
            message: rate limit exceeded
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          example:
            type: https://errors.lerian.studio/v1/MTCH-0002
            title: Internal Server Error
            status: 500
            detail: internal error
            code: MTCH-0002
        text/plain:
          schema:
            type: string
          example: Internal Server Error
  headers:
    RetryAfter:
      description: Seconds to wait before you retry.
      schema:
        type: integer
        example: 30
    XRateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
        example: 100
    XRateLimitRemaining:
      description: Requests left in the current window. Always `0` on a `429`.
      schema:
        type: integer
        example: 0
    XRateLimitReset:
      description: Unix time, in seconds, when the current window resets.
      schema:
        type: integer
        example: 1767225600
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'
      scheme: bearer
      type: http

````

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