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

# List rule templates

> Returns a read-only set of starter rules — worked examples covering large amounts, high-risk countries, cross-border transfers, round amounts and repeated transfers. Nothing here is active; copy one into a create call and adjust its thresholds and country codes to your own risk position before activating it.



## OpenAPI

````yaml /openapi/transaction-monitoring.json get /api/v1/rules/library/
openapi: 3.0.3
info:
  title: iDenfy Transaction Monitoring API
  version: v1
  description: >-
    Submit transactions and events for AML monitoring, and read back the alerts,
    cases and reports they produce.
servers:
  - url: https://ivs-tx-monitoring.idenfy.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Ingest
    description: Submit transactions and events for monitoring.
  - name: Transactions
    description: Read back submitted transactions and their rule hits.
  - name: Rules
    description: Detection rules evaluated against every submission.
  - name: Alerts
    description: Alerts opened when a rule matches.
  - name: Investigations
    description: Cases opened from one or more alerts.
  - name: SARs
    description: Suspicious activity reports and their attachments.
  - name: Sanctions screening
    description: Sanctions and PEP screening of transaction parties.
  - name: AML monitoring
    description: Ongoing AML monitoring of screened parties.
  - name: Party suspensions
    description: ''
  - name: Webhooks
    description: Outbound event delivery to your endpoints.
  - name: Custom fields
    description: Your own transaction attributes, declared so rules can match them.
  - name: Reference lists
    description: Named value lists rules can reference.
  - name: Notification rules
    description: Slack and email notifications for alerts.
  - name: Reports
    description: Generated compliance reports.
paths:
  /api/v1/rules/library/:
    get:
      tags:
        - Rules
      summary: List rule templates
      description: >-
        Returns a read-only set of starter rules — worked examples covering
        large amounts, high-risk countries, cross-border transfers, round
        amounts and repeated transfers. Nothing here is active; copy one into a
        create call and adjust its thresholds and country codes to your own risk
        position before activating it.
      operationId: rules_library_retrieve
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResponse'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RuleResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Primary key
        partnerId:
          type: integer
          readOnly: true
        partnerInSandbox:
          type: boolean
          readOnly: true
          description: >-
            Whether the rule's partner is in the sandbox, where rules cannot be
            archived
        name:
          type: string
          readOnly: true
          description: Human-readable rule name
        description:
          type: string
          readOnly: true
          nullable: true
          description: Free-form description of what the rule detects
        sqlQuery:
          type: string
          readOnly: true
          description: >-
            Bare WHERE-clause fragment for single rules; auto-summary text for
            velocity rules
        module:
          allOf:
            - $ref: '#/components/schemas/CustomFieldAppliesTo'
          readOnly: true
          description: |-
            Ingest surface this rule evaluates against

            * `BANK_PAYMENT` - Bank Payment
            * `CREDIT_CARD` - Credit Card
            * `CRYPTO_TRANSFER` - Crypto Transfer
            * `CUSTOM_EVENT` - Custom Event
            * `ALL` - All
        severity:
          allOf:
            - $ref: '#/components/schemas/SeverityEnum'
          readOnly: true
          description: |-
            Severity copied onto matches

            * `CRITICAL` - Critical
            * `HIGH` - High
            * `MEDIUM` - Medium
            * `LOW` - Low
        status:
          allOf:
            - $ref: '#/components/schemas/RuleResponseStatusEnum'
          readOnly: true
          description: |-
            Lifecycle state of the rule

            * `DRAFT` - Draft
            * `ACTIVE` - Active
            * `INACTIVE` - Inactive
            * `ARCHIVED` - Archived
        version:
          type: integer
          readOnly: true
          description: Bumped on every update via Rule.apply_update()
        isSystem:
          type: boolean
          readOnly: true
          description: True for partner-seeded starter rules
        createdBy:
          type: integer
          description: Unique identifier of the user
          readOnly: true
        riskScore:
          type: integer
          readOnly: true
          description: Risk score copied onto matching alerts (0-100)
        startingTier:
          type: integer
          readOnly: true
          description: Tier level alerts from this rule open at
        outcomeStatus:
          allOf:
            - $ref: '#/components/schemas/RuleOutcomeStatus'
          readOnly: true
          description: >-
            What a match does: FLAGGED (review, not held), BLOCKED (held),
            REJECTED (refused, no alert) or SUSPEND_PROFILE (held, and the
            customer suspended)


            * `FLAGGED` - Flagged

            * `BLOCKED` - Blocked

            * `REJECTED` - Rejected

            * `SUSPEND_PROFILE` - Suspend profile
        blocksTransaction:
          type: boolean
          readOnly: true
          description: >-
            True when `outcome_status` holds the payment (BLOCKED or
            SUSPEND_PROFILE). Read-only: set it through `outcome_status`, which
            this field mirrors
        testPayload:
          readOnly: true
          nullable: true
          description: Saved sample payload used by the rule test/sandbox endpoint
        ruleType:
          allOf:
            - $ref: '#/components/schemas/RuleType'
          readOnly: true
          description: |-
            Evaluation mechanism for this rule

            * `SINGLE` - Single
            * `VELOCITY` - Velocity
            * `BEHAVIOURAL` - Unusual behaviour
        velocityConfig:
          readOnly: true
          nullable: true
          description: >-
            Velocity window config:
            metric/field/group_by_fields/window/threshold. `group_by_fields` is
            an ordered 1-6 element allow-listed list; `group_by` mirrors
            group_by_fields[0] and is maintained for backward compatibility
        behaviourConfig:
          readOnly: true
          nullable: true
          description: >-
            Unusual-behaviour config: how this transaction is compared against
            the party's own history. Keyed by `behaviour_type` — DEVIATION
            carries observation/baseline_metric/deviation_type, NOVELTY carries
            novel_attribute; both carry subject_fields, the window and
            min_baseline_count. Separate from `velocity_config` because the two
            shapes share only `filter_sql` and the comparator, and a reader
            could not tell them apart without first consulting `rule_type`
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        hitCount:
          type: integer
          readOnly: true
          description: Alerts this rule has produced, test-transaction firings included
        testHitCount:
          type: integer
          readOnly: true
          description: >-
            How many of `hit_count` came from test transactions rather than live
            traffic
        lastTriggeredAt:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the rule last produced an alert
        evaluationCount:
          type: integer
          readOnly: true
          description: >-
            Times this rule has been evaluated against a transaction since
            counters_reset_at
        noOpinionCount:
          type: integer
          readOnly: true
          description: >-
            Times this rule could reach no verdict because the party had too
            little history. Only behavioural rules can produce this; a threshold
            rule always has an opinion
        noOpinionRate:
          type: number
          format: double
          readOnly: true
          description: >-
            Share of evaluations this rule reached no verdict on, or null below
            a usable sample. Only behavioural rules can be non-null
        countersResetAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: >-
            When evaluation_count/no_opinion_count last started from zero. Reset
            whenever the config changes, so the counters describe the rule as it
            is now rather than as it once was
        referencedLists:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
          description: >-
            Reference lists the rule tests against with IN LIST, as {id, name,
            valueType}; id is null for a list that no longer exists, which makes
            the rule fail on every transaction
      required:
        - behaviourConfig
        - blocksTransaction
        - countersResetAt
        - createdAt
        - createdBy
        - description
        - evaluationCount
        - hitCount
        - id
        - isSystem
        - lastTriggeredAt
        - module
        - name
        - noOpinionCount
        - noOpinionRate
        - outcomeStatus
        - partnerId
        - partnerInSandbox
        - referencedLists
        - riskScore
        - ruleType
        - severity
        - sqlQuery
        - startingTier
        - status
        - testHitCount
        - testPayload
        - updatedAt
        - velocityConfig
        - version
    CustomFieldAppliesTo:
      enum:
        - ALL
        - BANK_PAYMENT
        - CREDIT_CARD
        - CRYPTO_TRANSFER
        - CUSTOM_EVENT
      type: string
      description: |-
        * `ALL` - All
        * `BANK_PAYMENT` - Bank Payment
        * `CREDIT_CARD` - Credit Card
        * `CRYPTO_TRANSFER` - Crypto Transfer
        * `CUSTOM_EVENT` - Custom Event
    SeverityEnum:
      enum:
        - CRITICAL
        - HIGH
        - MEDIUM
        - LOW
      type: string
      description: |-
        * `CRITICAL` - Critical
        * `HIGH` - High
        * `MEDIUM` - Medium
        * `LOW` - Low
    RuleResponseStatusEnum:
      enum:
        - DRAFT
        - ACTIVE
        - INACTIVE
        - ARCHIVED
      type: string
      description: |-
        * `DRAFT` - Draft
        * `ACTIVE` - Active
        * `INACTIVE` - Inactive
        * `ARCHIVED` - Archived
    RuleOutcomeStatus:
      enum:
        - FLAGGED
        - BLOCKED
        - REJECTED
        - SUSPEND_PROFILE
      type: string
      description: |-
        * `FLAGGED` - Flagged
        * `BLOCKED` - Blocked
        * `REJECTED` - Rejected
        * `SUSPEND_PROFILE` - Suspend profile
    RuleType:
      enum:
        - SINGLE
        - VELOCITY
        - BEHAVIOURAL
      type: string
      description: |-
        * `SINGLE` - Single
        * `VELOCITY` - Velocity
        * `BEHAVIOURAL` - Unusual behaviour
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

## Related topics

- [List rules](https://documentation.idenfy.com/api-reference/transaction-monitoring/rules/list-rules.md)
- [List notification rules](https://documentation.idenfy.com/api-reference/transaction-monitoring/notification-rules/list-notification-rules.md)
- [List a rule's changes](https://documentation.idenfy.com/api-reference/transaction-monitoring/rules/list-a-rules-changes.md)
- [List rule changes](https://documentation.idenfy.com/api-reference/transaction-monitoring/rules/list-rule-changes.md)
- [List the rules a transaction matched](https://documentation.idenfy.com/api-reference/transaction-monitoring/transactions/list-the-rules-a-transaction-matched.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.