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

# Update a source binding

> Updates fields on a source binding by ID. The rail (kind) is immutable.



## OpenAPI

````yaml en/openapi/v3-current/matcher.yaml patch /v1/contexts/{contextId}/sources/{sourceId}/bindings/{bindingId}
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/contexts/{contextId}/sources/{sourceId}/bindings/{bindingId}:
    patch:
      tags:
        - Configuration
      summary: Update a source binding
      description: Updates fields on a source binding by ID. The rail (kind) is immutable.
      operationId: updateSourceBinding
      parameters:
        - description: Context ID
          in: path
          name: contextId
          required: true
          schema:
            description: Context ID
            format: uuid
            type: string
        - description: Source ID
          in: path
          name: sourceId
          required: true
          schema:
            description: Source ID
            format: uuid
            type: string
        - description: Binding ID
          in: path
          name: bindingId
          required: true
          schema:
            description: Binding ID
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSourceBindingRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceBindingResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateSourceBindingRequest:
      additionalProperties: false
      properties:
        connectionId:
          description: >-
            Query-rail engine connection reference (UUID). Applies only to
            query-rail bindings.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        enabled:
          description: Whether the binding runs.
          examples:
            - false
          type: boolean
        format:
          description: >-
            Declared format the binding produces, as a region/family-namespaced
            descriptor key. The rail (kind) is immutable on update.
          examples:
            - br/cnab400/default
          maxLength: 255
          type: string
        scheduleSpec:
          description: >-
            Interval schedule spec the binding scheduler reads (cron or @every
            duration).
          examples:
            - '@every 30m'
          maxLength: 100
          type: string
        transportConfig:
          $ref: '#/components/schemas/SourceBindingTransportConfigRequest'
          description: >-
            File-rail transport configuration. Applies only to file-rail
            bindings.
      type: object
    SourceBindingResponse:
      additionalProperties: false
      properties:
        connectionId:
          description: >-
            Query-rail engine connection reference (UUID). Omitted for file-rail
            bindings.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        contextId:
          description: Identifier of the context this binding 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
        enabled:
          description: Whether the binding runs.
          examples:
            - true
          type: boolean
        format:
          description: >-
            Declared format the binding produces, as a region/family-namespaced
            descriptor key.
          examples:
            - br/cnab400/default
          type: string
        id:
          description: Unique identifier of the binding.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        kind:
          description: >-
            Rail the source is pulled on. file fetches files via a transport;
            query pulls rows through a discovery-engine connection.
          enum:
            - file
            - query
          examples:
            - file
          type: string
        scheduleSpec:
          description: >-
            Interval schedule spec the binding scheduler reads (cron or @every
            duration).
          examples:
            - '@every 1h'
          type: string
        sourceId:
          description: Identifier of the source this binding belongs to.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        transportConfig:
          $ref: '#/components/schemas/SourceBindingTransportConfigResponse'
          description: File-rail transport configuration. Omitted for query-rail bindings.
        updatedAt:
          description: Last update timestamp in RFC 3339 format.
          examples:
            - '2025-01-15T10:30:00Z'
          type: string
      required:
        - id
        - contextId
        - sourceId
        - kind
        - format
        - scheduleSpec
        - enabled
        - 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
    SourceBindingTransportConfigRequest:
      additionalProperties: false
      properties:
        connectOptions:
          additionalProperties:
            type: string
          description: Non-secret transport tuning options (adapter-specific).
          type: object
        credentialRef:
          description: >-
            Reference to a stored credential resolved at fetch time. This is a
            reference, never the secret material itself.
          examples:
            - cred-bank-sftp
          maxLength: 255
          type: string
        glob:
          description: Optional glob filter applied within the path.
          examples:
            - '*.csv'
          maxLength: 255
          type: string
        host:
          description: Remote endpoint hostname or IP.
          examples:
            - sftp.bank.example.com
          maxLength: 255
          type: string
        kind:
          description: >-
            Transport adapter kind. sftp pulls over SFTP; https over HTTP(S); s3
            from an S3 bucket; imap from an email mailbox.
          enum:
            - sftp
            - https
            - s3
            - imap
          examples:
            - sftp
          type: string
        path:
          description: Remote directory to list and fetch from.
          examples:
            - /statements
          maxLength: 1024
          type: string
        port:
          description: Remote endpoint port.
          examples:
            - 22
          format: int64
          maximum: 65535
          minimum: 1
          type: integer
      required:
        - kind
        - host
      type: object
    SourceBindingTransportConfigResponse:
      additionalProperties: false
      properties:
        connectOptions:
          additionalProperties:
            type: string
          description: Non-secret transport tuning options (adapter-specific).
          type: object
        credentialRef:
          description: >-
            Reference to a stored credential resolved at fetch time. This is a
            reference, never the secret material itself.
          examples:
            - cred-bank-sftp
          type: string
        glob:
          description: Optional glob filter applied within the path.
          examples:
            - '*.csv'
          type: string
        host:
          description: Remote endpoint hostname or IP.
          examples:
            - sftp.bank.example.com
          type: string
        kind:
          description: >-
            Transport adapter kind. sftp pulls over SFTP; https over HTTP(S); s3
            from an S3 bucket; imap from an email mailbox.
          enum:
            - sftp
            - https
            - s3
            - imap
          examples:
            - sftp
          type: string
        path:
          description: Remote directory to list and fetch from.
          examples:
            - /statements
          type: string
        port:
          description: Remote endpoint port.
          examples:
            - 22
          format: int64
          type: integer
      required:
        - kind
        - host
      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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````