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

# Update a transaction rule

> Update a transaction rule's conditions, outcomes, or priority. At least one field must be provided.



## OpenAPI

````yaml /api/v2/openapi.json patch /rules/{ruleId}
openapi: 3.0.3
info:
  title: Finta API v2
  version: 2.0.0
  description: >-
    DB-backed Finta API for users with storage mode enabled. Requires an API key
    and active subscription.


    ## Rate limits


    Rate limits are enforced per user (shared across the REST API and MCP) based
    on subscription plan:


    | Plan | Per minute | Per day |

    | --- | --- | --- |

    | Standard | 10 requests | 500 requests |

    | Pro | 30 requests | 2,000 requests |


    When a limit is exceeded, the API returns HTTP 429 with `error.code`
    `RATE_LIMITED` and a human-readable `message`. A `Retry-After` response
    header is included with the number of seconds until the window resets.
servers:
  - url: https://api.finta.io/v2
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Me
    description: Authenticated user
  - name: Health
    description: Service health
  - name: Bank Connections
    description: Bank connection resources
  - name: Accounts
    description: Account and balance history resources
  - name: Investments
    description: Securities, holdings, and investment transaction resources
  - name: Transactions
    description: Transaction resources
  - name: Categories
    description: Transaction category resources
  - name: Rules
    description: Transaction rule resources
paths:
  /rules/{ruleId}:
    patch:
      tags:
        - Rules
      summary: Update a transaction rule
      description: >-
        Update a transaction rule's conditions, outcomes, or priority. At least
        one field must be provided.
      operationId: updateRuleV2
      parameters:
        - name: ruleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Transaction rule UUID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRuleUpdateBody'
      responses:
        '200':
          description: Updated transaction rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionRule'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Storage mode required or subscription inactive
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Rule not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitedResponse'
components:
  schemas:
    TransactionRuleUpdateBody:
      type: object
      minProperties: 1
      properties:
        conditions:
          type: array
          minItems: 1
          items:
            type: object
            additionalProperties: true
          description: >-
            Conditions match transactions on Account, Summary,
            OriginalDescription, MerchantName, Amount, or transactionDay. Each
            condition is an object describing a field and how to match it.
        outcomes:
          type: array
          minItems: 1
          items:
            type: object
            additionalProperties: true
          description: >-
            Outcomes applied to matching transactions. Set Category (`{ action:
            'updateTransaction', field: 'Category', value: { id, value } }`) or
            MerchantName, or hide the transaction (`{ action: 'hideTransaction',
            value: true }`).
        priority:
          type: integer
          minimum: 1
          maximum: 100
    TransactionRule:
      type: object
      required:
        - id
        - conditions
        - outcomes
        - priority
        - createdAt
        - updatedAt
        - archivedAt
      properties:
        id:
          type: string
          format: uuid
        conditions:
          type: array
          items:
            type: object
            additionalProperties: true
        outcomes:
          type: array
          items:
            type: object
            additionalProperties: true
        priority:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        archivedAt:
          type: string
          format: date-time
          nullable: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: STORAGE_MODE_REQUIRED
            message:
              type: string
    UnauthorizedResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Missing or invalid Authorization header
  responses:
    RateLimitedResponse:
      description: Rate limit exceeded
      headers:
        Retry-After:
          description: Seconds until the rate-limit window resets
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: RATE_LIMITED
              message: >-
                Per-minute rate limit exceeded (10 requests/min on Standard
                plan).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Finta API key from the dashboard (Bearer token).

````