> ## 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 extraction review (discard the candidates)

> Rejects a PENDING_REVIEW review and discards its candidates — nothing is ingested or reconciled. The rejecting principal is recorded for audit. Tenant from the JWT, context from the path.



## OpenAPI

````yaml en/openapi/v3-current/matcher.yaml post /v1/imports/contexts/{contextId}/extraction-reviews/{reviewId}/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: 4.1.0
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/imports/contexts/{contextId}/extraction-reviews/{reviewId}/reject:
    post:
      tags:
        - Ingestion
      summary: Reject an AI extraction review (discard the candidates)
      description: >-
        Rejects a PENDING_REVIEW review and discards its candidates — nothing is
        ingested or reconciled. The rejecting principal is recorded for audit.
        Tenant from the JWT, context from the path.
      operationId: rejectExtractionReview
      parameters:
        - description: Context ID
          in: path
          name: contextId
          required: true
          schema:
            description: Context ID
            format: uuid
            type: string
        - description: Review ID
          in: path
          name: reviewId
          required: true
          schema:
            description: Review ID
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectExtractionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionReviewResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    RejectExtractionRequest:
      additionalProperties: false
      properties:
        reason:
          description: Optional free-text reason for the rejection
          examples:
            - poor scan quality, re-upload
          type: string
      type: object
    ExtractionReviewResponse:
      additionalProperties: false
      properties:
        candidates:
          description: Proposed transaction candidates awaiting review
          items:
            $ref: '#/components/schemas/CandidateResponse'
          type:
            - array
            - 'null'
        contextId:
          description: Reconciliation context the candidates belong to
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        createdAt:
          description: Creation timestamp (RFC 3339, UTC)
          examples:
            - '2025-01-15T10:30:00Z'
          format: date-time
          type: string
        id:
          description: Review identifier
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        ingestionJobId:
          description: Downstream ingestion job linked on approval; null until linked
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        rejectReason:
          description: Free-text reason captured on rejection; empty otherwise
          type: string
        reviewerId:
          description: >-
            Principal id of the human who adjudicated the review; empty until
            decided
          type: string
        sourceId:
          description: Reconciliation source the candidates belong to
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        status:
          description: >-
            Review lifecycle: PENDING_REVIEW (awaiting decision), APPROVED
            (candidates ingested), REJECTED (discarded)
          examples:
            - PENDING_REVIEW
          type: string
        updatedAt:
          description: Last-update timestamp (RFC 3339, UTC)
          examples:
            - '2025-01-15T10:35:00Z'
          format: date-time
          type: string
        version:
          description: Optimistic-concurrency version, incremented on each state change
          examples:
            - 1
          format: int64
          type: integer
      required:
        - id
        - contextId
        - sourceId
        - status
        - candidates
        - 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
      type: object
    CandidateResponse:
      additionalProperties: false
      properties:
        fields:
          description: Per-field breakdown with verbatim tokens, confidence, and provenance
          items:
            $ref: '#/components/schemas/CandidateFieldResponse'
          type:
            - array
            - 'null'
        source:
          description: >-
            Extraction lane that produced this candidate: text_layer (PDF text,
            higher trust) or vision (OCR/vision model, lower trust)
          examples:
            - text_layer
          type: string
      required:
        - source
        - fields
      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
    CandidateFieldResponse:
      additionalProperties: false
      properties:
        canonicalKey:
          description: Canonical field-map key (e.g. amount, external_id, currency, date)
          examples:
            - amount
          type: string
        confidence:
          description: Extractor confidence in this field, 0.0 (none) to 1.0 (certain)
          examples:
            - 0.95
          format: double
          maximum: 1
          minimum: 0
          type: number
        page:
          description: 1-based page the value was extracted from; 0 when unknown
          examples:
            - 1
          format: int64
          type: integer
        region:
          description: >-
            Best-effort region/bounding-box descriptor; empty when the source
            lane does not expose it
          type: string
        value:
          description: >-
            Verbatim string token extracted for the canonical key; money stays a
            string, never a parsed amount
          examples:
            - '100.50'
          type: string
      required:
        - canonicalKey
        - value
        - confidence
        - page
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````