> ## 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：KYB 数据擦除

> 通过 vendor_data 或 didit_internal_id 批量删除 Didit 企业（KYB）实体，符合 GDPR/CCPA 合规要求。



批量删除企业提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Goal: Permanently delete one or many Didit Business (KYB) entities. The matching business records, their tag links, and their comment history are removed permanently. Verification sessions and their records (KYB session data, document submissions, AML hits, beneficial-owner verifications) are NOT removed by this endpoint; delete those separately with DELETE /v3/session/{sessionId}/delete/.

Endpoint: POST https://verification.didit.me/v3/businesses/delete/
Auth header: x-api-key: <DIDIT_API_KEY>
Content-Type: application/json

Request body — provide EXACTLY ONE selector (mutually exclusive):
\- vendor_data_list: string[] — your own identifiers (case-insensitive after normalisation).
\- didit_internal_id_list: string[] (UUIDs) — Didit's internal IDs.
\- delete_all: true — wipe every business in this application. No confirmation, no undo.

curl:
curl -X POST 'https://verification.didit.me/v3/businesses/delete/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"vendor_data_list": ["company-123", "company-456"]}'

Response 200:
\{
"deleted": <int — number of businesses actually deleted; excludes vendor_data values that didn't match>
}

Idempotency: re-sending the same list returns deleted: 0 after the first run (unmatched IDs are silently skipped). There is no undo.

Failure modes:
\- 400 — no selector supplied. { "detail": "Provide vendor_data_list, didit_internal_id_list, or set delete_all=true." }
\- 401 — missing/invalid x-api-key.
\- 403 — lacks delete:businesses. { "detail": "You do not have permission to perform this action." }
\- 409 — the selection includes a company in a finalized regulatory report. Nothing is deleted. The body has code: in_filed_report and reports[] with uuid, report_number, report_type and case_uuid. Delete the reports, then repeat the request.
\- 409 — code: subject_deletion_in_progress: another request is still deleting one of the selected companies. This request deleted nothing; repeat it once that deletion has finished.
\- 429 — rate-limited.

WARNING — delete_all: true: there is no confirmation step and no undo. Restrict to API keys you intentionally provision for batch maintenance.

When to prefer status change instead:
\- For day-to-day blocking, use PATCH /v3/businesses/{vendor_data}/update-status/ with {"status": "BLOCKED"} — it keeps the audit trail intact while rejecting future sessions for the same identifier.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

粘贴到

## 概述删除一个或多个[企业实体](https://docs.didit.me/zh/entities/businesses/overview.md)。企业记录将被永久删除。此端点不处理企业验证（KYB）会话，这些会话会保留，但与企业的关联会被清除；请使用[删除会话](https://docs.didit.me/zh/sessions-api/delete-session.md)删除它们。交易同样不在此端点的处理范围内；请使用[批量删除交易](https://docs.didit.me/zh/management-api/transactions/delete.md)删除交易。## 使用场景- **被遗忘权**请求。
- QA 期间**清理**测试企业。
- **取消配置**：从您自己的平台中移除的企业。## 注意事项- 接受 `vendor_data` 值或 `didit_internal_id` 值的列表。
- **幂等**：删除已删除的企业不产生任何效果。
- 仅返回已删除的数量，不返回逐项报告。与任何记录都不匹配的值会被静默跳过。
- 触发 `business.data.updated` 事件，其中 `deleted_at` 已设置。
- 企业实体自身拥有的记录会随之删除：其标签关联、评论历史，以及其自有的设备和网络记录。
- 企业验证（KYB）会话产生的记录**不会**被删除：公司登记数据、上传的证件、AML 命中结果、实际受益人和关键人员检查均归属于会话，并会一直保留，直到您删除会话本身。## 已定稿监管报告中的数据如果所选企业中有任一企业属于已定稿监管报告所在的案件，则整个请求返回 `409`，且不删除任何数据。响应使用 `code: in_filed_report`，并列出每份报告：```json theme={null}
{
  "detail": "A case about this person or company has a filed regulatory report, so it cannot be deleted.",
  "code": "in_filed_report",
  "reports": [
    {
      "uuid": "5ec00000-0000-4000-8000-000000000007",
      "report_number": "SAR-0001",
      "report_type": "SAR",
      "case_uuid": "c1a5e000-0000-4000-8000-000000000001"
    }
  ]
}
```请使用[删除报告](https://docs.didit.me/zh/management-api/regulatory-reports/delete.md)逐一删除这些报告，然后重新发送相同的请求。## 正在进行的删除操作同一时间，一家企业只能由一个请求删除。如果另一个请求仍在删除所选企业中的某一家，此请求最多等待数秒，然后返回 `409`，并附带 `code: subject_deletion_in_progress`，且不删除任何数据：```json theme={null}
{
  "detail": "This person or company is being deleted. Retry after deletion completes.",
  "code": "subject_deletion_in_progress"
}
```待另一个删除操作完成后，重新发送相同的请求。另一个请求已删除的企业将不再匹配，因此重复请求只会删除剩余的企业。## 权限角色必须授予 `delete:businesses` 权限。通常仅保留给 `OWNER` 和 `ADMIN`。## 相关内容- [数据保留](https://docs.didit.me/zh/console/data-retention.md)
- [审计日志](https://docs.didit.me/zh/console/audit-logs.md)
- [企业操作](https://docs.didit.me/zh/entities/businesses/operations.md)


## OpenAPI

````yaml zh/openapi-25.json POST /v3/businesses/delete/
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/businesses/delete/:
    post:
      tags:
        - Businesses
      summary: 批量删除企业
      description: >-
        **永久删除**企业 — 此操作无法撤销。若需阻止企业，建议使用 [Update Business
        Status](#patch-/v3/businesses/-vendor_data-/update-status/) 并传入
        `BLOCKED`。


        **已归档的监管报告：**如果选定的数据包含在已定稿的监管报告中，整个请求将被拒绝并返回 `409`，且不会删除任何内容。响应体使用
        `code: in_filed_report`，并通过 `uuid`、`report_number`、`report_type` 和
        `case_uuid` 列出每份报告。请先删除这些报告，然后重试请求。
      operationId: batch_delete_businesses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                提供 `vendor_data_list`、`didit_internal_id_list` 或 `delete_all:
                true`。传入多项时的优先级：`delete_all` > `vendor_data_list` >
                `didit_internal_id_list`（仅使用优先级最高的一个选择器）。
              properties:
                vendor_data_list:
                  type: array
                  items:
                    type: string
                  description: 您要删除的自身标识符，完全按照发送的内容进行匹配。
                didit_internal_id_list:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: 要删除的 Didit 内部 UUID（`didit_internal_id`）。
                delete_all:
                  type: boolean
                  default: false
                  description: 若为 `true`，则删除该应用中的所有企业。不能与列表选择器结合使用。
            examples:
              Specific businesses:
                summary: 按 vendor_data 删除
                value:
                  vendor_data_list:
                    - company-123
                    - company-456
              Specific internal IDs:
                summary: 按 didit_internal_id 删除
                value:
                  didit_internal_id_list:
                    - a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    - b2c3d4e5-f6a7-8901-bcde-f12345678901
              All businesses:
                summary: 清空此应用中的所有企业
                value:
                  delete_all: true
      responses:
        '200':
          description: 企业已删除。返回实际移除的行数。
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: integer
                    description: 已删除的企业数量（不包括未匹配任何内容的 vendor_data 值）。
              examples:
                Deleted some:
                  value:
                    deleted: 2
                Nothing matched:
                  value:
                    deleted: 0
        '400':
          description: >-
            未提供选择器（`vendor_data_list`、`didit_internal_id_list` 和 `delete_all`
            全部缺失或为空）。错误正文为 JSON 数组。
          content:
            application/json:
              examples:
                Missing selector:
                  value:
                    - >-
                      Provide vendor_data_list, didit_internal_id_list, or set
                      delete_all=true.
        '403':
          description: >-
            缺少、无效或已撤销的 API 密钥，或者该密钥无法删除此应用的企业。缺少密钥返回 `403`；错误、已撤销或已过期的密钥返回
            `401`。
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '409':
          description: >-
            未删除任何内容。`code` 说明了原因：所选内容包含已定稿监管报告中的企业时为
            `in_filed_report`，另一个请求仍在删除所选企业之一时为
            `subject_deletion_in_progress`。请在该删除完成后重试请求。
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/InFiledReportError'
                  - $ref: '#/components/schemas/SubjectDeletionInProgressError'
        '429':
          description: 超出速率限制；请退避并在 `Retry-After` 指定的间隔后重试。
          content:
            application/json:
              examples:
                Rate limited:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/businesses/delete/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"vendor_data_list": ["company-123", "company-456"]}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.businesses.batch_delete(
                vendor_data_list=["company-123", "company-456"],
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

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

            const result = await didit.businesses.batchDelete({
              vendor_data_list: ["company-123", "company-456"],
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Businesses.BatchDelete(ctx, didit.BusinessesBatchDeleteParams{\n\tVendorDataList: didit.Some([]string{\"company-123\", \"company-456\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.BusinessesBatchDeleteParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.businesses().batchDelete(BusinessesBatchDeleteParams.builder()
                    .vendorDataList(List.of("company-123", "company-456"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

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

            $result = $didit->businesses->batchDelete([
                'vendor_data_list' => ['company-123', 'company-456'],
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result = didit.businesses.batch_delete(vendor_data_list:
            ["company-123", "company-456"])

            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.Businesses.BatchDeleteAsync(new
            BusinessesBatchDeleteParams

            {
                VendorDataList = new string[] { "company-123", "company-456" },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    InFiledReportError:
      type: object
      description: 由于所选数据包含在已定稿的监管报告中，删除被拒绝。没有任何内容被删除。请删除该报告，然后重试请求。
      required:
        - detail
        - code
      properties:
        detail:
          type: string
        code:
          type: string
          enum:
            - in_filed_report
          description: 因最终监管报告阻止删除的稳定错误代码。
        reports:
          type: array
          items:
            $ref: '#/components/schemas/FiledRegulatoryReport'
          description: 阻止删除个人、企业、案件或会话的报告。
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/FiledReportTransaction'
          description: 阻止删除该交易的交易列表，每笔均附带列出它的报告。
    SubjectDeletionInProgressError:
      type: object
      description: 另一个请求仍在删除此人或企业。本次请求未删除任何内容，可在该删除操作完成后重试；重试将删除届时仍处于选中状态的内容。
      required:
        - detail
        - code
      properties:
        detail:
          type: string
        code:
          type: string
          enum:
            - subject_deletion_in_progress
          description: 因另一请求正在删除该个人或企业而返回的稳定错误代码。
    FiledRegulatoryReport:
      type: object
      description: 已定稿的监管报告，阻止了请求的删除操作。
      required:
        - uuid
        - report_number
        - report_type
        - case_uuid
      properties:
        uuid:
          type: string
          format: uuid
          description: 报告 UUID。
        report_number:
          type: string
          description: 在控制台中显示的报告编号（例如 SAR-0001）。
        report_type:
          type: string
          enum:
            - SAR
            - STR
            - CTR
            - TTR
            - UTR
            - IFT
            - CBR
            - TFR
          description: 监管报告类型。
        case_uuid:
          type: string
          format: uuid
          description: 该报告所属的案件。
    FiledReportTransaction:
      type: object
      description: 因已定稿的监管报告列出而无法删除的交易。
      required:
        - uuid
        - transaction_id
        - reports
      properties:
        uuid:
          type: string
          format: uuid
          description: Didit 交易 UUID。
        transaction_id:
          type: string
          description: 创建交易时提供的交易标识符。
        reports:
          type: array
          items:
            $ref: '#/components/schemas/FiledRegulatoryReport'
          description: 列出此交易的已定稿报告。
  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.