> ## 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. يمنع التقرير النهائي الحذف، ويبقى هذا المنع قائماً حتى تحذفه أنت أولاً.

موجه واجهة برمجة حذف الحالة
نسخ الموجّه إلى الحافظة

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

الصق في

احذف الحالة نهائياً. تُحذف معها التقارير التنظيمية في وضع المسودة.

لا تُحذف عمليات التحقق والأشخاص والشركات والمعاملات المرتبطة بالحالة. لا يوجد endpoint لاستعادة الحالة المحذوفة.

## محظور بسبب تقرير نهائي

إذا كانت الحالة تحتوي على تقرير تنظيمي نهائي، يُرجع الطلب بأكمله الرمز `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"
    }
  ]
}
```

احذف كل تقرير باستخدام [حذف التقرير](https://docs.didit.me/ar/management-api/regulatory-reports/delete.md)، ثم أعد هذا الطلب. يمكن حذف الحالة بعد أن لا يبقى أي تقرير نهائي.

## ذو صلة

* [الحصول على الحالة](https://docs.didit.me/ar/management-api/cases/get.md)
* [تحديث الحالة](https://docs.didit.me/ar/management-api/cases/update.md)
* [حذف التقرير](https://docs.didit.me/ar/management-api/regulatory-reports/delete.md)
* [الحالات (Console)](https://docs.didit.me/ar/console/case-management/cases.md)


## OpenAPI

````yaml ar/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: >-
        حذف حالة نهائيًا. تُحذف تقاريرها التنظيمية المسودة معها. لا تُحذف عمليات
        التحقق والأشخاص والشركات والمعاملات المرتبطة. لا يوجد endpoint لاستعادة
        المحذوفات.


        إذا كانت الحالة تحتوي على تقرير تنظيمي مكتمل، يُرفض الطلب بالكامل برمز
        `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: معرّف UUID لمعاملة Didit.
        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 الخاص بتطبيقك، من Developers -> API keys في Business Console.
        يمتلك المفتاح الأساسي وصولاً كاملاً. يمكن تحديد نطاق المفتاح المسمى: لا
        شيء، أو قراءة، أو كتابة لكل مورد، ومحدوداً ببعض مسارات العمل أو بالجلسات
        المقبولة، وبقائمة من عناوين IP، وبتاريخ انتهاء الصلاحية. يشير 401 إلى أن
        المفتاح غير صحيح أو ملغى أو منتهي الصلاحية؛ ويشير 403 إلى أنه لم يتم
        إرسال أي مفتاح، أو أن المفتاح ليس لديه حق الوصول إلى هذا المورد أو
        الإجراء، أو أن الطلب جاء من عنوان خارج قائمة عناوين IP الخاصة به؛ ويشير
        404 في مسار جلسة إلى أن الجلسة خارج مسارات العمل أو الحالات الخاصة
        بالمفتاح. يتلقى المفتاح الذي لا يمتلك حق الوصول إلى الوسائط عناوين URL
        للصور ومقاطع الفيديو وملفات PDF كـ 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.