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

# List reconciliation sources

> Use this endpoint to retrieve all reconciliation sources under a specific context. You can filter the results by source type. The response uses cursor-based pagination.



## OpenAPI

````yaml /pt/openapi/v3-current/matcher.yaml get /v1/contexts/{contextId}/sources
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/contexts/{contextId}/sources:
    get:
      tags:
        - Configuration Sources
      summary: List reconciliation sources
      description: >-
        Use this endpoint to retrieve all reconciliation sources under a
        specific context. You can filter the results by source type. The
        response uses cursor-based pagination.
      operationId: listSources
      parameters:
        - description: A unique identifier for tracing the request across services.
          in: header
          name: X-Request-Id
          schema:
            type: string
        - description: The unique identifier of the reconciliation context.
          in: path
          name: contextId
          required: true
          schema:
            description: Context ID
            format: uuid
            type: string
        - description: The maximum number of items to include in the response.
          explode: false
          in: query
          name: limit
          schema:
            default: 20
            description: Maximum number of records to return
            format: int64
            maximum: 200
            minimum: 1
            type: integer
        - description: The cursor value for retrieving the next page of results.
          explode: false
          in: query
          name: cursor
          schema:
            description: Cursor for pagination (opaque)
            type: string
        - description: Filter by source type
          explode: false
          in: query
          name: type
          schema:
            description: Filter by source type
            enum:
              - LEDGER
              - BANK
              - GATEWAY
              - CUSTOM
              - FETCHER
            type: string
        - description: >-
            When true, archived (soft-deleted) sources are included in the
            listing. Defaults to false (live sources only).
          explode: false
          in: query
          name: includeArchived
          schema:
            default: false
            description: >-
              When true, archived (soft-deleted) sources are included in the
              listing. Defaults to false (live sources only).
            type: boolean
      responses:
        '200':
          description: List of sources with cursor pagination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSourcesResponse'
        '400':
          description: Invalid query parameters
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                400-invalid-pagination-parameters:
                  $ref: '#/components/examples/400-invalid-pagination-parameters'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Context not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0110-context-not-found:
                  $ref: '#/components/examples/mtch-0110-context-not-found'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    ListSourcesResponse:
      additionalProperties: false
      properties:
        hasMore:
          examples:
            - true
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/SourceWithFieldMapStatusResponse'
          maxItems: 200
          type:
            - array
            - 'null'
        limit:
          examples:
            - 20
          format: int64
          maximum: 200
          minimum: 1
          type: integer
        nextCursor:
          examples:
            - eyJpZCI6IjEyMyJ9
          type: string
        prevCursor:
          examples:
            - eyJpZCI6IjEyMiJ9
          type: string
      required:
        - items
        - limit
        - hasMore
      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
    SourceWithFieldMapStatusResponse:
      additionalProperties: false
      properties:
        archivedAt:
          description: >-
            RFC 3339 timestamp when the source was archived; absent when the
            source is live.
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
        config:
          additionalProperties: {}
          description: >-
            Source-specific configuration object. Cross-key rules the schema
            cannot express: a duplicate_key component this source's field map
            does not fill is refused, because a key over an always-empty field
            makes every row a duplicate of every other; a source bound to an
            aggregator connection (reserved key connection_config_name) cannot
            carry a duplicate_key of its own, and a config holding both is
            refused in either direction; and editing duplicate_key governs later
            imports only — rows already imported keep the key they were
            deduplicated under, so a duplicate straddling the change is
            knowingly not detected.
          properties:
            blank_external_id:
              description: >-
                What happens to a row whose mapped external id is blank. REJECT
                (the default when the key is absent) fails the row. NEEDS_REVIEW
                imports it under a synthetic reference with status
                PENDING_REVIEW, so a blank reference becomes a reviewable import
                instead of an import failure.
              enum:
                - REJECT
                - NEEDS_REVIEW
              type: string
            camt053:
              additionalProperties: false
              description: >-
                How this source's camt.053 files map onto the canonical fields.
                Every other field is fixed by ISO 20022 itself. An absent
                object, or an absent sub-key, keeps the ISO defaults (booking,
                ntry_ref).
              properties:
                date_basis:
                  description: >-
                    Entry date element: booking is BookgDt/Dt, valuation is
                    ValDt/Dt. Default booking.
                  enum:
                    - booking
                    - valuation
                  type: string
                external_id_source:
                  description: >-
                    Entry reference element: ntry_ref is NtryRef, end_to_end_id
                    is NtryDtls/TxDtls/Refs/EndToEndId, tx_id is
                    NtryDtls/TxDtls/Refs/TxId. Default ntry_ref.
                  enum:
                    - ntry_ref
                    - end_to_end_id
                    - tx_id
                  type: string
              type: object
            dialect:
              additionalProperties: false
              description: >-
                How this source's delimited files are encoded and formatted.
                Declaration-driven only — there is no auto-detection. An absent
                object, or an absent sub-key, keeps the defaults (utf-8, comma,
                dot, iso).
              properties:
                date_style:
                  enum:
                    - iso
                    - iso_offset
                    - dmy
                    - mdy
                  type: string
                decimal_style:
                  description: dot is 1234.56, comma is 1.234,56.
                  enum:
                    - dot
                    - comma
                  type: string
                delimiter:
                  enum:
                    - comma
                    - semicolon
                    - tab
                    - pipe
                  type: string
                encoding:
                  enum:
                    - utf-8
                    - utf-8-sig
                    - cp1252
                    - iso-8859-1
                  type: string
              type: object
            duplicate_key:
              description: >-
                The ordered list of mapped fields that make two rows the same
                row. Absent means external_id alone. On a source bound to an
                aggregator connection the aggregator retracts a movement by
                naming its external id, so that id has to stay the row identity.
              items:
                enum:
                  - external_id
                  - amount
                  - currency
                  - date
                  - description
                  - fee_amount
                  - fee_currency
                type: string
              minItems: 1
              type: array
              uniqueItems: true
            duplicate_key_changed_at:
              description: >-
                SERVER-OWNED. The moment duplicate-key detection last changed
                meaning on this source, either because duplicate_key was edited
                or because the field map remapped the column a declared
                component reads. Rows imported before it keep the key they were
                deduplicated under. A value sent by a client is discarded.
              format: date-time
              readOnly: true
              type: string
            duplicate_policy:
              description: >-
                What happens to a row that repeats this source's duplicate key.
                FLAG_AS_EXCEPTION (the default when the key is absent) keeps the
                repeat out of the import and raises a duplicate exception on the
                row it repeated. KEEP_FIRST drops the repeat and raises nothing,
                so a collision leaves no trace anyone can act on. REJECT counts
                the repeat as an import error.
              enum:
                - FLAG_AS_EXCEPTION
                - KEEP_FIRST
                - REJECT
              type: string
            fail_on_error_rate_percent:
              description: >-
                Fail the whole import when the percentage of failed rows exceeds
                this whole number. Absent means never auto-fail. The ceiling is
                99, not 100: the comparison is strict, so 100 could never fire.
              maximum: 99
              minimum: 1
              type: integer
          type: object
        contextId:
          description: Identifier of the context this source belongs to.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        createdAt:
          description: Creation timestamp in RFC 3339 format.
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
        hasFieldMaps:
          description: Whether a field map is configured for this source.
          examples:
            - true
          type: boolean
        id:
          description: Unique identifier of the source.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        name:
          description: Human-readable name of the source.
          examples:
            - Primary Bank Account
          type: string
        side:
          description: >-
            Matching side this source feeds. LEFT and RIGHT are the two sides
            reconciled against each other.
          enum:
            - LEFT
            - RIGHT
          examples:
            - LEFT
          type: string
        type:
          description: >-
            Origin of the source data. LEDGER is the internal ledger; BANK is a
            bank statement feed; GATEWAY is a payment gateway; CUSTOM is a
            bespoke feed; FETCHER is a discovery-engine pull.
          enum:
            - LEDGER
            - BANK
            - GATEWAY
            - CUSTOM
            - FETCHER
          examples:
            - BANK
          type: string
        updatedAt:
          description: Last update timestamp in RFC 3339 format.
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
      required:
        - hasFieldMaps
        - id
        - contextId
        - name
        - type
        - side
        - config
        - createdAt
        - updatedAt
      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
    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
  examples:
    400-invalid-pagination-parameters:
      summary: Invalid pagination parameters
      value:
        type: https://errors.lerian.studio/v1/MTCH-0001
        title: Bad Request
        status: 400
        detail: >-
          The pagination cursor could not be decoded; omit it to start from the
          first page, or use the exact cursor value returned by a previous
          response
        code: MTCH-0001
    mtch-0110-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
  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.