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

# Reject an AI match-rule suggestion (discard it)

> Rejects a PENDING_REVIEW suggestion — nothing is created. The rejecting principal is recorded for audit. Tenant from the JWT, context from the path.



## OpenAPI

````yaml /pt/openapi/v3-current/matcher.yaml post /v1/matching/contexts/{contextId}/rule-suggestions/{suggestionId}/reject
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: 6.1.0
  license:
    name: Lerian Studio General License
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/matching/contexts/{contextId}/rule-suggestions/{suggestionId}/reject:
    post:
      tags:
        - Matching
      summary: Reject an AI match-rule suggestion (discard it)
      description: >-
        Rejects a PENDING_REVIEW suggestion — nothing is created. The rejecting
        principal is recorded for audit. Tenant from the JWT, context from the
        path.
      operationId: rejectMatchRuleSuggestion
      parameters:
        - description: Context ID
          in: path
          name: contextId
          required: true
          schema:
            description: Context ID
            format: uuid
            type: string
        - description: Suggestion ID
          in: path
          name: suggestionId
          required: true
          schema:
            description: Suggestion ID
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectRuleSuggestionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleSuggestionResponse'
          description: OK
        '400':
          description: The request contains invalid parameters or payload.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                400-validation-failed:
                  $ref: '#/components/examples/400-validation-failed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            You do not have permission to access this resource, or the context
            is not active.
          content:
            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
                mtch-0012-context-is-not-active:
                  $ref: '#/components/examples/mtch-0012-context-is-not-active'
        '404':
          description: The requested resource was not found.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0005-context-not-found:
                  $ref: '#/components/examples/mtch-0005-context-not-found'
                mtch-0005-rule-suggestion-not-found:
                  $ref: '#/components/examples/mtch-0005-rule-suggestion-not-found'
        '409':
          description: The request conflicts with the current state of the resource.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0413-rejecting-rule-suggestion-invalid-rule-suggestion-review-sta:
                  $ref: >-
                    #/components/examples/mtch-0413-rejecting-rule-suggestion-invalid-rule-suggestion-review-sta
                mtch-0413-persisting-rejected-review-update-rule-suggestion-review-rul:
                  $ref: >-
                    #/components/examples/mtch-0413-persisting-rejected-review-update-rule-suggestion-review-rul
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          description: The service is temporarily unavailable. Please try again later.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0410-internal-error:
                  $ref: '#/components/examples/mtch-0410-internal-error'
      security:
        - BearerAuth: []
components:
  schemas:
    RejectRuleSuggestionRequest:
      additionalProperties: false
      properties:
        reason:
          description: Optional rejection reason
          examples:
            - too aggressive
          maxLength: 1000
          type: string
      type: object
    RuleSuggestionResponse:
      additionalProperties: false
      properties:
        candidate:
          $ref: '#/components/schemas/RuleSuggestionCandidateResponse'
          description: The config-only proposed match rule
        contextId:
          description: Reconciliation context ID this suggestion belongs to
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        createdAt:
          description: When the review was created (RFC 3339)
          examples:
            - '2026-06-16T10:30:00Z'
          type: string
        createdRuleId:
          description: >-
            Identifier of the match rule created on approval; empty until an
            approved review is linked
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        id:
          description: Unique identifier for the review
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        rejectReason:
          description: Optional reason recorded when the suggestion is rejected
          examples:
            - too aggressive
          type: string
        reviewerId:
          description: >-
            Principal id of the reviewer; empty until the suggestion is
            adjudicated
          examples:
            - user-42
          type: string
        status:
          description: >-
            Lifecycle status: PENDING_REVIEW (awaiting human decision), APPROVED
            (rule created), or REJECTED (discarded)
          enum:
            - PENDING_REVIEW
            - APPROVED
            - REJECTED
          examples:
            - PENDING_REVIEW
          type: string
        updatedAt:
          description: When the review was last updated (RFC 3339)
          examples:
            - '2026-06-16T10:35:00Z'
          type: string
        version:
          description: Optimistic-concurrency version of the review
          examples:
            - 1
          format: int64
          type: integer
      required:
        - id
        - contextId
        - candidate
        - status
        - version
        - createdAt
        - updatedAt
      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
    RuleSuggestionCandidateResponse:
      additionalProperties: false
      properties:
        confidence:
          description: >-
            Advisor confidence in the suggestion, from 0.0 (lowest) to 1.0
            (highest)
          examples:
            - 0.82
          format: double
          type: number
        config:
          additionalProperties: {}
          description: >-
            Per-type rule configuration over the closed schema; the shape
            depends on the candidate type
          type: object
        expectedImprovement:
          description: >-
            Advisory note on the expected auto-match-rate effect; never a
            monetary figure
          examples:
            - +8% auto-match
          type: string
        priority:
          description: Proposed rule priority in the range 1..1000 (lower runs first)
          examples:
            - 10
          format: int64
          type: integer
        rationale:
          description: Short human-readable rationale for the suggestion
          examples:
            - near-miss amounts cluster under 1%
          type: string
        type:
          description: >-
            Proposed rule type from the closed vocabulary: EXACT (strict
            equality), TOLERANCE (within an amount band), or DATE_LAG (allowing
            a settlement-date offset). FUZZY is excluded on purpose: a fuzzy
            rule only ever proposes graded-confidence links a human must review,
            so an operator configures one deliberately rather than accepting it
            from a suggestion
          enum:
            - EXACT
            - TOLERANCE
            - DATE_LAG
          examples:
            - TOLERANCE
          type: string
      required:
        - type
        - priority
        - config
        - rationale
        - confidence
      type: object
    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
    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
  examples:
    400-validation-failed:
      summary: Validation failed
      value:
        title: Bad Request
        status: 400
        detail: validation failed
        errors:
          - message: unexpected end of JSON input
            location: body
            value: '{'
    mtch-0012-context-is-not-active:
      summary: Context is not active
      value:
        type: https://errors.lerian.studio/v1/MTCH-0012
        title: Forbidden
        status: 403
        detail: context is not active
        code: MTCH-0012
    mtch-0005-context-not-found:
      summary: Context not found
      value:
        type: https://errors.lerian.studio/v1/MTCH-0005
        title: Not Found
        status: 404
        detail: >-
          No reconciliation context matches this id; check the context id and
          try again.
        code: MTCH-0005
    mtch-0005-rule-suggestion-not-found:
      summary: Rule suggestion not found
      value:
        type: https://errors.lerian.studio/v1/MTCH-0005
        title: Not Found
        status: 404
        detail: >-
          The rule suggestion could not be found; the decision was not applied.
          Check the suggestion id and try again.
        code: MTCH-0005
    mtch-0413-rejecting-rule-suggestion-invalid-rule-suggestion-review-sta:
      summary: >-
        Rejecting rule suggestion: invalid rule suggestion review status
        transition:...
      value:
        type: https://errors.lerian.studio/v1/MTCH-0413
        title: Conflict
        status: 409
        detail: >-
          This rule suggestion cannot move to the requested status from its
          current status; the decision was not applied. Refresh the suggestion
          and retry a valid transition.
        code: MTCH-0413
    mtch-0413-persisting-rejected-review-update-rule-suggestion-review-rul:
      summary: >-
        Persisting rejected review: update rule suggestion review: rule
        suggestion...
      value:
        type: https://errors.lerian.studio/v1/MTCH-0413
        title: Conflict
        status: 409
        detail: >-
          This rule suggestion was changed by another request just now; the
          decision was not applied. Refresh the suggestion and retry.
        code: MTCH-0413
    mtch-0410-internal-error:
      summary: Service Unavailable
      value:
        type: https://errors.lerian.studio/v1/MTCH-0410
        title: Service Unavailable
        status: 503
        detail: >-
          Rule suggestions are not configured on this deployment; author match
          rules manually or ask an administrator to enable rule suggestions.
        code: MTCH-0410
  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/AUT-0006
                title: Token Missing
                status: 401
                detail: >-
                  A valid token must be provided in the request header. Please
                  include a token and try again.
                code: AUT-0006
            InvalidToken:
              summary: Invalid token
              value:
                type: https://errors.lerian.studio/v1/AUT-0007
                title: Invalid Token
                status: 401
                detail: >-
                  The provided token is expired, invalid or malformed. Please
                  provide a valid token and try again.
                code: AUT-0007
    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.