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

# Get a Classification Rule

> **Scopes:** `classification_rule:read`



## OpenAPI

````yaml /api-reference/openapi.json get /v0/business/{business_id}/rules/classifications/{rule_id}
openapi: 3.1.0
info:
  title: Asset API
  version: '0.1'
servers:
  - url: https://api.sandbox.getasset.com
    description: Sandbox
  - url: https://api.getasset.com
    description: Production
security: []
paths:
  /v0/business/{business_id}/rules/classifications/{rule_id}:
    get:
      tags:
        - Classification Rules
      summary: Get a Classification Rule
      description: '**Scopes:** `classification_rule:read`'
      operationId: >-
        get_classification_rule_v0_business__business_id__rules_classifications__rule_id__get
      parameters:
        - name: business_id
          in: path
          required: true
          schema:
            description: The id of the business
            examples:
              - biz_GA6EG2qFxA97NZHtxeLPUy
            type: string
            format: biz_string
            title: Business Id
          description: The id of the business
        - name: rule_id
          in: path
          required: true
          schema:
            description: The id of the classification rule
            examples:
              - clr_GA6EG2qFxA97NZHtxeLPUy
            type: string
            format: clr_string
            title: Rule Id
          description: The id of the classification rule
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TxnClassificationRulePublic'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer:
            - classification_rule:read
components:
  schemas:
    TxnClassificationRulePublic:
      properties:
        merchant:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Merchant
          description: >-
            Case-insensitive exact merchant name to match. Mutually exclusive
            with the description criterion; exactly one of the two is required.
          examples:
            - Starbucks
        description_match_type:
          anyOf:
            - $ref: '#/components/schemas/DescriptionMatchType'
            - type: 'null'
          description: How to match the transaction description.
        description_value:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Description Value
          description: Description text to match, case-insensitive.
          examples:
            - MONTHLY SOFTWARE SUBSCRIPTION
        id:
          type: string
          format: clr_string
          title: Id
          description: The id of the classification rule
          examples:
            - clr_GA6EG2qFxA97NZHtxeLPUy
        classifications:
          items:
            $ref: '#/components/schemas/BusinessTxnClassificationPublic'
          type: array
          title: Classifications
          description: >-
            Classifications evaluated in order. Categorization applies the first
            one whose conditions match and that has a target ledger; tagging
            applies the tags of every one whose conditions match.
        auto_confirm:
          type: boolean
          title: Auto Confirm
        is_active:
          type: boolean
          title: Is Active
          description: Whether the rule takes part in categorization and tagging.
        match_count:
          type: integer
          title: Match Count
          description: Number of transactions the rule has matched.
        last_matched_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Matched At
          description: When the rule last matched a transaction.
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - classifications
        - auto_confirm
        - is_active
        - match_count
        - created_at
      title: TxnClassificationRulePublic
    ErrorResponse:
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: A description of the error
        data:
          title: Data
          description: Data associated with the error
      type: object
      required:
        - error
        - data
      title: ErrorResponse
    DescriptionMatchType:
      type: string
      enum:
        - contains
        - not_contains
        - equals
      title: DescriptionMatchType
    BusinessTxnClassificationPublic:
      properties:
        conditions:
          $ref: >-
            #/components/schemas/BusinessTxnClassificationConditionsSchema-Output
          description: >-
            Conditions the transaction must satisfy for this classification to
            apply.
        target_ledger_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Target Ledger Id
          description: >-
            The ledger to categorize the transaction into; null for a
            classification that only tags.
        target_ledger_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Ledger Name
          description: Snapshot of the target ledger name at rule creation.
        tags:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
          title: Tags
          description: Tag field name to the values applied.
      type: object
      required:
        - conditions
        - tags
      title: BusinessTxnClassificationPublic
    BusinessTxnClassificationConditionsSchema-Output:
      properties:
        amount:
          anyOf:
            - $ref: '#/components/schemas/AmountPredicate-Output'
            - type: 'null'
          description: Amount constraint; omit to match any amount.
        direction:
          anyOf:
            - $ref: '#/components/schemas/TransactionDirection'
            - type: 'null'
          description: >-
            Match money in (positive amounts) or money out (negative amounts).
            Zero-amount transactions match neither. Omit to match either.
        date:
          anyOf:
            - $ref: '#/components/schemas/DatePredicate'
            - type: 'null'
          description: Date constraint; omit to match any date.
        external_account_id:
          anyOf:
            - type: string
              format: eac_string
            - type: 'null'
          title: External Account Id
          description: >-
            The external account whose transactions this classification matches.
            Null matches transactions from any of the business's accounts.
          examples:
            - eac_GA6EG2qFxA97NZHtxeLPUy
      type: object
      title: BusinessTxnClassificationConditionsSchema
    AmountPredicate-Output:
      properties:
        operator:
          $ref: '#/components/schemas/AmountMatchType'
          description: How to compare the transaction amount.
        value:
          type: number
          title: Value
          description: >-
            Absolute home-currency amount to compare against; the inclusive
            lower bound when operator is between.
          examples:
            - 100
        max_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Value
          description: Inclusive upper bound, set only when operator is between.
          examples:
            - 250
      type: object
      required:
        - operator
        - value
      title: AmountPredicate
    TransactionDirection:
      type: string
      enum:
        - money_in
        - money_out
      title: TransactionDirection
    DatePredicate:
      properties:
        operator:
          $ref: '#/components/schemas/DateMatchType'
          description: How to compare the transaction date (UTC calendar date).
        value:
          type: string
          format: date
          title: Value
          description: >-
            Date to compare against; the inclusive lower bound when operator is
            between.
        max_value:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Max Value
          description: Inclusive upper bound, set only when operator is between.
      type: object
      required:
        - operator
        - value
      title: DatePredicate
    AmountMatchType:
      type: string
      enum:
        - equals
        - greater_than
        - less_than
        - between
      title: AmountMatchType
    DateMatchType:
      type: string
      enum:
        - equals
        - before
        - after
        - between
      title: DateMatchType
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /v0/auth/token

````