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

# 取引モニタリング ルールライブラリAPI - 150+のプリセット

> DiditのプリセットKYTルールライブラリをAPIで参照できます。ストラクチャリング、ベロシティ、制裁、デバイス、暗号資産、トラベルルールの各バンドルにわたる150+のルールとインストール状況を取得します。

ルールライブラリ一覧取得APIプロンプト
プロンプトをクリップボードにコピー

<pre>
  \`Browse Didit's preset transaction-monitoring rule library.

  Endpoint:
  GET [https://verification.didit.me/v3/transactions/rules/library/](https://verification.didit.me/v3/transactions/rules/library/)

  Authentication:
  Use the x-api-key header with my Didit API key.

  Query parameters (all optional): bundle, category, search, limit, offset.

  Behavior:

  * Returns every library preset with its full configuration (conditions, aggregation, actions) and an is\_installed flag for this application.
  * Check the library before building a custom rule: if an equivalent preset exists, install it via POST /v3/transactions/rules/install/ instead of recreating its logic.
  * Bundles group related presets, e.g. finance, aml\_ctf, anomaly\_detection, fatf, device\_intelligence, crypto\_monitoring, travel\_rule, responsible\_gaming, e\_commerce.\`
</pre>

貼り付け先


## OpenAPI

````yaml ja/openapi-25.json GET /v3/transactions/rules/library/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 本人確認API。x-api-keyヘッダーで認証します。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/transactions/rules/library/:
    get:
      tags:
        - Transactions
      summary: ルールライブラリを一覧表示
      description: >-
        プリセットルールライブラリ（150+件のルール）を閲覧します。各エントリの完全な設定と、このアプリケーションに対する`is_installed`フラグが含まれます。バンドル、カテゴリ、またはフリーテキスト検索でフィルターできます。ルールエンジンがまだ評価できないデータを条件で参照するライブラリルールは、実行可能になるまで非公開となります。非公開のルールは一覧に表示されません。
      operationId: listTransactionRuleLibrary
      parameters:
        - name: bundle
          in: query
          required: false
          schema:
            type: string
          description: バンドルで絞り込み(例:finance、aml_ctf、crypto_monitoring、travel_rule)
        - name: category
          in: query
          required: false
          schema:
            type: string
          description: カテゴリで絞り込み
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: タイトルと説明に対する大文字・小文字を区別しない一致
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: ページサイズ
        - name: offset
          in: query
          required: false
          schema:
            type: integer
          description: ページオフセット
      responses:
        '200':
          description: ページネーションされたライブラリエントリー。
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    nullable: true
                  previous:
                    type: string
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/TransactionRuleLibraryEntry'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/transactions/rules/library/?bundle=finance'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            for item in client.transactions.rules.list_library():
                print(item)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            for await (const item of didit.transactions.rules.listLibrary()) {
              console.log(item);
            }
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\niter := client.Transactions.Rules.ListLibraryAutoPaging(ctx, didit.TransactionsRulesListLibraryParams{})\nfor iter.Next() {\n\tfmt.Printf(\"%+v\\n\", iter.Current())\n}\nif err := iter.Err(); err != nil {\n\tlog.Fatal(err)\n}"
        - lang: java
          label: Java
          source: |-
            import me.didit.Didit;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            for (var item : client.transactions().rules().listLibrary()) {
                System.out.println(item);
            }
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            foreach ($didit->transactions->rules->listLibrary() as $item) {
                print_r($item->toArray());
            }
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            didit.transactions.rules.list_library.auto_paging_each do |item|
              puts item.to_h
            end
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            await foreach (var item in await
            client.Transactions.Rules.ListLibraryAsync())

            {
                Console.WriteLine(JsonSerializer.Serialize(item));
            }
components:
  schemas:
    TransactionRuleLibraryEntry:
      type: object
      properties:
        library_key:
          type: string
        title:
          type: string
        description:
          type: string
          nullable: true
        category:
          type: string
        evaluation_mode:
          type: string
          enum:
            - ALL
            - ANY
        scope:
          $ref: '#/components/schemas/TransactionRuleScope'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRuleCondition'
        aggregation:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRuleAggregation'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRuleAction'
        metadata:
          type: object
        bundle:
          type: string
          nullable: true
          description: >-
            機能分類。例：finance、aml_ctf、crypto_monitoring、travel_rule、responsible_gaming。
        tags:
          type: array
          items:
            type: string
        industries:
          type: array
          items:
            type: string
        source:
          type: string
        is_installed:
          type: boolean
          description: このプリセットが現在アプリケーションにインストールされているかどうか。
    TransactionRuleScope:
      type: object
      properties:
        transaction_types:
          type: array
          items:
            type: string
          description: >-
            取引の種類に限定します（例：finance、kyc、travel_rule、user_event）。空または未指定の場合は制限なしとなります。
        directions:
          type: array
          items:
            type: string
            enum:
              - INBOUND
              - OUTBOUND
          description: 取引の方向に限定します（書き込み時は大文字と小文字を区別しません）。
        action_types:
          type: array
          items:
            type: string
          description: 独自のaction_type値に限定します（例：withdrawal、deposit）。
      description: ルールを適用する取引。受け付けられるキーはこの3つのみです。
    TransactionRuleCondition:
      type: object
      required:
        - field
        - operator
      properties:
        field:
          type: string
          description: >-
            評価する取引フィールドのパス。主要フィールド: amount, currency, direction, action_type,
            score, severity, transaction_type, payment_details,
            preferred_currency_amount（ない場合はamount_in_default_currencyにフォールバック）,
            default_currency_code, subject_country, counterparty_country,
            subject_vendor_data, counterparty_vendor_data,
            subject_device_fingerprint, counterparty_device_fingerprint,
            subject_browser_family, subject_browser_version, subject_platform,
            subject_accept_language, subject_session_age_ms, subject_ip_country,
            counterparty_ip_country, subject_ip_address,
            counterparty_ip_address, subject_payment_method_type,
            subject_payment_method_country, subject_payment_method_fingerprint,
            subject_payment_method_account_id（およびcounterparty_payment_method_*の対応フィールド）,
            travel_rule_status, travel_rule_required,
            travel_rule_obligations_count,
            counterparty_dd_status（トラベルルールの取引相手に対するあなたの判定:
            APPROVED、RESTRICTEDまたはBLOCKED。エンティティはそのブランドの判定に従います）,
            counterparty_risk_level（LOW、MEDIUMまたはHIGH。自社の取引相手スクリーニングでフラグが立っている間はHIGH）,
            counterparty_jurisdiction（取引相手VASPの国）,
            counterparty_responsiveness（RESPONSIVE、UNRESPONSIVEまたはUNKNOWN）,
            subject_days_since_previous_transaction,
            tags、および取引作成時にcustom_propertiesで送信した任意のキーに対するcustom_values.<key>。国コードのフィールドはISO-2またはISO-3を受け付け、比較の前に両側ともISO-3に正規化されます。
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
            - in
            - not_in
            - contains
            - not_contains
            - contains_any
            - regex
            - fuzzy_match
            - exists
            - is_not_empty
            - is_not_null
            - not_exists
            - is_empty
            - is_null
          description: >-
            比較演算子。in/not_inはメンバーシップを判定します(valueにはリストまたは単一のスカラー値を指定できます)。contains/not_containsは文字列値に対して大文字と小文字を区別しない部分文字列チェックを行います。contains_anyは文字列のリストを受け取り、いずれかがフィールド値の部分文字列(大文字と小文字を区別しない)である場合に一致します。regexはvalueのパターンをフィールドに照合します。fuzzy_matchはvalueの文字列と比較し、必要な`score`しきい値(0-100)を適用します。gt/gte/lt/lteは、どちらか一方が欠落している場合は一致しません。exists/is_not_empty/is_not_null(エイリアス)およびnot_exists/is_empty/is_null(エイリアス)は存在チェックであり、`value`を無視します。
        value:
          description: >-
            比較値。形式は演算子とvalue_typeによって異なります。存在チェックの演算子では省略してください。それ以外のすべての演算子では`null`や空のリストではない値が必要で、そうでない場合ルールは`400`で拒否されます。`contains_any`には文字列のリストが、`contains`、`not_contains`、`regex`には単一の文字列が必要です。
        value_type:
          type: string
          enum:
            - list
            - field
            - relative_date
          description: >-
            任意の値の解釈方法です。`list`：値はリストのUUIDで、リストのエントリーが比較値になります。`field`：値は別のフィールドパスで、フィールド同士で比較されます。`relative_date`：値は相対日付オブジェクトです（例：{"direction":
            "past", "unit": "days", "amount": 30}）。
        score:
          type: number
          minimum: 0
          maximum: 100
          description: operatorがfuzzy_matchの場合は必須：0〜100の類似度しきい値。
        group_index:
          type: integer
          description: >-
            任意のグループ化ロジックです。いずれかの条件にgroup_indexが含まれる場合、同じインデックスを持つ条件がグループを形成し、evaluation_modeの代わりにグループ単位の評価が行われます。
        group_logic:
          type: string
          enum:
            - AND
            - OR
          default: AND
          description: グループ「内」で条件をどのように組み合わせるかを指定します。
        groups_logic:
          type: string
          enum:
            - AND
            - OR
          default: OR
          description: グループ「間」で各グループの結果をどのように組み合わせるかを指定します。最初の条件から読み取られます。
      description: 条件は評価対象の取引のみを読み取ります。集計ウィンドウを絞り込むことはありません。
    TransactionRuleAggregation:
      type: object
      required:
        - value
      properties:
        metric:
          type: string
          enum:
            - count
            - sum
            - max
            - min
            - avg
            - distinct_count
          default: count
          description: 一致する過去の取引の集計方法。unique_countはdistinct_countの別名として受け付けられます。
        field:
          type: string
          default: amount
          description: sum/max/min/avg/distinct_countで集計するフィールド。countでは無視されます。
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
          default: eq
          description: 算出された指標に適用される比較。
        value:
          type: number
          description: 算出された指標と比較されるしきい値。
        window:
          type: string
          pattern: ^\d+(m|h|d)$
          default: 1d
          description: >-
            取引のtxn_dateを終点とする遡及期間: <N>m（月ではなく分）、<N>h（時間）、または<N>d（日）。例:
            30m、24h、7d、30d。
        filters:
          type: object
          additionalProperties: true
          description: >-
            集計の対象となる過去の取引を絞り込みます。キーは条件フィールドカタログのフィールドパスです。値に"__current__"を指定すると、評価中の取引における同じフィールドの値に解決されます（例:
            {"subject_vendor_data":
            "__current__"}は期間を同一の対象者に限定します）。リスト値は、そのいずれかに含まれることを意味します。フィルターの比較は等価または包含のみです。lt/gteのフィルターはないため、「10,000未満の過去の取引」のような範囲はここでは表現できません。範囲はメトリクス側で指定してください（メトリクスmaxと演算子ltを組み合わせると、期間内のすべての取引がしきい値未満であることを条件にできます）。
      description: >-
        ウィンドウ内のアプリケーションの過去の取引に対するベロシティチェックです。evaluation_modeにかかわらず、ルールが一致するにはすべての集計エントリーが一致する必要があります。集計が制約するのはウィンドウのみです。評価対象の取引はscopeとconditionsによって制約されるため、ルールでdirection、currency、transaction_typeを保証する場合は、その両方に同じ条件を繰り返し指定してください。
    TransactionRuleAction:
      oneOf:
        - $ref: '#/components/schemas/TransactionRuleActionAddScore'
        - $ref: '#/components/schemas/TransactionRuleActionChangeStatus'
        - $ref: '#/components/schemas/TransactionRuleActionAddTags'
        - $ref: '#/components/schemas/TransactionRuleActionAddNote'
        - $ref: '#/components/schemas/TransactionRuleActionAddToList'
        - $ref: '#/components/schemas/TransactionRuleActionOpenCase'
      discriminator:
        propertyName: type
        mapping:
          add_score: '#/components/schemas/TransactionRuleActionAddScore'
          change_status: '#/components/schemas/TransactionRuleActionChangeStatus'
          add_tags: '#/components/schemas/TransactionRuleActionAddTags'
          add_note: '#/components/schemas/TransactionRuleActionAddNote'
          add_to_list: '#/components/schemas/TransactionRuleActionAddToList'
          open_case: '#/components/schemas/TransactionRuleActionOpenCase'
      description: >-
        ルールのアクション1件です。1つのルールに複数のアクションを設定でき、ルールに一致した場合はすべてが同時に適用されます。TESTモードのルールは、アクションを一切適用せずに、実行していたはずの内容を記録します。
    TransactionRuleActionAddScore:
      type: object
      required:
        - type
        - value
      properties:
        type:
          type: string
          enum:
            - add_score
        value:
          type: integer
          description: 取引のリスクスコアに加算されるポイント。負の値になる場合があります。
      description: 取引の累積リスクスコアにポイントを加算します。合計値に応じて、アプリケーションのレビュー/却下のしきい値に基づきステータスが決まります。
    TransactionRuleActionChangeStatus:
      type: object
      required:
        - type
        - value
      properties:
        type:
          type: string
          enum:
            - change_status
        value:
          type: string
          enum:
            - APPROVED
            - IN_REVIEW
            - DECLINED
            - AWAITING_USER
          description: 'スコアに関係なく、即時に設定するステータス。エイリアスキー: status。'
        workflow_id:
          type: string
          format: uuid
          description: >-
            値がAWAITING_USERの場合は必須です。対象者に完了を求める認証ワークフローです。エイリアスキー:
            remediation_workflow_id。ルールが発動すると、Diditは対象者向けにホスト型の是正セッションを作成します。
      description: 取引ステータスを直接設定します。一致した複数のルールの間では、常にDECLINEDが優先されます。
    TransactionRuleActionAddTags:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - add_tags
        tag_uuid:
          type: string
          format: uuid
          description: 付与する既存のアプリケーションタグです。
        tag_name:
          type: string
          description: 付与するタグ名。初回使用時に作成されます(大文字で保存)。tag_uuidまたはtag_nameのいずれかを指定してください。
        tag_color:
          type: string
          description: 'tag_nameで新しいタグを作成する際に使用する16進カラーコードです。例: #007AFE。'
      description: 一致した取引にアプリケーションタグを付けます。
    TransactionRuleActionAddNote:
      type: object
      required:
        - type
        - note
      properties:
        type:
          type: string
          enum:
            - add_note
        note:
          type: string
          description: '取引に添付されたメモのテキスト（作成者: Rule Engine）。エイリアスキー: value。'
      description: 一致した取引に自動アナリストメモを添付します。
    TransactionRuleActionAddToList:
      type: object
      required:
        - type
        - list_id
      properties:
        type:
          type: string
          enum:
            - add_to_list
        list_id:
          type: string
          format: uuid
          description: サブジェクトのvendor_dataを追加するリスト。
      description: 対象者のvendor_dataをブロックリスト、許可リスト、またはカスタムリストに追加します。
    TransactionRuleActionOpenCase:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - open_case
        blueprint:
          type: string
          format: uuid
          description: ケースブループリントのUUID。デフォルトはアプリケーションのデフォルトブループリントです。
        grouping:
          type: string
          enum:
            - by_applicant
            - by_rule_and_applicant
          description: 繰り返しの一致を申請者ごとに1つのケースにまとめるか、ルールと申請者の組み合わせごとに1つのケースにまとめるかです。
        attach_matched_transaction:
          type: boolean
          description: 一致した取引をケースに添付します。
      description: 調査ケースを開きます（または既存のケースに追加します）。1つのルールでは、最初のopen_caseアクションのみが適用されます。
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        お客様のアプリケーションのAPIキーです。Business ConsoleのDevelopers -> API
        keysで取得できます。プライマリキーはフルアクセス権を持ちます。名前付きキーにはスコープを設定できます。リソースごとのアクセス権（なし、読み取り、書き込み）、一部のワークフローまたは承認済みセッションへの限定、IPアドレスのリストへの限定、有効期限の設定です。401は、キーが誤っている、失効している、または期限切れであることを意味します。403は、キーが送信されていない、キーにこのリソースやアクションへのアクセス権がない、またはIPリスト外のアドレスからリクエストが送信されたことを意味します。セッションのルートでの404は、セッションがキーのワークフローまたはステータスの対象外であることを意味します。メディアへのアクセス権がないキーでは、画像、動画、PDFのURLがnullで返されます。セッションの書き込み権限がないキーでは、セッションのリンクとトークンがnullで返されます。詳細は次を参照してください:
        https://docs.didit.me/console/api-keys

````

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