> ## 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で、コンプライアンスケースとその下書きの規制レポートを削除します。確定済みのレポートがある場合は、そのレポートを削除するまでケースは削除できません。

ケース削除APIのプロンプト
プロンプトをクリップボードにコピー

<pre>
  \`Delete a compliance case through the Management API.

  Endpoint:
  DELETE [https://verification.didit.me/v3/organization/\{organization\_id}/application/\{application\_id}/cases/\{case\_uuid}/](https://verification.didit.me/v3/organization/\{organization_id}/application/\{application_id}/cases/\{case_uuid}/)

  Authentication:
  Use the x-api-key header with my Didit API key. Use a full-access API key; the caller needs write:cases.

  Request body: none.

  Example call:
  curl -X DELETE "[https://verification.didit.me/v3/organization/\{organization\_id}/application/\{application\_id}/cases/\{case\_uuid}/](https://verification.didit.me/v3/organization/\{organization_id}/application/\{application_id}/cases/\{case_uuid}/)" \
  -H "x-api-key: YOUR\_API\_KEY"

  Response 204: the case is deleted.

  What is deleted:

  * The case.
  * Its draft regulatory reports.
    Linked verifications, people, companies and transactions are NOT deleted. There is no undelete endpoint.

  Failure modes:

  * 409 - the case has a finalized regulatory report. Nothing is deleted. The body has code: in\_filed\_report and names each report with uuid, report\_number, report\_type and case\_uuid. Delete the reports, then repeat this request.
  * 403 - the key cannot delete cases (requires a full-access key and write:cases).
  * 404 - the case does not exist in this application or was already deleted.

  For the full integration shape, see /integration/integration-prompt.\`
</pre>

貼り付け先

ケースを完全に削除します。そのケースの下書き状態の規制当局向けレポートも一緒に削除されます。

紐付けられた認証、人物、企業、取引は**削除されません**。削除を取り消すエンドポイントはありません。

## 確定済みレポートによるブロック

ケースに確定済みの規制当局向けレポートがある場合、リクエスト全体が`409`を返し、何も削除されません。

```json theme={null}
{
  "detail": "This case has a finalized 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"
    }
  ]
}
```

[Delete Report](https://docs.didit.me/ja/management-api/regulatory-reports/delete.md)で各レポートを削除してから、このリクエストを再度実行してください。確定済みのレポートがなくなれば、ケースを削除できます。

## 関連ページ

* [ケースの取得](https://docs.didit.me/ja/management-api/cases/get.md)
* [ケースの更新](https://docs.didit.me/ja/management-api/cases/update.md)
* [レポートの削除](https://docs.didit.me/ja/management-api/regulatory-reports/delete.md)
* [ケース (Console)](https://docs.didit.me/ja/console/case-management/cases.md)


## OpenAPI

````yaml ja/openapi-25.json DELETE /v3/organization/{organization_id}/application/{application_id}/cases/{case_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/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/:
    delete:
      tags:
        - Cases
      summary: ケースを削除
      description: >-
        ケースを完全に削除します。ケースの下書き状態の規制レポートも併せて削除されます。紐づく認証、人物、企業、取引は削除されません。削除を取り消すエンドポイントはありません。


        ケースに確定済みの規制レポートがある場合、リクエスト全体が`409`で拒否され、何も削除されません。ボディには`code:
        in_filed_report`が含まれ、各レポートが`uuid`、`report_number`、`report_type`、`case_uuid`で示されます。それらのレポートを削除してから、リクエストを再度実行してください。
      operationId: delete_case
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 組織のUUIDです。
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: アプリケーションのUUID。
        - name: case_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: c1a5e000-0000-4000-8000-000000000001
          description: ケースのUUID。
      responses:
        '204':
          description: ケースが削除されました。
        '403':
          description: このキーではケースを削除できません。`write:cases`を持つフルアクセスキーが必要です。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
        '404':
          description: ケースがこのアプリケーションに存在しないか、すでに削除されています。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
        '409':
          description: ケースに確定済みの規制当局向けレポートがあります。何も削除されません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InFiledReportError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X DELETE
            'https://verification.didit.me/v3/organization/11111111-2222-3333-4444-555555555555/application/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/cases/c1a5e000-0000-4000-8000-000000000001/'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            client = Didit()

            client.cases.delete(
                "c1a5e000-0000-4000-8000-000000000001",
            )
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            // and DIDIT_APPLICATION_ID.
            const didit = new Didit();

            await didit.cases.delete("c1a5e000-0000-4000-8000-000000000001");
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID\n// and DIDIT_APPLICATION_ID.\nclient := didit.NewClient()\n\nif err := client.Cases.Delete(ctx, \"c1a5e000-0000-4000-8000-000000000001\"); err != nil {\n\tlog.Fatal(err)\n}"
        - lang: java
          label: Java
          source: |-
            import me.didit.Didit;

            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            // and DIDIT_APPLICATION_ID.
            Didit client = new Didit();

            client.cases().delete("c1a5e000-0000-4000-8000-000000000001");
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            // and DIDIT_APPLICATION_ID.
            $didit = new DiditClient();

            $didit->cases->delete('c1a5e000-0000-4000-8000-000000000001');
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            didit = Didit::Client.new

            didit.cases.delete("c1a5e000-0000-4000-8000-000000000001")
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using Didit;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            using var client = new DiditClient();


            await
            client.Cases.DeleteAsync("c1a5e000-0000-4000-8000-000000000001");
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: 取引の削除を妨げている取引と、それぞれの取引を記載しているレポート。
    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: Consoleに表示されるレポート番号（例：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の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.