> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reconlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a reconciliation rule



## OpenAPI

````yaml patch /v1/reconciliation-rules/{ruleId}
openapi: 3.1.0
info:
  title: ReconLayer API
  version: 0.1.0
  summary: API-first reconciliation platform with dashboard-optional integration.
  description: >
    ReconLayer is designed to work headlessly.


    The dashboard is one consumer of this API, not the platform boundary.


    Organization resolution currently uses the `x-organization-id` header for
    development.

    In production, the intended model is:


    - dashboard requests authenticate through Clerk and the backend resolves the
    organization from the session

    - headless clients authenticate with API keys mapped to an organization

    - each API key can carry scopes for read/write/export/admin permissions


    Client write endpoints also use request-level idempotency.

    The client must generate an `Idempotency-Key` before the first attempt and

    reuse the same key on every retry of that same request.


    The route structure mirrors the domain:


    - `payment-intents` for expected payments

    - `reconciliation-cases` for reconciliation truth and workflow

    - `webhooks` for provider callbacks

    - `outbound-webhook-*` for client callback subscriptions and delivery
    tracking
servers:
  - url: https://api.reconlayer.com
security: []
tags:
  - name: dashboard
  - name: health
  - name: imports
  - name: outbound-webhooks
  - name: payment-intents
  - name: reconciliation-cases
  - name: integrations
  - name: settings
  - name: webhooks
paths:
  /v1/reconciliation-rules/{ruleId}:
    patch:
      tags:
        - reconciliation-cases
      summary: Update a reconciliation rule
      parameters:
        - schema:
            type: string
            minLength: 1
          in: path
          name: ruleId
          required: true
        - schema:
            type: string
            minLength: 1
          in: header
          name: authorization
          required: false
        - schema:
            type: string
            minLength: 1
          in: header
          name: x-organization-id
          required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                paymentType:
                  type: string
                  enum:
                    - stablecoin
                    - bank
                    - cross_border
                    - other
                sourceType:
                  type: string
                  enum:
                    - client_transfer_report
                    - client_internal_ledger
                    - bank_statement
                    - onchain_report
                    - psp_report
                    - manual
                isActive:
                  type: boolean
                amountTolerance:
                  type: string
                  pattern: ^-?\d+(\.\d+)?$
                timeWindowMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                expectedCompletionMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                delayedSettlementThresholdMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                sourceSlaMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                intermediaryInSlaMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                transferSlaMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                intermediaryOutSlaMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                destinationSlaMinutes:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                allowProviderIdMatch:
                  type: boolean
                allowTxHashMatch:
                  type: boolean
                allowReferenceExactMatch:
                  type: boolean
                allowAmountAndTimeWindowMatch:
                  type: boolean
                requireAllRequiredLegs:
                  type: boolean
                metadata:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties: {}
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-92'
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-98'
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-98'
components:
  schemas:
    def-92:
      type: object
      required:
        - id
        - organizationId
        - name
        - paymentType
        - sourceType
        - isActive
        - amountTolerance
        - timeWindowMinutes
        - expectedCompletionMinutes
        - delayedSettlementThresholdMinutes
        - sourceSlaMinutes
        - intermediaryInSlaMinutes
        - transferSlaMinutes
        - intermediaryOutSlaMinutes
        - destinationSlaMinutes
        - allowProviderIdMatch
        - allowTxHashMatch
        - allowReferenceExactMatch
        - allowAmountAndTimeWindowMatch
        - requireAllRequiredLegs
        - metadata
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        organizationId:
          type: string
        name:
          type: string
        paymentType:
          type:
            - 'null'
            - string
        sourceType:
          type:
            - 'null'
            - string
        isActive:
          type: boolean
        amountTolerance:
          type:
            - 'null'
            - string
        timeWindowMinutes:
          type:
            - 'null'
            - integer
        expectedCompletionMinutes:
          type:
            - 'null'
            - integer
        delayedSettlementThresholdMinutes:
          type:
            - 'null'
            - integer
        sourceSlaMinutes:
          type:
            - 'null'
            - integer
        intermediaryInSlaMinutes:
          type:
            - 'null'
            - integer
        transferSlaMinutes:
          type:
            - 'null'
            - integer
        intermediaryOutSlaMinutes:
          type:
            - 'null'
            - integer
        destinationSlaMinutes:
          type:
            - 'null'
            - integer
        allowProviderIdMatch:
          type: boolean
        allowTxHashMatch:
          type: boolean
        allowReferenceExactMatch:
          type: boolean
        allowAmountAndTimeWindowMatch:
          type: boolean
        requireAllRequiredLegs:
          type: boolean
        metadata:
          type:
            - 'null'
            - object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      title: ReconciliationRuleSnapshot
    def-98:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
        issues:
          type: array
          items:
            type: object
            additionalProperties: true
        details:
          type: object
          additionalProperties: true
        upstreamStatus:
          type: integer
      additionalProperties: true
      title: ApiErrorResponse

````