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

# Query transaction rules

> Query transaction rules for the authenticated user



## OpenAPI

````yaml https://dev.tight.com/v3/api-docs post /v6/banks/transactions/rules/query
openapi: 3.0.1
info:
  title: Tight API
  contact:
    name: Hurdlr, Inc. (dba Tight)
    url: https://www.tight.com
    email: api@tight.com
  version: 6.0.0
servers:
  - url: https://sandbox.tight.com
    description: Staging Environment
  - url: https://prod.tight.com
    description: Production Environment
security:
  - EmbedToken: []
paths:
  /v6/banks/transactions/rules/query:
    post:
      tags:
        - Transaction Rules
      summary: Query transaction rules
      description: Query transaction rules for the authenticated user
      operationId: queryTransactionRules
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRulesGetParam'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponseTransactionRuleGetDto'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: REQUIRED
                    message: Amount is required
                    param: amount
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: INVALID_TOKEN
                    message: Invalid access token
        '403':
          description: Not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: FORBIDDEN
                    message: Expired access token
        '404':
          description: Endpoint not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: BAD_REQUEST
                    message: Resource not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                result: FAILURE
                error:
                  - type: UNKNOWN_ERROR
                    message: Something went wrong. Please try again later.
      security:
        - EmbedToken: []
components:
  schemas:
    TransactionRulesGetParam:
      type: object
      properties:
        cursor:
          type: string
          description: Cursor from the previous paginated response
          nullable: true
        limit:
          maximum: 250
          type: integer
          description: Page size, i.e. number of items to return per page
          format: int32
        sort:
          $ref: '#/components/schemas/TransactionRulesSort'
        filter:
          $ref: '#/components/schemas/TransactionRulesFilterParam'
    PaginatedResponseTransactionRuleGetDto:
      type: object
      properties:
        result:
          type: string
          description: The result of the action performed.
          enum:
            - SUCCESS
            - FAILURE
        data:
          type: array
          description: The data generated by the action performed.
          items:
            $ref: '#/components/schemas/TransactionRuleGetDto'
        cursor:
          $ref: '#/components/schemas/ResponseCursor'
    ErrorResponse:
      type: object
      properties:
        result:
          type: string
          description: The result of the action performed.
          enum:
            - SUCCESS
            - FAILURE
        data:
          type: object
          description: The data generated by the action performed.
          nullable: true
        error:
          type: array
          items:
            $ref: '#/components/schemas/ErrorItem'
    TransactionRulesSort:
      type: object
      properties:
        orderBy:
          type: string
          description: Sort column
          enum:
            - LAST_APPLIED_DATE
            - MATCH_COUNT
        direction:
          type: string
          description: Sort direction. Defaults to DESC
          enum:
            - ASC
            - DESC
      description: Sort order for the items in the response.
    TransactionRulesFilterParam:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/EnumStatusListFilter'
        filter:
          $ref: '#/components/schemas/TransactionRuleConditionFilterParam'
        update:
          $ref: '#/components/schemas/TransactionRuleActionFilterParam'
        lastAppliedDate:
          $ref: '#/components/schemas/DateTimeFilter'
        matchCount:
          $ref: '#/components/schemas/AmountFilter'
      description: Filter for items in the response.
    TransactionRuleGetDto:
      required:
        - filter
        - filterDisplayName
        - id
        - lastAppliedDateTime
        - matchCount
        - status
        - update
        - updateDisplayName
      type: object
      properties:
        id:
          type: string
          description: Id of the transaction rule
          example: trl_5445116
        status:
          type: string
          description: Status of the transaction rule
          example: ACTIVE
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        filter:
          $ref: '#/components/schemas/TransactionRuleFilterDto'
        update:
          $ref: '#/components/schemas/TransactionRuleUpdateGetDto'
        matchCount:
          type: integer
          description: Number of matched transactions for the transaction rule
          format: int64
          example: 4
        lastAppliedDateTime:
          type: string
          description: Date on which the most recent match occurred of the transaction rule
          format: date-time
        filterDisplayName:
          type: string
          description: Description of the filter conditions of the transaction rule
          example: Vendor is "Starbucks"
        updateDisplayName:
          type: string
          description: Description of the updates applied by the transaction rule
          example: Set glAccount as "Taxi"
        customData:
          $ref: '#/components/schemas/JsonNode'
      description: The data generated by the action performed.
    ResponseCursor:
      type: object
      properties:
        after:
          type: string
          description: >-
            After cursor - Fetches entities after this cursor. Useful for paging
            forwards.
        before:
          type: string
          description: >-
            Before cursor - Fetches entities before this cursor. Useful for
            paging backwards.
      description: >-
        Cursor to be used in your subsequent paginated request. Only populated
        if there are more pages available.
    ErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The type of the error. Safe for programmatic use.
          enum:
            - UNKNOWN_ERROR
            - INVALID_TOKEN
            - EXPIRED_TOKEN
            - FORBIDDEN
            - BAD_REQUEST
            - JSON_ERROR
            - DUPLICATE
            - REQUIRED
            - INVALID_VALUE
            - NOT_MODIFIABLE
            - INVALID_FORMAT
            - NOT_FOUND
        message:
          type: string
          description: >-
            A human-readable message providing more details about the error.
            Safe for displaying to a user.
        param:
          type: string
          description: >-
            If the error is parameter-specific, the parameter related to the
            error. This can be used to display a message near the correct form
            field.
      description: Errors associated with the action performed, if applicable.
    EnumStatusListFilter:
      type: object
      properties:
        in:
          type: array
          items:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
              - REMOVED
        notIn:
          type: array
          items:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
              - REMOVED
        equal:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        notEqual:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        greaterThan:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        greaterThanEqual:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        lessThan:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
        lessThanEqual:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - REMOVED
      description: Status filter
    TransactionRuleConditionFilterParam:
      type: object
      properties:
        description:
          $ref: '#/components/schemas/StringFilter'
        amount:
          $ref: '#/components/schemas/AmountFilter'
        vendorId:
          $ref: '#/components/schemas/VendorFilter'
        bankAccountId:
          $ref: '#/components/schemas/BankAccountFilter'
      description: Rule filter's filter
    TransactionRuleActionFilterParam:
      type: object
      properties:
        glAccountId:
          $ref: '#/components/schemas/GlAccountFilter'
        vendorId:
          $ref: '#/components/schemas/VendorFilter'
        customerId:
          $ref: '#/components/schemas/CustomerFilter'
        reviewStatus:
          $ref: '#/components/schemas/ReviewStatusListFilter'
        dimensionValueId:
          $ref: '#/components/schemas/DimensionValueFilter'
      description: Rule update's filter
    DateTimeFilter:
      type: object
      properties:
        equal:
          type: string
          description: Equal to
          format: date-time
        notEqual:
          type: string
          description: Not equal to
          format: date-time
        greaterThan:
          type: string
          description: Greater than
          format: date-time
        greaterThanEqual:
          type: string
          description: Greater than or equal to
          format: date-time
        lessThan:
          type: string
          description: Less than
          format: date-time
        lessThanEqual:
          type: string
          description: Less than or equal to
          format: date-time
      description: Date filter
    AmountFilter:
      type: object
      properties:
        equal:
          type: integer
          description: >-
            Value - returns all records with specified field equal to this
            value.
          format: int32
        notEqual:
          type: integer
          description: >-
            Value - returns all records with specified field not equal to this
            value.
          format: int32
        greaterThan:
          type: integer
          description: >-
            Value - returns all records with specified field greater than to
            this value.
          format: int32
        greaterThanEqual:
          type: integer
          description: >-
            Value - returns all records with specified field greater than or
            equal to this value.
          format: int32
        lessThan:
          type: integer
          description: >-
            Value - returns all records with specified field less than to this
            value.
          format: int32
        lessThanEqual:
          type: integer
          description: >-
            Value - returns all records with specified field less than or equal
            to this value.
          format: int32
      description: Match count filter
    TransactionRuleFilterDto:
      type: object
      properties:
        description:
          $ref: '#/components/schemas/DescriptionCondition'
        amount:
          $ref: '#/components/schemas/AmountCondition'
        vendor:
          $ref: '#/components/schemas/VendorCondition'
        glAccount:
          $ref: '#/components/schemas/GlAccountCondition'
        bankAccount:
          $ref: '#/components/schemas/BankAccountCondition'
      description: Filter criteria defining which transactions this rule matches
      nullable: true
    TransactionRuleUpdateGetDto:
      required:
        - customer
        - dimensionValues
        - glAccount
        - reviewStatus
        - vendor
      type: object
      properties:
        glAccount:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/GlAccountExpanded'
        vendor:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/VendorExpanded'
        customer:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/CustomerExpanded'
        reviewStatus:
          type: string
          description: Review status assigned to matched transactions
          nullable: true
          example: RECONCILED
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
        dimensionValues:
          maxItems: 4
          type: array
          items:
            $ref: '#/components/schemas/DimensionValueExpanded'
      description: Updates to apply to matched transactions
      nullable: true
    JsonNode:
      type: object
      properties:
        empty:
          type: boolean
        array:
          type: boolean
        'null':
          type: boolean
        object:
          type: boolean
        float:
          type: boolean
        string:
          type: boolean
        number:
          type: boolean
        missingNode:
          type: boolean
        valueNode:
          type: boolean
        nodeType:
          type: string
          enum:
            - ARRAY
            - BINARY
            - BOOLEAN
            - MISSING
            - 'NULL'
            - NUMBER
            - OBJECT
            - POJO
            - STRING
        pojo:
          type: boolean
        integralNumber:
          type: boolean
        floatingPointNumber:
          type: boolean
        short:
          type: boolean
        int:
          type: boolean
        long:
          type: boolean
        double:
          type: boolean
        bigDecimal:
          type: boolean
        bigInteger:
          type: boolean
        textual:
          type: boolean
          deprecated: true
        boolean:
          type: boolean
        binary:
          type: boolean
        container:
          type: boolean
        embeddedValue:
          type: boolean
      description: >-
        Custom JSON in which you can store any data with max length of 2000
        characters
      nullable: true
      example:
        internal_key: some_internal_key
        some_other_field: 23434
    StringFilter:
      type: object
      properties:
        equal:
          type: string
          description: >-
            Value - returns all records with specified field equal to this
            value.
        notEqual:
          type: string
          description: >-
            Value - returns all records with specified field not equal to this
            value.
        greaterThan:
          type: string
          description: >-
            Value - returns all records with specified field greater than to
            this value.
        greaterThanEqual:
          type: string
          description: >-
            Value - returns all records with specified field greater than or
            equal to this value.
        lessThan:
          type: string
          description: >-
            Value - returns all records with specified field less than to this
            value.
        lessThanEqual:
          type: string
          description: >-
            Value - returns all records with specified field less than or equal
            to this value.
        contain:
          type: string
          description: >-
            Value - returns all records with specified field containing this
            value.
      description: Name filter
    VendorFilter:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/VendorIds'
      description: Filter on the rule's action vendor id
    BankAccountFilter:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/BankAccountIds'
      description: Bank filter
    GlAccountFilter:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/GlAccountIds'
      description: Filter on the rule's action GL account id
    CustomerFilter:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/CustomerIds'
      description: Filter on the rule's action customer id
    ReviewStatusListFilter:
      type: object
      properties:
        in:
          type: array
          description: List of values to include.
          items:
            type: string
            description: List of values to include.
            enum:
              - RECONCILIATION_DISCREPANCY
              - USER_REVIEW_REQUIRED
              - ACCOUNTANT_REVIEW_REQUIRED
              - PARTNER_REVIEW_REQUIRED
              - AWAITING_MATCH
              - STAGED
              - RECONCILED
        notIn:
          type: array
          description: List of values to exclude.
          items:
            type: string
            description: List of values to exclude.
            enum:
              - RECONCILIATION_DISCREPANCY
              - USER_REVIEW_REQUIRED
              - ACCOUNTANT_REVIEW_REQUIRED
              - PARTNER_REVIEW_REQUIRED
              - AWAITING_MATCH
              - STAGED
              - RECONCILED
        equal:
          type: string
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
        notEqual:
          type: string
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
        greaterThan:
          type: string
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
        greaterThanEqual:
          type: string
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
        lessThan:
          type: string
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
        lessThanEqual:
          type: string
          enum:
            - RECONCILIATION_DISCREPANCY
            - USER_REVIEW_REQUIRED
            - ACCOUNTANT_REVIEW_REQUIRED
            - PARTNER_REVIEW_REQUIRED
            - AWAITING_MATCH
            - STAGED
            - RECONCILED
      description: Review status filter
    DimensionValueFilter:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/DimensionValueIds'
      description: Filter on the rule's action dimension value id (any slot)
    DescriptionCondition:
      type: object
      properties:
        equal:
          type: string
          description: Exact match on transaction description
          example: Office Supplies
        contain:
          type: string
          description: Contains match on transaction description
          example: Supplies
      description: Filter by transaction description
      nullable: false
    AmountCondition:
      type: object
      properties:
        equal:
          type: integer
          description: Exact amount match
          format: int32
        greaterThan:
          type: integer
          description: Amount greater than
          format: int32
        greaterThanEqual:
          type: integer
          description: Amount greater than or equal
          format: int32
        lessThan:
          type: integer
          description: Amount less than
          format: int32
        lessThanEqual:
          type: integer
          description: Amount less than or equal
          format: int32
      description: Filter by transaction amount
      nullable: false
    VendorCondition:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdCondition'
      description: Filter by vendor
      nullable: false
    GlAccountCondition:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdCondition'
      description: Filter by GL account
      nullable: false
    BankAccountCondition:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/IdCondition'
      description: Filter by bank account
      nullable: false
    GlAccountExpanded:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the GL account
          example: gla_38560327
        name:
          type: string
          description: Name of the GL account
          example: Officer(s) Salaries and Wages
        accountNo:
          type: string
          description: Number of the GL account
          example: '60210'
        type:
          type: string
          description: Type the GL account
          example: EXPENSE
          enum:
            - ASSET
            - LIABILITY
            - EQUITY
            - INCOME
            - COGS
            - EXPENSE
            - OTHER_INCOME
            - OTHER_EXPENSE
            - SUSPENSE
        iconUrl:
          type: string
          description: Icon URL of the GL account
          example: https://cdn.sandbox.tight.com/icons/glAccountTypes/expense.png
        displayName:
          type: string
          description: Display name of the GL account
          example: '#60210 Officer(s) Salaries and Wages'
      description: GL account details
    VendorExpanded:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the vendor
          example: vnd_28868401
        name:
          type: string
          description: Name of the vendor
          example: Gusto
      description: Vendor associated with this child payment
      nullable: true
    CustomerExpanded:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the customer
          example: cus_4852707
        name:
          type: string
          description: Name of the customer
          example: Abigail Adams
        email:
          type: string
          description: Email of the customer
          example: abigail@tight.com
      description: Customer associated with this time entry
      nullable: true
    DimensionValueExpanded:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the dimension value
          example: dv_593051
        dimension:
          $ref: '#/components/schemas/DimensionExpanded'
        name:
          type: string
          description: Name of the dimension value
          example: Mid-Atlantic
        child:
          $ref: '#/components/schemas/ChildDimensionValue'
      description: List of dimension values associated with this time entry
    VendorIds:
      type: object
      properties:
        in:
          type: array
          description: List of values to include.
          items:
            type: string
            description: List of values to include.
      description: Id filter - returns all entities with the following vendors.
    BankAccountIds:
      type: object
      properties:
        in:
          type: array
          description: List of values to include.
          items:
            type: string
            description: List of values to include.
        notIn:
          type: array
          description: List of values to exclude.
          items:
            type: string
            description: List of values to exclude.
      description: Id filter - returns all entities with the following bank accounts.
    GlAccountIds:
      type: object
      properties:
        in:
          type: array
          description: List of values to include.
          items:
            type: string
            description: List of values to include.
      description: >-
        Id filter - returns all entities with the following General Ledger
        accounts.
    CustomerIds:
      type: object
      properties:
        in:
          type: array
          description: List of values to include.
          items:
            type: string
            description: List of values to include.
      description: Id filter - returns all entities with the following customers.
    DimensionValueIds:
      type: object
      properties:
        in:
          type: array
          description: List of values to include.
          items:
            type: string
            description: List of values to include.
      description: Id filter - returns all entities with the following dimension values.
    IdCondition:
      type: object
      properties:
        equal:
          type: string
          description: Exact match on template GL account id
          example: tgla_324231
      description: Filter by template GL account id
    DimensionExpanded:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the dimension
          example: dim_4521
        name:
          type: string
          description: Name of the dimension
          example: Region
        requiredness:
          type: string
          description: Requiredness of the dimension
          example: NOT_REQUIRED
          enum:
            - REQUIRED
            - NOT_REQUIRED
      description: Dimension for this dimension value
    ChildDimensionValue:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the dimension value
          example: dv_593052
        dimension:
          $ref: '#/components/schemas/DimensionExpanded'
        name:
          type: string
          description: Name of the dimension value
          example: Washington DC
        child:
          $ref: '#/components/schemas/ChildDimensionValue'
      description: Child dimension value, if applicable
  securitySchemes:
    EmbedToken:
      type: http
      description: >-
        Bearer authentication header of the form `Bearer <token>`, see
        [Authentication for more
        detail](/api-reference/authentication#partner-level-authentication).
      scheme: bearer

````