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

# Upload an evidence file to a dispute

> Streams an evidence file (pdf, png, jpeg, or csv) to tenant-scoped object storage and records the resulting object key on the dispute as a new evidence item. The comment arrives as a query parameter and the file bytes as the request body. The tenant is resolved from the JWT and the dispute from the path — never from the body. Fails closed (503) when object storage is not configured; rejects oversize bodies (413) and unsupported content types (415).



## OpenAPI

````yaml /pt/openapi/v3-current/matcher.yaml post /v1/disputes/{disputeId}/evidence/upload
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/disputes/{disputeId}/evidence/upload:
    post:
      tags:
        - Exception
      summary: Upload an evidence file to a dispute
      description: >-
        Streams an evidence file (pdf, png, jpeg, or csv) to tenant-scoped
        object storage and records the resulting object key on the dispute as a
        new evidence item. The comment arrives as a query parameter and the file
        bytes as the request body. The tenant is resolved from the JWT and the
        dispute from the path — never from the body. Fails closed (503) when
        object storage is not configured; rejects oversize bodies (413) and
        unsupported content types (415).
      operationId: uploadEvidence
      parameters:
        - description: Dispute ID (UUID)
          in: path
          name: disputeId
          required: true
          schema:
            description: Dispute ID (UUID)
            examples:
              - 550e8400-e29b-41d4-a716-446655440001
            format: uuid
            type: string
        - description: Comment describing the uploaded evidence
          explode: false
          in: query
          name: comment
          schema:
            description: Comment describing the uploaded evidence
            examples:
              - Bank statement showing correct amount
            maxLength: 1000
            minLength: 1
            type: string
        - description: >-
            Evidence media type: application/pdf, image/png, image/jpeg, or
            text/csv
          in: header
          name: Content-Type
          schema:
            description: >-
              Evidence media type: application/pdf, image/png, image/jpeg, or
              text/csv
            examples:
              - application/pdf
            type: string
      requestBody:
        content:
          application/octet-stream:
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisputeResponse'
          description: Created
        '400':
          description: The request contains invalid parameters or payload.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                400-evidence-comment-is-required:
                  $ref: '#/components/examples/400-evidence-comment-is-required'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: The requested resource was not found.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0502-dispute-not-found:
                  $ref: '#/components/examples/mtch-0502-dispute-not-found'
        '413':
          description: The file is larger than 10 MiB.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                413-request-body-is-too-large-limit-10485760-bytes:
                  $ref: >-
                    #/components/examples/413-request-body-is-too-large-limit-10485760-bytes
        '415':
          description: >-
            The `Content-Type` header is not `application/pdf`, `image/png`,
            `image/jpeg`, or `text/csv`.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                415-evidence-file-content-type-is-not-supported:
                  $ref: >-
                    #/components/examples/415-evidence-file-content-type-is-not-supported
        '422':
          description: The request was well-formed but contains semantic errors.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0006-add-evidence-cannot-add-evidence-in-current-state:
                  $ref: >-
                    #/components/examples/mtch-0006-add-evidence-cannot-add-evidence-in-current-state
                422-validation-failed:
                  $ref: '#/components/examples/422-validation-failed'
        '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-0019-internal-error:
                  $ref: '#/components/examples/mtch-0019-internal-error'
      security:
        - BearerAuth: []
components:
  schemas:
    DisputeResponse:
      additionalProperties: false
      properties:
        category:
          description: >-
            Dispute category: BANK_FEE_ERROR (incorrect fee),
            UNRECOGNIZED_CHARGE, DUPLICATE_TRANSACTION, AMOUNT_MISMATCH, or
            OTHER
          enum:
            - BANK_FEE_ERROR
            - UNRECOGNIZED_CHARGE
            - DUPLICATE_TRANSACTION
            - AMOUNT_MISMATCH
            - OTHER
          examples:
            - BANK_FEE_ERROR
          type: string
        createdAt:
          description: Creation timestamp as an RFC 3339 timestamp
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
        description:
          description: Description of the dispute
          examples:
            - Transaction amount differs from expected
          type: string
        evidence:
          description: Evidence items submitted for this dispute (max 50)
          items:
            $ref: '#/components/schemas/EvidenceResponse'
          maxItems: 50
          type:
            - array
            - 'null'
        exceptionId:
          description: Identifier of the exception this dispute is for (UUID)
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        id:
          description: Unique identifier for the dispute (UUID)
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        openedBy:
          description: User who opened the dispute
          examples:
            - user@example.com
          type: string
        reopenReason:
          description: Reason recorded when the dispute was reopened
          examples:
            - New evidence discovered
          type: string
        resolution:
          description: Resolution description recorded when the dispute was closed
          examples:
            - Counterparty confirmed error
          type: string
        state:
          description: >-
            Dispute state: DRAFT, OPEN, PENDING_EVIDENCE (awaiting evidence),
            WON, or LOST
          enum:
            - DRAFT
            - OPEN
            - PENDING_EVIDENCE
            - WON
            - LOST
          examples:
            - OPEN
          type: string
        updatedAt:
          description: Last update timestamp as an RFC 3339 timestamp
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
      required:
        - id
        - exceptionId
        - category
        - state
        - description
        - openedBy
        - 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
    EvidenceResponse:
      additionalProperties: false
      properties:
        comment:
          description: Comment describing the evidence
          examples:
            - Bank statement attached
          type: string
        disputeId:
          description: Identifier of the dispute this evidence belongs to (UUID)
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        fileUrl:
          description: Optional URL to the evidence file
          examples:
            - https://storage.example.com/evidence/doc123.pdf
          type: string
        id:
          description: Unique identifier for the evidence (UUID)
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        submittedAt:
          description: Submission timestamp as an RFC 3339 timestamp
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
        submittedBy:
          description: User who submitted the evidence
          examples:
            - user@example.com
          type: string
      required:
        - id
        - disputeId
        - comment
        - submittedBy
        - submittedAt
      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-evidence-comment-is-required:
      summary: Evidence comment is required
      value:
        type: https://errors.lerian.studio/v1/MTCH-0001
        title: Bad Request
        status: 400
        detail: Evidence requires a comment; add one before submitting.
        code: MTCH-0001
    mtch-0502-dispute-not-found:
      summary: Dispute not found
      value:
        type: https://errors.lerian.studio/v1/MTCH-0502
        title: Not Found
        status: 404
        detail: No dispute matches this id. Check the dispute id and try again.
        code: MTCH-0502
    413-request-body-is-too-large-limit-10485760-bytes:
      summary: Request body is too large
      value:
        title: Request Entity Too Large
        status: 413
        detail: request body is too large limit=10485760 bytes
    415-evidence-file-content-type-is-not-supported:
      summary: Evidence file content type is not supported
      value:
        title: Unsupported Media Type
        status: 415
        detail: >-
          Evidence files must be a PDF, PNG, JPEG or CSV, and this one is not;
          nothing was attached to this dispute. Convert the file to a supported
          format and upload it again.
    mtch-0006-add-evidence-cannot-add-evidence-in-current-state:
      summary: 'Add evidence: cannot add evidence in current state'
      value:
        type: https://errors.lerian.studio/v1/MTCH-0006
        title: Unprocessable Entity
        status: 422
        detail: >-
          Evidence can only be added to a dispute that is open or waiting on
          evidence; check the dispute's current status before submitting
          evidence
        code: MTCH-0006
    422-validation-failed:
      summary: Validation failed
      value:
        title: Unprocessable Entity
        status: 422
        detail: validation failed
    mtch-0019-internal-error:
      summary: Service Unavailable
      value:
        type: https://errors.lerian.studio/v1/MTCH-0019
        title: Service Unavailable
        status: 503
        detail: >-
          Object storage is unavailable; retry after storage recovers, or ask an
          administrator to configure storage if the failure continues.
        code: MTCH-0019
  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
    Forbidden:
      description: You do not have permission to access this resource.
      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
            PermissionDenied:
              summary: Permission denied
              value:
                type: https://errors.lerian.studio/v1/AUT-1020
                title: Permission Denied
                status: 403
                detail: >-
                  the credential is not allowed to perform contexts:read on this
                  request
                code: AUT-1020
    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.