---
title: "Query template rules"
method: POST
path: "/v6/templates/rules/query"
tags: ["Templates"]
---

# Query template rules

`POST /v6/templates/rules/query`

Query template rules for the authenticated user

## Request body

- TemplateRulesGetParam
  - `cursor` string, nullable — Cursor from the previous paginated response
  - `limit` integer — Page size, i.e. number of items to return per page
  - `sort` TemplateRulesSort — Sort order for the items in the response.
    - `orderBy` 'LAST_APPLIED_DATE' | 'MATCH_COUNT' | 'STATUS' — Sort column
    - `direction` 'ASC' | 'DESC' — Sort direction. Defaults to DESC
  - `filter` TemplateRulesFilterParam — Filter for items in the response.
    - `status` EnumStatusListFilter — Status filter
      - `in` string[]
      - `notIn` string[]
      - `equal` 'ACTIVE' | 'INACTIVE' | 'REMOVED'
      - `notEqual` 'ACTIVE' | 'INACTIVE' | 'REMOVED'
      - `greaterThan` 'ACTIVE' | 'INACTIVE' | 'REMOVED'
      - `greaterThanEqual` 'ACTIVE' | 'INACTIVE' | 'REMOVED'
      - `lessThan` 'ACTIVE' | 'INACTIVE' | 'REMOVED'
      - `lessThanEqual` 'ACTIVE' | 'INACTIVE' | 'REMOVED'
    - `filter` TemplateRuleConditionFilterParam — Rule filter's filter
      - `description` StringFilter — Name filter
        - `equal` string — Value - returns all records with specified field equal to this value.
        - `notEqual` string — Value - returns all records with specified field not equal to this value.
        - `greaterThan` string — Value - returns all records with specified field greater than to this value.
        - `greaterThanEqual` string — Value - returns all records with specified field greater than or equal to this value.
        - `lessThan` string — Value - returns all records with specified field less than to this value.
        - `lessThanEqual` string — Value - returns all records with specified field less than or equal to this value.
        - `contain` string — Value - returns all records with specified field containing this value.
      - `amount` AmountFilter — Match count filter
        - `equal` integer — Value - returns all records with specified field equal to this value.
        - `notEqual` integer — Value - returns all records with specified field not equal to this value.
        - `greaterThan` integer — Value - returns all records with specified field greater than to this value.
        - `greaterThanEqual` integer — Value - returns all records with specified field greater than or equal to this value.
        - `lessThan` integer — Value - returns all records with specified field less than to this value.
        - `lessThanEqual` integer — Value - returns all records with specified field less than or equal to this value.
      - `businessType` BusinessTypeFilter — Business type filter
        - `id` BusinessTypeIds — Id filter - returns all template rules with the following business types.
          - `in` string[] — List of values to include.
      - `templateGlAccount` TemplateGlAccountFilter — Template GL account filter
        - `id` TemplateGlAccountIds — Id filter - returns all template rules with the following template GL accounts.
          - `in` string[] — List of values to include.
      - `vendor` GlobalVendorNameFilter — Vendor name filter
        - `equal` string — Value - returns all records with specified field equal to this value.
        - `notEqual` string — Value - returns all records with specified field not equal to this value.
    - `update` TemplateRuleActionFilterParam — Rule update's filter
      - `reviewStatus` ReviewStatusListFilter — Review status filter
        - `in` string[] — List of values to include.
        - `notIn` string[] — List of values to exclude.
        - `equal` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED'
        - `notEqual` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED'
        - `greaterThan` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED'
        - `greaterThanEqual` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED'
        - `lessThan` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED'
        - `lessThanEqual` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED'
      - `templateGlAccount` TemplateGlAccountFilter — Template GL account filter
        - `id` TemplateGlAccountIds — Id filter - returns all template rules with the following template GL accounts.
          - `in` string[] — List of values to include.
      - `vendor` GlobalVendorNameFilter — Vendor name filter
        - `equal` string — Value - returns all records with specified field equal to this value.
        - `notEqual` string — Value - returns all records with specified field not equal to this value.
    - `lastAppliedDate` DateTimeFilter — Date filter
      - `equal` string, date-time — Equal to
      - `notEqual` string, date-time — Not equal to
      - `greaterThan` string, date-time — Greater than
      - `greaterThanEqual` string, date-time — Greater than or equal to
      - `lessThan` string, date-time — Less than
      - `lessThanEqual` string, date-time — Less than or equal to
    - `matchCount` AmountFilter — Match count filter
      - `equal` integer — Value - returns all records with specified field equal to this value.
      - `notEqual` integer — Value - returns all records with specified field not equal to this value.
      - `greaterThan` integer — Value - returns all records with specified field greater than to this value.
      - `greaterThanEqual` integer — Value - returns all records with specified field greater than or equal to this value.
      - `lessThan` integer — Value - returns all records with specified field less than to this value.
      - `lessThanEqual` integer — Value - returns all records with specified field less than or equal to this value.

## Response `200`

Success

- PaginatedResponseTemplateRuleGetDto
  - `result` 'SUCCESS' | 'FAILURE' — The result of the action performed.
  - `data` TemplateRuleGetDto[] — The data generated by the action performed.
    - `id` string, required — Id of the template rule
    - `status` 'ACTIVE' | 'INACTIVE' | 'REMOVED', required — Status of the template rule
    - `filter` Filter, required — Filter criteria defining which transactions this rule matches
      - `amount` AmountCondition — Filter by transaction amount
        - `equal` integer — Exact amount match
        - `greaterThan` integer — Amount greater than
        - `greaterThanEqual` integer — Amount greater than or equal
        - `lessThan` integer — Amount less than
        - `lessThanEqual` integer — Amount less than or equal
      - `description` DescriptionCondition — Filter by transaction description
        - `equal` string — Exact match on transaction description
        - `contain` string — Contains match on transaction description
      - `businessType` BusinessTypeCondition — Filter affected users by business type
        - `id` IdCondition — Filter by template GL account id
          - `equal` string — Exact match on template GL account id
      - `templateGlAccount` TemplateGlAccountCondition — Filter by template GL account
        - `id` IdCondition — Filter by template GL account id
          - `equal` string — Exact match on template GL account id
      - `vendorName` TemplateVendorCondition — Filter by vendor name
        - `name` string, required — Exact match on vendor name
    - `update` Update, required — Updates to apply to matched transactions
      - `reviewStatus` 'RECONCILIATION_DISCREPANCY' | 'USER_REVIEW_REQUIRED' | 'ACCOUNTANT_REVIEW_REQUIRED' | 'PARTNER_REVIEW_REQUIRED' | 'AWAITING_MATCH' | 'STAGED' | 'RECONCILED' — Review status to assign to matched transactions
      - `templateGlAccountId` string — Id of the template GL account to assign to matched transactions
      - `vendorName` string — Vendor name to assign to matched transactions
    - `customData` JsonNode, nullable — Custom JSON in which you can store any data with max length of 2000 characters
      - `empty` boolean
      - `array` boolean
      - `null` boolean
      - `object` boolean
      - `float` boolean
      - `string` boolean
      - `number` boolean
      - `missingNode` boolean
      - `valueNode` boolean
      - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
      - `pojo` boolean
      - `integralNumber` boolean
      - `floatingPointNumber` boolean
      - `short` boolean
      - `int` boolean
      - `long` boolean
      - `double` boolean
      - `bigDecimal` boolean
      - `bigInteger` boolean
      - `textual` boolean
      - `boolean` boolean
      - `binary` boolean
      - `container` boolean
      - `embeddedValue` boolean
  - `cursor` ResponseCursor — Cursor to be used in your subsequent paginated request. Only populated if there are more pages available.
    - `after` string — After cursor - Fetches entities after this cursor. Useful for paging forwards.
    - `before` string — Before cursor - Fetches entities before this cursor. Useful for paging backwards.

## Other responses

- `400` — Bad request
- `401` — Not authenticated
- `403` — Not authorized
- `404` — Endpoint not found
- `500` — Internal server error

---

[API](https://skmtc.net/tight/apis/tight-api.md) · [All operations](https://skmtc.net/tight/apis/tight-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tight/tight-api/revisions/e9f0790a89af/schema)
