> ## 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 API 删除自定义 KYT 规则。删除操作立即生效且无法撤销；库中的预设规则则改为卸载，之后可随时重新安装。

删除规则 API 提示词
将提示词复制到剪贴板

<pre>
  \`Delete a CUSTOM transaction-monitoring rule.

  Endpoint:
  DELETE [https://verification.didit.me/v3/transactions/rules/\{rule\_uuid}/](https://verification.didit.me/v3/transactions/rules/\{rule_uuid}/)

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

  Behavior:

  * 204 on success. Deletion is immediate and permanent: the rule stops evaluating for new transactions and disappears from listings. Rule runs already recorded on past transactions keep their results.
  * Only CUSTOM rules can be deleted. A library preset returns 400 - uninstall it via DELETE /v3/transactions/rules/install/ instead (presets can always be reinstalled from the library).
  * The freed title can be reused by a new rule.

  Failure modes:

  * 400 - the rule is a library preset.
  * 404 - unknown rule uuid for this application.\`
</pre>

粘贴到


## OpenAPI

````yaml zh/openapi-25.json DELETE /v3/transactions/rules/{rule_uuid}/
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/{rule_uuid}/:
    parameters:
      - name: rule_uuid
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: 来自列表或创建操作的规则 uuid。
    delete:
      tags:
        - Transactions
      summary: 删除规则
      description: >-
        删除一条 CUSTOM
        规则。删除会立即且永久生效：该规则将停止对新交易进行评估，并不再显示在列表中，而已评估交易的历史规则运行记录仍将保留。库规则无法删除，请改用安装
        endpoint 卸载它们（它们始终可以从库中重新安装）。
      operationId: deleteTransactionRule
      responses:
        '204':
          description: 已删除。
        '400':
          description: 该规则是库中的预设规则 - 请改为卸载。
          content:
            application/json:
              schema:
                type: object
              example:
                detail: >-
                  Library rules cannot be deleted. Uninstall them via the rules
                  install endpoint instead.
        '404':
          description: 此应用中不存在该规则。
          content:
            application/json:
              schema:
                type: object
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X DELETE
            'https://verification.didit.me/v3/transactions/rules/RULE_UUID/' \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            client.transactions.rules.delete(
                "11111111-2222-3333-4444-555555555555",
            )
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            await
            didit.transactions.rules.delete("11111111-2222-3333-4444-555555555555");
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nif err := client.Transactions.Rules.Delete(ctx, \"11111111-2222-3333-4444-555555555555\"); err != nil {\n\tlog.Fatal(err)\n}"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            client.transactions().rules().delete("11111111-2222-3333-4444-555555555555");
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $didit->transactions->rules->delete('11111111-2222-3333-4444-555555555555');
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            didit.transactions.rules.delete("11111111-2222-3333-4444-555555555555")
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            await
            client.Transactions.Rules.DeleteAsync("11111111-2222-3333-4444-555555555555");
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

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