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

# List Rules

> List the application's transaction-monitoring rules: your custom rules plus any library presets you have installed. Filter by source, category, mode, bundle or free-text search; order with `ordering` (run_count, approved_pct, reviewed_pct, declined_pct, latest_triggered_at, title, created_at, source, each with an optional `-` prefix).

export const AgentPromptAccordion = ({prompt, title = "AI Agent Integration Prompt"}) => {
  const [copied, setCopied] = React.useState(false);
  const handleCopy = e => {
    e.stopPropagation();
    if (!prompt) return;
    navigator.clipboard.writeText(prompt.trim()).then(() => {
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    });
  };
  const agents = ["Claude Code", "Codex", "Cursor", "Devin", "Windsurf", "GitHub Copilot"];
  return <div className="didit-agent-card">
      {}
      <div className="didit-agent-titlebar">
        <div className="didit-agent-dots" aria-hidden="true">
          <span className="didit-agent-dot didit-agent-dot-red"></span>
          <span className="didit-agent-dot didit-agent-dot-yellow"></span>
          <span className="didit-agent-dot didit-agent-dot-green"></span>
        </div>
        <span className="didit-agent-filename">{title}</span>
        <button type="button" className={`didit-agent-copy ${copied ? "didit-agent-copy-copied" : ""}`} onClick={handleCopy} title="Copy prompt to clipboard" aria-label={copied ? "Copied!" : "Copy prompt to clipboard"}>
          {copied ? <>
              <svg width="13" height="13" viewBox="0 0 16 16" fill="none">
                <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
              </svg>
              <span>Copied</span>
            </> : <>
              <svg width="13" height="13" viewBox="0 0 16 16" fill="none">
                <rect x="5" y="5" width="9" height="9" rx="1.5" stroke="currentColor" strokeWidth="1.5" />
                <path d="M11 5V3.5A1.5 1.5 0 0 0 9.5 2h-6A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5" stroke="currentColor" strokeWidth="1.5" />
              </svg>
              <span>Copy</span>
            </>}
        </button>
      </div>

      {}
      <pre className="didit-agent-body"><code>{prompt.trim()}</code></pre>

      {}
      <div className="didit-agent-footer">
        <span className="didit-agent-footer-label">Paste into</span>
        <div className="didit-agent-chips">
          {agents.map(name => <span key={name} className="didit-agent-chip">{name}</span>)}
        </div>
      </div>
    </div>;
};

<AgentPromptAccordion
  title="List Rules API Prompt"
  prompt={`List the transaction-monitoring rules of my Didit application.

Endpoint:
GET 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.`}
/>


## OpenAPI

````yaml GET /v3/transactions/rules/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/transactions/rules/:
    get:
      tags:
        - Transactions
      summary: List rules
      description: >-
        List the application's transaction-monitoring rules: your custom rules
        plus any library presets you have installed. Filter by source, category,
        mode, bundle or free-text search; order with `ordering` (run_count,
        approved_pct, reviewed_pct, declined_pct, latest_triggered_at, title,
        created_at, source, each with an optional `-` prefix).
      operationId: listTransactionRules
      parameters:
        - name: source
          in: query
          required: false
          schema:
            type: string
            enum:
              - PRESET
              - CUSTOM
          description: PRESET or CUSTOM
        - name: category
          in: query
          required: false
          schema:
            type: string
          description: Filter by rule category
        - name: mode
          in: query
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - DISABLED
              - TEST
          description: ACTIVE, DISABLED or TEST
        - name: bundle
          in: query
          required: false
          schema:
            type: string
          description: Filter presets by bundle
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: Case-insensitive match against title and description
        - name: ordering
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated ordering fields, default source,-run_count
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: Page size
        - name: offset
          in: query
          required: false
          schema:
            type: integer
          description: Page offset
      responses:
        '200':
          description: Paginated rules.
          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'
components:
  schemas:
    TransactionRuleDetail:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        title:
          type: string
          description: >-
            Rule name. Unique per application among non-deleted rules;
            duplicates return 400.
        description:
          type: string
          nullable: true
        category:
          type: string
          description: >-
            Risk theme used for grouping and reporting, e.g. 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 evaluates live. TEST evaluates and records rule runs but
            never touches score or status - the recommended starting mode.
            DISABLED is skipped.
        evaluation_mode:
          type: string
          enum:
            - ALL
            - ANY
          default: ALL
          description: >-
            Whether every condition must match (ALL) or at least one (ANY).
            Ignored when conditions use 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: Free-form metadata stored on the rule.
        severity:
          type: string
          enum:
            - UNKNOWN
            - LOW
            - MEDIUM
            - HIGH
            - CRITICAL
          nullable: true
          description: >-
            Informational severity carried by library rules; not settable on
            custom rules.
        source:
          type: string
          enum:
            - PRESET
            - CUSTOM
          description: >-
            PRESET rules come from the library (install/uninstall, mode-only
            edits); CUSTOM rules are fully yours.
        library_key:
          type: string
          nullable: true
          description: Stable library identifier; null for custom rules.
        latest_triggered_at:
          type: string
          format: date-time
          nullable: true
        run_count:
          type: integer
          description: How many transactions matched this rule.
        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: >-
            Restrict to transaction types, e.g. finance, kyc, travel_rule,
            user_event. Empty or missing = no restriction.
        directions:
          type: array
          items:
            type: string
            enum:
              - INBOUND
              - OUTBOUND
          description: Restrict to transaction directions (case-insensitive on write).
        action_types:
          type: array
          items:
            type: string
          description: Restrict to your action_type values, e.g. withdrawal, deposit.
      description: >-
        Which transactions the rule applies to. Only these three keys are
        accepted.
    TransactionRuleCondition:
      type: object
      required:
        - field
        - operator
      properties:
        field:
          type: string
          description: >-
            Transaction field path to evaluate. Core fields: amount, currency,
            direction, action_type, score, severity, transaction_type,
            payment_details, preferred_currency_amount (falls back to
            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 (and the
            counterparty_payment_method_* equivalents), travel_rule_status,
            travel_rule_required, travel_rule_obligations_count,
            subject_days_since_previous_transaction, tags, and
            custom_values.<key> for any key submitted in custom_properties on
            transaction create. Country-code fields accept ISO-2 or ISO-3; both
            sides are normalized to ISO-3 before comparison.
        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: >-
            Comparison operator. in/not_in test membership (value may be a list
            or a single scalar). contains/not_contains are case-insensitive
            substring checks against a string value. contains_any takes a list
            of strings and matches when any is a case-insensitive substring of
            the field value. regex matches the value pattern against the field.
            fuzzy_match compares against the value string with the required
            `score` threshold (0-100). gt/gte/lt/lte never match when either
            side is missing. exists/is_not_empty/is_not_null (aliases) and
            not_exists/is_empty/is_null (aliases) are presence checks that
            ignore `value`.
        value:
          description: >-
            Comparison value. Its shape depends on the operator and value_type;
            omit for the presence-check operators.
        value_type:
          type: string
          enum:
            - list
            - field
            - relative_date
          description: >-
            Optional value interpretation. `list`: value is a List UUID and the
            list's entries become the comparison value. `field`: value is
            another field path, compared field-to-field. `relative_date`: value
            is a relative-date object, e.g. {"direction": "past", "unit":
            "days", "amount": 30}.
        score:
          type: number
          minimum: 0
          maximum: 100
          description: >-
            Required when operator is fuzzy_match: the 0-100 similarity
            threshold.
        group_index:
          type: integer
          description: >-
            Optional grouped logic. When any condition carries group_index,
            conditions sharing an index form a group and grouped evaluation
            replaces evaluation_mode.
        group_logic:
          type: string
          enum:
            - AND
            - OR
          default: AND
          description: How conditions combine WITHIN a group.
        groups_logic:
          type: string
          enum:
            - AND
            - OR
          default: OR
          description: >-
            How group outcomes combine ACROSS groups. Read from the first
            condition.
      description: >-
        A condition reads only the transaction being evaluated - it never
        filters the aggregation window.
    TransactionRuleAggregation:
      type: object
      required:
        - value
      properties:
        metric:
          type: string
          enum:
            - count
            - sum
            - max
            - min
            - avg
            - distinct_count
          default: count
          description: >-
            How the matching historical transactions are aggregated.
            unique_count is accepted as an alias of distinct_count.
        field:
          type: string
          default: amount
          description: >-
            Field aggregated by sum/max/min/avg/distinct_count. Ignored for
            count.
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
          default: eq
          description: Comparison applied to the computed metric.
        value:
          type: number
          description: Threshold the computed metric is compared against.
        window:
          type: string
          pattern: ^\d+(m|h|d)$
          default: 1d
          description: >-
            Look-back window ending at the transaction's txn_date: <N>m
            (MINUTES, not months), <N>h (hours) or <N>d (days), e.g. 30m, 24h,
            7d, 30d.
        filters:
          type: object
          additionalProperties: true
          description: >-
            Narrows which historical transactions are aggregated. Keys are field
            paths from the condition field catalog; a value of "__current__"
            resolves to the same field's value on the transaction being
            evaluated (e.g. {"subject_vendor_data": "__current__"} scopes the
            window to the same subject), and a list value means membership.
            Filters compare by equality or membership ONLY - there is no lt/gte
            filter, so a range such as "historical transactions under 10,000"
            cannot be expressed here. Put the range on the metric instead
            (metric max with operator lt keeps every transaction in the window
            below the threshold).
      description: >-
        Velocity check over the application's historical transactions inside the
        window. Every aggregation entry must match for the rule to match,
        regardless of evaluation_mode. An aggregation constrains only the
        window; the transaction being evaluated is constrained by scope and
        conditions, so repeat direction, currency or transaction_type on both
        halves when the rule promises them.
    TransactionRuleAction:
      oneOf:
        - type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - add_score
            value:
              type: integer
              description: Points added to the transaction's risk score. May be negative.
          description: >-
            Add points to the transaction's cumulative risk score; the total
            decides the status via the application's review/decline thresholds.
        - type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - change_status
            value:
              type: string
              enum:
                - APPROVED
                - IN_REVIEW
                - DECLINED
                - AWAITING_USER
              description: >-
                Status to set immediately, regardless of score. Alias key:
                status.
            workflow_id:
              type: string
              format: uuid
              description: >-
                REQUIRED when value is AWAITING_USER: the verification workflow
                the subject is asked to complete. Alias key:
                remediation_workflow_id. Didit creates a hosted remediation
                session for the subject when the rule fires.
          description: >-
            Directly set the transaction status. DECLINED always wins across
            matched rules.
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - add_tags
            tag_uuid:
              type: string
              format: uuid
              description: Existing application tag to attach.
            tag_name:
              type: string
              description: >-
                Tag name to attach; created on first use (stored uppercased).
                Provide tag_uuid or tag_name.
            tag_color:
              type: string
              description: 'Hex color used when tag_name creates a new tag, e.g. #007AFE.'
          description: Attach an application tag to the matched transaction.
        - type: object
          required:
            - type
            - note
          properties:
            type:
              type: string
              enum:
                - add_note
            note:
              type: string
              description: >-
                Note text attached to the transaction (author: Rule Engine).
                Alias key: value.
          description: Attach an automated analyst note to the matched transaction.
        - type: object
          required:
            - type
            - list_id
          properties:
            type:
              type: string
              enum:
                - add_to_list
            list_id:
              type: string
              format: uuid
              description: List to add the subject's vendor_data to.
          description: >-
            Add the subject's vendor_data to a blocklist, allowlist or custom
            list.
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - open_case
            blueprint:
              type: string
              format: uuid
              description: >-
                Case blueprint UUID; defaults to the application's default
                blueprint.
            grouping:
              type: string
              enum:
                - by_applicant
                - by_rule_and_applicant
              description: >-
                Whether repeat matches join one case per applicant or one per
                rule+applicant.
            attach_matched_transaction:
              type: boolean
              description: Attach the matched transaction to the case.
          description: >-
            Open (or add to) an investigation case. Only the first open_case
            action on a rule is applied.
      description: >-
        One rule action. A rule can carry several; all are applied together when
        it matches. Rules in TEST mode record what they would have done without
        applying any action.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is missing, wrong, revoked or expired; 403 means the key
        has no access to this resource or action, or the request came from an
        address outside its IP list; 404 on a session route means the session is
        outside the key's workflows or statuses. A key without media access
        receives image, video and PDF URLs as null, and a key without sessions
        write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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