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

# تعديل مسودة طرف KYB عبر API

> عدّل حقول مسودة شخص رئيسي واحد في جلسة KYB عبر Didit، ويُتحقق من الطرف المدمج ككل.



## OpenAPI

````yaml ar/openapi-25.json PATCH /v3/session/{sessionId}/kyb/parties/drafts/{draftId}/
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/session/{sessionId}/kyb/parties/drafts/{draftId}/:
    patch:
      tags:
        - Sessions
      summary: تعديل مسودة طرف في KYB
      description: >-
        تغيير حقول مسودة طرف واحد. يتم دمج التعديل في المسودة المخزنة والتحقق من
        صحة الطرف المدمج ككل، لذلك يتم رفض أي تعديل قد يترك الطرف غير مكتمل.
        يؤدي تغيير `first_name` أو `last_name` إلى استبدال الاسم الكامل المخزن.
        يتطلب `write:businesses`.
      operationId: patch_v3_session_kyb_party_draft
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            معرّف UUID لجلسة التحقق من الشركات (KYB). يجب أن تنتمي إلى التطبيق
            الخاص بمفتاح API.
          schema:
            type: string
            format: uuid
            example: 33333333-4444-5555-6666-777777777777
        - name: draftId
          in: path
          required: true
          description: معرّف UUID لمسودة الطرف (`draft_id` الذي تم إرجاعه عند إنشائها).
          schema:
            type: string
            format: uuid
            example: 5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d
        - name: node_id
          in: query
          required: false
          description: >-
            عقدة سير العمل الخاصة بخطوة KYB. لازمة فقط عندما يحتوي سير العمل على
            أكثر من عقدة KYB واحدة؛ افتراضياً، تستخدم Didit عقدة الجلسة نفسها.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                أي مجموعة فرعية من حقول الطرف. يُدمج التعديل في المسودة المحفوظة
                ويتم التحقق من صحة الطرف المدمج ككل، بحيث يمكن إرسال المسودة
                التي كانت قابلة للإرسال قبل التعديل بعده أيضاً.
              properties:
                entity_type:
                  type: string
                  enum:
                    - person
                    - company
                  description: ما إذا كان الطرف فرداً أو شركة.
                full_name:
                  type: string
                  maxLength: 255
                  description: >-
                    الاسم الكامل للشخص. أرسله، أو أرسل `first_name`
                    و`last_name`.
                first_name:
                  type: string
                  maxLength: 128
                last_name:
                  type: string
                  maxLength: 128
                role:
                  type: string
                  enum:
                    - director
                    - non_executive_director
                    - secretary
                    - chairman
                    - ubo
                    - shareholder
                    - representative
                    - founder
                    - legal_advisor
                    - authorized_signatory
                    - trustee
                    - beneficiary
                    - settlor
                    - protector
                    - company_officer
                    - investor
                    - other
                  description: >-
                    الدور الذي يشغله الطرف. قابل للتبديل مع `roles`؛ وعند إرسال
                    الاثنين معاً يتم دمجهما.
                roles:
                  type: array
                  items:
                    type: string
                    enum:
                      - director
                      - non_executive_director
                      - secretary
                      - chairman
                      - ubo
                      - shareholder
                      - representative
                      - founder
                      - legal_advisor
                      - authorized_signatory
                      - trustee
                      - beneficiary
                      - settlor
                      - protector
                      - company_officer
                      - investor
                      - other
                  description: >-
                    كل دور يحمله الطرف. يحتاج الشخص إلى دور واحد على الأقل (هنا
                    أو في `role`).
                position:
                  type: string
                  maxLength: 128
                  description: المسمى الوظيفي لشخص ما.
                date_of_birth:
                  type: string
                  format: date
                  nullable: true
                company_name:
                  type: string
                  maxLength: 255
                  description: >-
                    اسم أحد أطراف الشركة. مطلوب عندما يكون `entity_type` هو
                    `company`.
                registration_number:
                  type: string
                  maxLength: 100
                  description: رقم التسجيل لطرف من أطراف الشركة.
                email:
                  type: string
                  format: email
                  description: >-
                    المكان الذي يُرسل إليه رابط التحقق. مطلوب عندما يتعين على
                    الطرف إكمال عملية التحقق، ويعتمد ذلك على إعدادات الدور وحدود
                    الملكية في سير العمل.
                ownership_percent:
                  type: number
                  nullable: true
                  description: حصة الشركة التي يملكها الطرف.
                nationality:
                  type: string
                  maxLength: 100
                  description: جنسية الشخص، أو دولة تأسيس الشركة. مطلوبة لكل طرف.
                phone_number:
                  type: string
                  maxLength: 32
                custom_fields:
                  type: object
                  additionalProperties: true
                  description: حقول إضافية محددة في سير العمل.
                skip_verification:
                  type: boolean
                  default: false
                  description: >-
                    طلب تخطي التحقق لهذا الطرف. يتم قبول الطلب فقط عندما يسمح
                    دور الطرف بالتخطي في إعدادات الأشخاص الرئيسيين لسير العمل.
            example:
              ownership_percent: 55
      responses:
        '200':
          description: تم تحديث المسودة.
          content:
            application/json:
              schema:
                type: object
                required:
                  - draft_id
                  - created_at
                  - updated_at
                  - party
                properties:
                  draft_id:
                    type: string
                    format: uuid
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                  party:
                    type: object
                    required:
                      - entity_type
                      - nationality
                    properties:
                      entity_type:
                        type: string
                        enum:
                          - person
                          - company
                        description: ما إذا كان الطرف فرداً أو شركة.
                      full_name:
                        type: string
                        maxLength: 255
                        description: >-
                          الاسم الكامل للشخص. أرسله، أو أرسل `first_name`
                          و`last_name`.
                      first_name:
                        type: string
                        maxLength: 128
                      last_name:
                        type: string
                        maxLength: 128
                      role:
                        type: string
                        enum:
                          - director
                          - non_executive_director
                          - secretary
                          - chairman
                          - ubo
                          - shareholder
                          - representative
                          - founder
                          - legal_advisor
                          - authorized_signatory
                          - trustee
                          - beneficiary
                          - settlor
                          - protector
                          - company_officer
                          - investor
                          - other
                        description: >-
                          الدور الذي يشغله الطرف. قابل للتبديل مع `roles`؛ وعند
                          إرسال الاثنين معاً يتم دمجهما.
                      roles:
                        type: array
                        items:
                          type: string
                          enum:
                            - director
                            - non_executive_director
                            - secretary
                            - chairman
                            - ubo
                            - shareholder
                            - representative
                            - founder
                            - legal_advisor
                            - authorized_signatory
                            - trustee
                            - beneficiary
                            - settlor
                            - protector
                            - company_officer
                            - investor
                            - other
                        description: >-
                          كل دور يحمله الطرف. يحتاج الشخص إلى دور واحد على الأقل
                          (هنا أو في `role`).
                      position:
                        type: string
                        maxLength: 128
                        description: المسمى الوظيفي لشخص ما.
                      date_of_birth:
                        type: string
                        format: date
                        nullable: true
                      company_name:
                        type: string
                        maxLength: 255
                        description: >-
                          اسم أحد أطراف الشركة. مطلوب عندما يكون `entity_type`
                          هو `company`.
                      registration_number:
                        type: string
                        maxLength: 100
                        description: رقم التسجيل لطرف من أطراف الشركة.
                      email:
                        type: string
                        format: email
                        description: >-
                          المكان الذي يُرسل إليه رابط التحقق. مطلوب عندما يتعين
                          على الطرف إكمال عملية التحقق، ويعتمد ذلك على إعدادات
                          الدور وحدود الملكية في سير العمل.
                      ownership_percent:
                        type: number
                        nullable: true
                        description: حصة الشركة التي يملكها الطرف.
                      nationality:
                        type: string
                        maxLength: 100
                        description: جنسية الشخص، أو دولة تأسيس الشركة. مطلوبة لكل طرف.
                      phone_number:
                        type: string
                        maxLength: 32
                      custom_fields:
                        type: object
                        additionalProperties: true
                        description: حقول إضافية محددة في سير العمل.
                      skip_verification:
                        type: boolean
                        default: false
                        description: >-
                          طلب تخطي التحقق لهذا الطرف. يتم قبول الطلب فقط عندما
                          يسمح دور الطرف بالتخطي في إعدادات الأشخاص الرئيسيين
                          لسير العمل.
              example:
                draft_id: 5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d
                created_at: '2026-10-31T10:00:00Z'
                updated_at: '2026-10-31T10:00:00Z'
                party:
                  entity_type: person
                  first_name: Ana
                  last_name: Lopez
                  roles:
                    - ubo
                    - director
                  ownership_percent: 55
                  nationality: MEX
                  email: ana.lopez@example.com
                  date_of_birth: '1984-06-12'
        '400':
          description: الطرف المدمج غير صالح.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              example:
                non_field_errors:
                  - Person parties require at least one role.
        '401':
          description: >-
            انتهت صلاحية مفتاح API محدد النطاق. هذه هي الحالة الوحيدة التي تُرجع
            `401`: بينما يُرجع المفتاح المفقود أو غير الصالح أو الملغى الرمز
            `403`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              examples:
                Expired key:
                  summary: انقضى تاريخ الانتهاء للمفتاح
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            فشل في المصادقة أو التفويض. يؤدي المفتاح المفقود إلى إرجاع `403`،
            وكذلك المفتاح التابع لتطبيق آخر، أو المفتاح محدد النطاق الذي يفتقر
            إلى الإذن الذي يتطلبه هذا endpoint، أو الطلب الوارد من خارج قائمة IP
            المسموح بها للمفتاح؛ بينما يؤدي المفتاح الخاطئ أو الملغى أو منتهي
            الصلاحية إلى إرجاع `401`. يمكنك التمييز بينها من خلال `detail`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              examples:
                Missing or invalid credentials:
                  summary: لا يوجد رأس x-api-key، أو فشل التحقق من صحة المفتاح
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Other application:
                  summary: مفتاح صالح ينتمي إلى تطبيق مختلف عن الجلسة
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without decisions write:
                  summary: 'المفتاح محدد النطاق يفتقر إلى decisions: write'
                  value:
                    detail: This API key has no write access to decisions.
                IP not allowed:
                  summary: الطلب وارد من خارج قائمة IP المسموح بها للمفتاح
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            الجلسة أو المسودة غير موجودة، أو أن الجلسة خارج تطبيق المفتاح أو
            حدود مفتاح ذي نطاق محدد.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              example:
                detail: Session not found.
        '409':
          description: الجلسة مكتملة (`kyb_session_not_writable`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
                  code:
                    type: string
              example:
                detail: This verification session is no longer accepting changes.
                code: kyb_session_not_writable
        '429':
          description: >-
            تم تجاوز حد المعدل: 300 طلب كتابة (POST وPATCH وDELETE) في الدقيقة
            لكل مفتاح API. انتظر عدد الثواني المحدد في `Retry-After` قبل إعادة
            المحاولة؛ تُظهر رؤوس `X-RateLimit-*` الميزانية.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              examples:
                Rate limited:
                  summary: استُنفدت الميزانية المخصصة للدقيقة الحالية
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
          headers:
            Retry-After:
              description: عدد الثواني الواجب انتظارها قبل إعادة المحاولة.
              schema:
                type: integer
                minimum: 1
                example: 30
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.update_kyb_party_draft(
                "33333333-4444-5555-6666-777777777777",
                "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
                ownership_percent=55.0,
            )
            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.sessions.updateKybPartyDraft(
              "33333333-4444-5555-6666-777777777777",
              "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
              {
                ownership_percent: 55.0,
              },
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.UpdateKYBPartyDraft(ctx, \"33333333-4444-5555-6666-777777777777\", \"5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d\", didit.SessionsUpdateKYBPartyDraftParams{\n\tOwnershipPercent: didit.Float(55.0),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.SessionsUpdateKybPartyDraftParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().updateKybPartyDraft("33333333-4444-5555-6666-777777777777",
            "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
            SessionsUpdateKybPartyDraftParams.builder()
                    .ownershipPercent(55.0)
                    .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->sessions->updateKybPartyDraft('33333333-4444-5555-6666-777777777777',
            '5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d', [
                'ownership_percent' => 55.0,
            ]);

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.sessions.update_kyb_party_draft(
              "33333333-4444-5555-6666-777777777777",
              "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
              ownership_percent: 55.0
            )
            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.Sessions.UpdateKybPartyDraftAsync("33333333-4444-5555-6666-777777777777",
            "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d", new
            SessionsUpdateKybPartyDraftParams

            {
                OwnershipPercent = 55.0,
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  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.