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

# Save template rules

`POST /v6/templates/rules`

Save new (or update existing) template rules

## Request body

- MultiParamTemplateRulePostDto
  - `data` TemplateRulePostDto[], required
    - `id` string — Id of the template rule, required when updating an existing rule
    - `status` 'ACTIVE' | 'INACTIVE' | 'REMOVED' — Status of the template rule
    - `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
    - `filter` Filter — 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 — 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
    - `applyToExistingUsers` boolean — Apply this rule to existing users

## Response `200`

Success

- ResponseListMultiResponseTemplateRuleGetDto
  - `result` 'SUCCESS' | 'FAILURE' — The result of the action performed.
  - `data` MultiResponseTemplateRuleGetDto[] — The data generated by the action performed.
    - `result` 'SUCCESS' | 'FAILURE' — The result of the action performed.
    - `statusCode` 200 | 400 | 401 | 403 | 404 | 500 — The HTTP status code for 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
    - `error` ErrorItem[]
      - `type` 'UNKNOWN_ERROR' | 'INVALID_TOKEN' | 'EXPIRED_TOKEN' | 'FORBIDDEN' | 'BAD_REQUEST' | 'JSON_ERROR' | 'DUPLICATE' | 'REQUIRED' | 'INVALID_VALUE' | 'NOT_MODIFIABLE' | 'INVALID_FORMAT' | 'NOT_FOUND' — The type of the error. Safe for programmatic use.
      - `message` string — A human-readable message providing more details about the error. Safe for displaying to a user.
      - `param` string — 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.
  - `error` ErrorItem[]
    - `type` 'UNKNOWN_ERROR' | 'INVALID_TOKEN' | 'EXPIRED_TOKEN' | 'FORBIDDEN' | 'BAD_REQUEST' | 'JSON_ERROR' | 'DUPLICATE' | 'REQUIRED' | 'INVALID_VALUE' | 'NOT_MODIFIABLE' | 'INVALID_FORMAT' | 'NOT_FOUND' — The type of the error. Safe for programmatic use.
    - `message` string — A human-readable message providing more details about the error. Safe for displaying to a user.
    - `param` string — 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.

## Other responses

- `207` — Some template rules failed to save. See response body for error details.
- `400` — All template rules failed to save.
- `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)
