> ## 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 لمسودة المخطط بالذكاء الاصطناعي من Didit وصف السياسة إلى اقتراح لسياسة مراجعة غير محفوظ.
قم بالمصادقة باستخدام الرأس `x-api-key` والإذن `write:cases` الخاص بالتطبيق.

## إنشاء اقتراح ومراجعته

أرسل قيمة `prompt` غير فارغة، لا يزيد طولها على 4000 حرف. تكون الاستجابة `200` مع كائن `draft`، وليست مخططاً محفوظاً ولا UUID.

```json theme={null}
{"prompt": "Draft an AML review policy with triage and evidence review stages."}
```

قد يحتوي الاقتراح على الحقول `name` و`description` و`applies_to` و`content_config` و`require_resolution_note` و`assignment_method` و`max_active_cases` و`default_deadline_hours`. قد تكون بعض الحقول غائبة، لذا راجع الاستجابة قبل استخدامها. ولا يتضمن المستوى الأعلى للاقتراح قوائم المكلّفين ولا إعدادات الموافقات ولا مراجع التوجيه.

اختر المكلّفين والفرق والموافقات والتوجيه بنفسك قبل الحفظ. إذا احتوت مرحلة مُولَّدة على `worked_by`، فإن التطبيق يتحقق منه بوصفه UUID لفريق مراجعة نشط. لا تعتبر الاقتراح تكليفاً معتمداً.

استخدم [إنشاء مخطط حالة](https://docs.didit.me/ar/management-api/case-blueprints/create.md) بعد المراجعة، مع الحقل المطلوب `name` وقائمة `assignee_pool` غير الفارغة. لا يؤدي إنشاء اقتراح إلى حفظ مسودة سياسة أو نشر سياسة أو تغيير الحالات الموجودة. دورة [حياة المسودة المحفوظة والنشر](https://docs.didit.me/ar/console/case-management/blueprints.md#حفظ-تغييرات-السياسة-ونشرها) منفصلة عن ذلك.

## الأخطاء

| الحالة | المعنى |
| - | - |
| `400` | الموجّه مفقود أو فارغ أو يتجاوز الحد المسموح به |
| `401` / `403` | عدم توفّر المصادقة أو الإذن |
| `404` | التطبيق غير موجود |
| `503` | فشل الإنشاء، أو أعاد اقتراحاً لم يجتز التحقق من الصحة؛ أعد المحاولة لاحقاً |

عند فشل الإنشاء، تُرجع الاستجابة ما يلي:

```json theme={null}
{"detail": "A blueprint draft could not be generated. Please try again."}
```

## ذات صلة

* [سرد مخططات الحالات](https://docs.didit.me/ar/management-api/case-blueprints/list.md)
* [إعدادات المخططات وسياسات المراجعة](https://docs.didit.me/ar/console/case-management/blueprints.md)


## OpenAPI

````yaml ar/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/ai-draft/
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/blueprints/ai-draft/:
    post:
      tags:
        - Case Blueprints
      summary: إنشاء مسودة مخطط للحالة بالذكاء الاصطناعي
      description: >-
        أنشئ مقترح مخطط غير محفوظ. يتطلب write:cases. يُعيد كائن مسودة، وليس
        UUID للمخطط؛ ولا يُنشأ أي مخطط أو مسودة سياسة محفوظة. راجع المقترح،
        واختر المكلّفين وأي فرق أو موافقات أو توجيه، ثم أنشئ المخطط أو حدّثه
        بشكل منفصل. يُرجع المحتوى المُولَّد غير الصالح أو فشل التوليد الرمز 503.
        راجع [مسودات الذكاء الاصطناعي
        للمخطط](/ar/management-api/case-blueprints/ai-draft).
      operationId: draft_case_blueprint
      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 للتطبيق.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseBlueprintAiDraftRequest'
            example:
              prompt: >-
                Draft an AML review policy with triage and evidence review
                stages.
      responses:
        '200':
          description: اقتراح غير محفوظ. لم تتغير أي حالة.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaseBlueprintAiDraftResponse'
              example:
                draft:
                  name: AML review
                  applies_to:
                    - AML
                  require_resolution_note: true
                  content_config:
                    stages:
                      items:
                        - key: triage
                          label: Triage
                          sla_hours: 24
        '400':
          description: الحقل prompt مفقود أو فارغ أو يتجاوز 4000 حرفًا.
        '401':
          description: المصادقة مطلوبة.
        '403':
          description: يلزم الإذن write:cases.
        '404':
          description: لم يُعثر على التطبيق.
        '503':
          description: فشل التوليد أو أنتج مقترحاً غير صالح. أعد المحاولة لاحقاً.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: A blueprint draft could not be generated. Please try again.
      security:
        - ApiKeyAuth: []
      x-codeSamples: []
components:
  schemas:
    CaseBlueprintAiDraftRequest:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 4000
          description: وصف غير فارغ لسياسة المراجعة المقترحة.
          example: Draft an AML review policy with triage and evidence review stages.
    CaseBlueprintAiDraftResponse:
      type: object
      required:
        - draft
      properties:
        draft:
          $ref: '#/components/schemas/CaseBlueprintAiDraft'
    CaseBlueprintAiDraft:
      type: object
      additionalProperties: false
      description: >-
        اقتراح غير محفوظ ومتحقَّق منه. الحقول اختيارية؛ راجع النتيجة واختر
        المكلَّفين والفرق والتوجيه قبل الحفظ.
      properties:
        name:
          type: string
          maxLength: 24
          description: بحد أقصى 24 حرفاً، على سبيل المثال "تحقيق AML".
        description:
          type: string
          nullable: true
        content_config:
          $ref: '#/components/schemas/CaseContentConfig'
        require_resolution_note:
          type: boolean
        assignment_method:
          type: string
          enum:
            - MANUAL
            - AUTOMATIC
        max_active_cases:
          type: integer
          nullable: true
          minimum: 1
          description: 'حد الوضع التلقائي: "أقل من N من الحالات المسندة لهذا المخطط".'
        default_deadline_hours:
          type: integer
          nullable: true
          minimum: 1
          maximum: 8760
          description: >-
            الموعد النهائي الافتراضي للحالات المفتوحة حديثاً. المواعيد النهائية
            للحالات الحالية تظل دون تغيير.
        applies_to:
          $ref: '#/components/schemas/CaseBlueprintAppliesTo'
    CaseContentConfig:
      type: object
      description: >-
        أقسام محتوى الحالة ومراحل المراجعة الاختيارية. تُرفض الأقسام أو المفاتيح
        غير المعروفة. تحتفظ الحالات بلقطة السياسة المقبولة وقت فتحها، ولا تُعيد
        التعديلات اللاحقة على المخطط كتابتها.
      properties:
        checklist:
          type: object
          properties:
            enabled:
              type: boolean
            optional:
              type: boolean
              description: >-
                عند التعيين على true، يمكن حل الحالة مع وجود عناصر غير مكتملة في
                قائمة التحقق.
            items:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                    maxLength: 255
                  order:
                    type: integer
        aml_control:
          type: object
          properties:
            enabled:
              type: boolean
            financial:
              type: boolean
            identity:
              type: boolean
        identity:
          type: object
          properties:
            enabled:
              type: boolean
            personal_information:
              type: boolean
            applicant_tags:
              type: boolean
            contact_information:
              type: boolean
            risk_overview:
              type: boolean
            poi_documents:
              type: boolean
            poa_documents:
              type: boolean
        verifications:
          type: object
          properties:
            enabled:
              type: boolean
            summary:
              type: boolean
        reporting:
          type: object
          properties:
            enabled:
              type: boolean
            fiu_reports:
              type: boolean
        financial:
          type: object
          properties:
            enabled:
              type: boolean
            payment_methods:
              type: boolean
            transactions:
              type: boolean
        stages:
          type: object
          additionalProperties: false
          description: >-
            مراحل المراجعة مرتبة. عند إغفال العناصر أو كونها فارغة تُستخدم
            المراحل الافتراضية: الفرز ومراجعة الأدلة والقرار.
          properties:
            items:
              type: array
              maxItems: 10
              items:
                $ref: '#/components/schemas/CaseBlueprintStage'
              description: >-
                حتى عشر مراحل بمفاتيح مميّزة. حلّ الحالة تغيير في الحالة وليس
                مرحلة.
    CaseBlueprintAppliesTo:
      type: array
      maxItems: 6
      items:
        type: string
        enum:
          - GENERAL
          - VERIFICATION_REVIEW
          - BUSINESS_REVIEW
          - AML
          - TRANSACTION_MONITORING
          - DUPLICATES
      description: >-
        أنواع الحالات التي يصفها هذا المخطط. اختياري عند الإنشاء والتحديث؛ تكون
        القيمة الافتراضية للمخططات الجديدة قائمة فارغة. تُحفظ في لقطة سياسة
        الحالة المقبولة.
      example:
        - AML
    CaseBlueprintStage:
      type: object
      additionalProperties: false
      required:
        - label
      properties:
        key:
          type: string
          pattern: ^[a-z0-9_]{1,64}$
          description: >-
            فريد ضمن السياسة. احذفه لاشتقاقه من التسمية. المفتاح المُستنتَج
            محجوز.
          example: triage
        label:
          type: string
          minLength: 1
          maxLength: 64
          description: تسمية مرحلة غير فارغة.
          example: Triage
        sla_hours:
          type: integer
          minimum: 1
          maximum: 8760
          nullable: true
          description: >-
            اتفاقية مستوى الخدمة للمرحلة بالساعات، أو null إذا لم تكن هناك
            اتفاقية.
          example: 24
        worked_by:
          type: string
          format: uuid
          nullable: true
          description: >-
            معرّف UUID اختياري لفريق المراجعة. يجب أن تشير القيمة غير null إلى
            فريق نشط في هذا التطبيق. احذف الحقل أو استخدم null عندما لا يكون
            هناك فريق للمرحلة.
          example: a0000000-0000-4000-8000-000000000001
  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.