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

# Process exception callback

> Use this endpoint to process a callback from an external system for a dispatched exception. This updates the exception status based on the external system resolution.



## OpenAPI

````yaml /pt/openapi/v3-current/matcher.yaml post /v1/exceptions/{exceptionId}/callback
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/exceptions/{exceptionId}/callback:
    post:
      tags:
        - Exception
      summary: Process exception callback
      description: >-
        Use this endpoint to process a callback from an external system for a
        dispatched exception. This updates the exception status based on the
        external system resolution.
      operationId: processCallback
      parameters:
        - description: The unique identifier of the exception.
          in: path
          name: exceptionId
          required: true
          schema:
            description: Exception ID (UUID)
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Opaque bearer token authenticating the external system
          in: header
          name: X-Callback-Token
          required: true
          schema:
            description: Opaque bearer token authenticating the external system
            type: string
        - description: Idempotency key for deduplication
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Idempotency key for deduplication
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessCallbackRequest'
        description: Callback payload from external system
        required: true
      responses:
        '200':
          description: Callback processed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessCallbackResponse'
        '400':
          description: The request contains invalid parameters or payload.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                400-invalid-dueat-format-expected-rfc3339:
                  $ref: >-
                    #/components/examples/400-invalid-dueat-format-expected-rfc3339
        '404':
          description: >-
            The callback token is not recognized, or the exception does not
            exist.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                404-not-found:
                  $ref: '#/components/examples/404-not-found'
                mtch-0501-exception-not-found:
                  $ref: '#/components/examples/mtch-0501-exception-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-0504-callback-is-already-being-processed:
                  $ref: >-
                    #/components/examples/mtch-0504-callback-is-already-being-processed
                mtch-0505-callback-can-be-retried:
                  $ref: '#/components/examples/mtch-0505-callback-can-be-retried'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          description: >-
            The external system sent more callbacks for the tenant in the
            current minute than the limit allows. Wait, then retry.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0506-callback-rate-limit-exceeded:
                  $ref: '#/components/examples/mtch-0506-callback-rate-limit-exceeded'
        '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:
                503-internal-error:
                  $ref: '#/components/examples/503-internal-error'
      security:
        - CallbackToken: []
components:
  schemas:
    ProcessCallbackRequest:
      additionalProperties: false
      properties:
        assignee:
          description: Assignee identifier (required when status is ASSIGNED)
          examples:
            - user@example.com
          type: string
        callbackType:
          description: Type of callback (e.g. status_update, assignment)
          examples:
            - status_update
          type: string
        dueAt:
          description: Due date for resolution as an RFC 3339 timestamp
          examples:
            - '2025-01-20T10:30:00Z'
          type:
            - string
            - 'null'
        externalIssueId:
          description: Issue ID in the external system
          examples:
            - RECON-1234
          minLength: 1
          type: string
        externalSystem:
          description: External system identifier (e.g. JIRA, SERVICENOW, WEBHOOK)
          examples:
            - JIRA
          minLength: 1
          type: string
        payload:
          additionalProperties: {}
          description: Arbitrary payload from the external system
          type: object
        resolutionNotes:
          description: Optional resolution notes
          examples:
            - Resolved by external agent
          type: string
        status:
          description: Target status for the exception (e.g. ASSIGNED, RESOLVED)
          examples:
            - RESOLVED
          minLength: 1
          type: string
        updatedAt:
          description: External system timestamp as an RFC 3339 timestamp
          examples:
            - '2025-01-15T10:30:00Z'
          type:
            - string
            - 'null'
      required:
        - callbackType
        - externalSystem
        - externalIssueId
        - status
        - resolutionNotes
        - assignee
        - dueAt
        - updatedAt
        - payload
      type: object
    ProcessCallbackResponse:
      additionalProperties: false
      properties:
        status:
          description: >-
            Processing status of the callback (the handler always returns
            "accepted" on success)
          examples:
            - accepted
          type: string
      required:
        - status
      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
    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
  examples:
    400-invalid-dueat-format-expected-rfc3339:
      summary: Invalid dueAt format, expected RFC3339
      value:
        title: Bad Request
        status: 400
        detail: invalid dueAt format, expected RFC3339
    404-not-found:
      summary: Not found
      value:
        type: https://errors.lerian.studio/v1/MTCH-0005
        title: Not Found
        status: 404
        detail: >-
          This callback token is not valid; ask an administrator to check the
          callback credential configured for this integration
        code: MTCH-0005
    mtch-0501-exception-not-found:
      summary: Exception not found
      value:
        type: https://errors.lerian.studio/v1/MTCH-0501
        title: Not Found
        status: 404
        detail: No exception matches this id. Check the exception id and try again.
        code: MTCH-0501
    mtch-0504-callback-is-already-being-processed:
      summary: Callback is already being processed
      value:
        type: https://errors.lerian.studio/v1/MTCH-0504
        title: Conflict
        status: 409
        detail: >-
          Another callback for this idempotency key is still being processed;
          this attempt was not processed. Retry the request in a moment; if it
          keeps failing, contact support.
        code: MTCH-0504
    mtch-0505-callback-can-be-retried:
      summary: Callback can be retried
      value:
        type: https://errors.lerian.studio/v1/MTCH-0505
        title: Conflict
        status: 409
        detail: >-
          The callback's processing status could not be confirmed; this attempt
          was not processed. Retry the request in a moment; if it keeps failing,
          contact support.
        code: MTCH-0505
    mtch-0506-callback-rate-limit-exceeded:
      summary: Callback rate limit exceeded
      value:
        type: https://errors.lerian.studio/v1/MTCH-0506
        title: Too Many Requests
        status: 429
        detail: >-
          This external system has exceeded its callback rate limit; this
          callback was not processed. Retry the request in a moment; if it keeps
          failing, contact support.
        code: MTCH-0506
    503-internal-error:
      summary: Service Unavailable
      value:
        title: Service Unavailable
        status: 503
        detail: internal error
  responses:
    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
    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
  securitySchemes:
    CallbackToken:
      description: >-
        Opaque bearer token authenticating an external system's inbound
        exception callback.
      in: header
      name: X-Callback-Token
      type: apiKey

````

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