> ## 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

> Didit Management APIで、アプリケーションのKYTルール（プリセットとカスタム）を一覧取得できます。ソース、カテゴリ、モード、バンドル、検索によるフィルターと、パフォーマンスに基づく並べ替えに対応しています。

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

<pre>
  \`List the transaction-monitoring rules of my Didit application.

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

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

  Query parameters (all optional):

  * source: PRESET | CUSTOM
  * category, mode (ACTIVE | DISABLED | TEST), bundle, search
  * ordering: comma-separated from run\_count, approved\_pct, reviewed\_pct, declined\_pct, latest\_triggered\_at, title, created\_at, source (prefix with - for descending; default source,-run\_count)
  * limit, offset for pagination

  Behavior:

  * The list returns your custom rules plus any library presets you have installed (see the install endpoint).
  * Each row carries the full rule configuration (scope, conditions, aggregation, actions) plus execution counters (run\_count, approved/reviewed/declined percentages, latest\_triggered\_at).
  * Titles are unique per application - read this list before creating a rule to avoid a duplicate-title 400.

  Full guide: /transaction-monitoring/rules-api.\`
</pre>

貼り付け先


## OpenAPI

````yaml ja/openapi-25.json GET /v3/transactions/rules/
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/:
    get:
      tags:
        - Transactions
      summary: ルールを一覧表示
      description: >-
        アプリケーションのトランザクションモニタリングルール(独自のカスタムルールと、インストール済みのライブラリプリセット)を一覧表示します。source、category、mode、bundle、またはフリーテキスト検索でフィルターでき、`ordering`で並べ替えます(run_count、approved_pct、reviewed_pct、declined_pct、latest_triggered_at、title、created_at、sourceで、いずれも任意で`-`プレフィックスを付けられます)。
      operationId: listTransactionRules
      parameters:
        - name: source
          in: query
          required: false
          schema:
            type: string
            enum:
              - PRESET
              - CUSTOM
          description: PRESETまたはCUSTOM
        - name: category
          in: query
          required: false
          schema:
            type: string
          description: ルールカテゴリで絞り込み
        - name: mode
          in: query
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - DISABLED
              - TEST
          description: ACTIVE、DISABLED、またはTEST
        - name: bundle
          in: query
          required: false
          schema:
            type: string
          description: バンドルでプリセットを絞り込みます
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: タイトルと説明に対する大文字・小文字を区別しない一致
        - name: ordering
          in: query
          required: false
          schema:
            type: string
          description: カンマ区切りの並べ替えフィールド。デフォルトはsource,-run_countです。
        - 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/TransactionRuleDetail'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/transactions/rules/?source=CUSTOM&ordering=-run_count'
            \
              -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():
                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.list()) {
              console.log(item);
            }
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\niter := client.Transactions.Rules.ListAutoPaging(ctx, didit.TransactionsRulesListParams{})\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().list()) {
                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->list() 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.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.ListAsync())

            {
                Console.WriteLine(JsonSerializer.Serialize(item));
            }
components:
  schemas:
    TransactionRuleDetail:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        title:
          type: string
          description: ルール名。アプリケーション内の削除されていないルールの間で一意である必要があり、重複する場合は400が返されます。
        description:
          type: string
          nullable: true
        category:
          type: string
          description: >-
            グループ化とレポートに使用されるリスクテーマです。例:
            finance、aml_ctf、anomaly_detection、fatf、device_intelligence、crypto_monitoring、travel_rule、responsible_gaming、e_commerce。
        mode:
          type: string
          enum:
            - ACTIVE
            - DISABLED
            - TEST
          description: >-
            ACTIVEは本番で評価します。TESTは評価してルールの実行を記録しますが、スコアやステータスには一切影響しません。最初に推奨されるモードです。DISABLEDはスキップされます。
        evaluation_mode:
          type: string
          enum:
            - ALL
            - ANY
          default: ALL
          description: >-
            すべての条件に一致する必要がある（ALL）か、少なくとも1つに一致すればよい（ANY）かです。条件でgroup_indexを使用する場合は無視されます。
        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
          description: ルールに保存される自由形式のメタデータ。
        severity:
          type: string
          enum:
            - UNKNOWN
            - LOW
            - MEDIUM
            - HIGH
            - CRITICAL
          nullable: true
          description: ライブラリルールが持つ情報レベルの重大度。カスタムルールでは設定できません。
        source:
          type: string
          enum:
            - PRESET
            - CUSTOM
          description: >-
            PRESETルールはライブラリから提供されます（インストール/アンインストール、モードのみの編集）。CUSTOMルールは完全にお客様のものです。
        library_key:
          type: string
          nullable: true
          description: 安定したライブラリ識別子。カスタムルールの場合はnullです。
        latest_triggered_at:
          type: string
          format: date-time
          nullable: true
        run_count:
          type: integer
          description: このルールに一致した取引の数。
        approved_count:
          type: integer
        reviewed_count:
          type: integer
        declined_count:
          type: integer
        awaiting_user_count:
          type: integer
        approved_pct:
          type: number
        reviewed_pct:
          type: number
        declined_pct:
          type: number
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    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.