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

> ارفع صورة وجه بترميز base64 إلى ملف مستخدم موجود في Didit بعد إنشائه أو استيراده باستخدام vendor_data.



موجّه رفع وجه المستخدم
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Goal: Attach a trusted imported face image to an existing Didit User profile.

Use case: I am migrating users from another provider. I already have a stable vendor_data and a face image I am allowed to process. I want the User profile to carry that face for evidence, duplicate detection, and face search.

Flow:
1\. Create or retrieve the User by vendor_data:
POST https://verification.didit.me/v3/users/create/
GET  https://verification.didit.me/v3/users/{vendor_data}/
2\. Read didit_internal_id from the User response.
3\. Upload the face to:
POST https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/vendor-users/by-id/{didit_internal_id}/faces/upload/

Auth: x-api-key for the same application.
Content-Type: application/json

Request body:
\- image (string, required) — raw base64-encoded JPG or PNG. Do not include a data URL prefix. Max decoded size: 2 MB.
\- comment (string, optional) — operator-visible note, for example "Imported from previous KYC provider".

Response 201:
\{
"uuid": "face-upload-uuid",
"image_url": "https://signed-url.example/...",
"comment": "Imported from previous KYC provider",
"uploaded_by": "api",
"created_at": "2026-05-18T12:00:00Z"
}

Limits:
\- Max 5 manually uploaded faces per User.
\- The image must decode as an image and contain a detectable face.
\- This enrolls the face for profile evidence and matching. It does not add the face to a blocklist.

To block a face, use POST /v3/lists/{list_uuid}/entries/face-upload/ with a face-type list instead.`

\</pre>



      
      

الصق في

## نظرة عامةاستخدم نقطة النهاية هذه عند استيراد المستخدمين من مزوّد آخر ولديك بالفعل صورة وجه موثوقة لكل شخص. يبقى المستخدم مرتبطًا بـ `vendor_data` الخاصة بك، لكن نقطة نهاية إرفاق الملف الشخصي هذه تستخدم `didit_internal_id` لتحديد المستخدم المستهدف بشكل لا لبس فيه.> [!NOTE]
>
> هذا يختلف عن [رفع وجه إلى القائمة](https://docs.didit.me/ar/management-api/lists/upload-face.md). يُرفق رفع الملف الشخصي وجهًا بملف المستخدم الشخصي لاستخدامه كدليل، ولاكتشاف التكرار، وللبحث بالوجه. أما رفع الوجه إلى القائمة فيضيف وجهًا إلى قائمة حظر مخصصة للوجوه، حتى يمكن رفض جلسات المطابقة المستقبلية.## نقطة النهاية**`POST /v3/organization/{organization_id}/application/{application_id}/vendor-users/by-id/{didit_internal_id}/faces/upload/`**## مسار الترحيل**1. إنشاء المستخدم أو العثور عليه**استدعِ [`POST /v3/users/create/`](https://docs.didit.me/ar/management-api/users/create) لإنشاء ملف شخصي جديد، أو [`GET /v3/users/{vendor_data}/`](https://docs.didit.me/ar/management-api/users/get) لملف موجود.**2. تخزين didit\_internal\_id**تتضمن استجابة المستخدم الحقل `didit_internal_id`. ستظل تستخدم `vendor_data` في قاعدة بياناتك؛ استخدم `didit_internal_id` فقط مع نقاط نهاية إرفاق الملف الشخصي.**3. رفع الوجه**أرسل بيانات صورة خامًا بترميز base64 في الحقل `image`. يتحقق الخادم من فك ترميز الصورة وحجمها واكتشاف الوجه قبل حفظها.## مثال```bash theme={null}
# 1. Create the User keyed by your external id
curl -X POST https://verification.didit.me/v3/users/create/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vendor_data": "user-42",
    "display_name": "Jane Doe",
    "metadata": { "previous_provider": "legacy-kyc-vendor" }
  }'

# 2. Upload an imported face to the returned didit_internal_id
curl -X POST https://verification.didit.me/v3/organization/$ORGANIZATION_ID/application/$APPLICATION_ID/vendor-users/by-id/$DIDIT_INTERNAL_ID/faces/upload/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "<base64-encoded-jpg-or-png>",
    "comment": "Imported from previous KYC provider"
  }'
```## محتوى الطلب| الحقل | النوع | مطلوب | الوصف |
| - | - | - | - |
| `image` | نص | نعم | صورة JPG أو PNG مرمّزة بـ base64 بصيغتها الخام. لا تُضمّن `data:image/...;base64,`. الحجم الأقصى بعد فك الترميز: 2 MB. |
| `comment` | نص | لا | ملاحظة مرئية للمشغّل تظهر على الملف الشخصي للمستخدم. |## الاستجابة```json theme={null}
{
  "uuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "image_url": "https://signed-url.example/face.jpg",
  "comment": "Imported from previous KYC provider",
  "uploaded_by": "api",
  "created_at": "2026-05-18T12:00:00Z"
}
```## التحقق والحدود- الحد الأقصى 5 وجوه مرفوعة يدويًا لكل مستخدم.
- الحد الأقصى لحجم الصورة بعد فك الترميز هو 2 MB.
- يجب أن تكون الصورة بترميز base64 صالح وأن تُفك كصورة.
- يجب أن تحتوي الصورة على وجه قابل للاكتشاف. استخدم صورة مقصوصة لوجه أمامي ومضاء جيدًا عند الإمكان.
- يُفهرس الوجه المرفوع لاكتشاف التكرار والبحث بالوجه مستقبلًا.
- لا يُضاف الوجه المرفوع تلقائيًا إلى قائمة الحظر.## عرض الوجوه المرفوعة أو حذفهاعرض وجوه الملف الشخصي:```bash theme={null}
curl https://verification.didit.me/v3/organization/$ORGANIZATION_ID/application/$APPLICATION_ID/vendor-users/by-id/$DIDIT_INTERNAL_ID/faces/ \
  -H "x-api-key: YOUR_API_KEY"
```حذف وجه واحد من الملف الشخصي:```bash theme={null}
curl -X DELETE https://verification.didit.me/v3/organization/$ORGANIZATION_ID/application/$APPLICATION_ID/vendor-users/by-id/$DIDIT_INTERNAL_ID/faces/$FACE_UUID/ \
  -H "x-api-key: YOUR_API_KEY"
```## الأذوناتاستخدم مفتاح API للتطبيق نفسه. ويجب أن يكون المفتاح تابعًا لتطبيق مسموح له بإدارة ملف المستخدم المستهدف.## أنماط الفشل- `400`: ترميز base64 غير صالح، أو صورة غير صالحة، أو عدم وجود وجه قابل للاكتشاف، أو تجاوز حجم الصورة 2 MB، أو وجود 5 وجوه مرفوعة للمستخدم بالفعل.
- `401`: بيانات الاعتماد مفقودة أو غير صالحة.
- `403`: مفتاح API صالح لكنه غير مسموح له بإدارة هذا الملف الشخصي للمستخدم.
- `404`: لا يوجد مستخدم بهذا `didit_internal_id` في التطبيق.
- `429`: تم تجاوز حد الطلبات؛ أعد المحاولة بعد المدة المحددة في الرأس `Retry-After`.## ذات صلة- [إنشاء مستخدم](https://docs.didit.me/ar/management-api/users/create.md)
- [الحصول على مستخدم](https://docs.didit.me/ar/management-api/users/get.md)
- [استيراد المستخدمين وتصديرهم](https://docs.didit.me/ar/entities/users/import-export.md)
- [الوجوه والبيانات البيومترية](https://docs.didit.me/ar/entities/users/faces-and-biometrics.md)
- [رفع وجه إلى قائمة الحظر](https://docs.didit.me/ar/management-api/lists/upload-face.md)


## OpenAPI

````yaml ar/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/vendor-users/by-id/{didit_internal_id}/faces/upload/
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}/vendor-users/by-id/{didit_internal_id}/faces/upload/:
    post:
      tags:
        - Users
      summary: رفع وجه المستخدم
      description: >-
        إرفاق صورة وجه موثوقة ومستوردة بملف تعريف مستخدم حالي. استخدم هذا
        الإجراء بعد إنشاء مستخدم أو جلبه بواسطة `vendor_data` وقراءة
        `didit_internal_id` الخاص به. يتم تخزين الوجه المرفوع في ملف تعريف
        المستخدم وفهرسته لاكتشاف التكرار والبحث بالوجه. لا تتم إضافته إلى قائمة
        حظر الوجوه.
      operationId: upload_user_face
      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: didit_internal_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: >-
            معرّف UUID الداخلي للمستخدم في Didit، والذي يُرجع كـ
            `didit_internal_id` بواسطة `GET /v3/users/{vendor_data}/` و`POST
            /v3/users/create/`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image
              properties:
                image:
                  type: string
                  format: byte
                  description: >-
                    صورة وجه خام بصيغة JPG أو PNG بترميز base64. لا تُضمِّن
                    البادئة `data:image/...;base64,`. الحد الأقصى للحجم بعد فك
                    الترميز: 2 MB.
                comment:
                  type: string
                  description: ملاحظة اختيارية مرئية للمشغّل للوجه الذي تم رفعه.
                  default: ''
            examples:
              Imported face:
                summary: إرفاق وجه تم استيراده من مزود سابق
                value:
                  image: /9j/4AAQSkZJRgABAQEA...
                  comment: Imported from previous KYC provider
      responses:
        '201':
          description: تم رفع الوجه وإرفاقه بملف تعريف المستخدم.
          content:
            application/json:
              schema:
                type: object
                required:
                  - uuid
                  - image_url
                  - comment
                  - uploaded_by
                  - created_at
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: معرّف UUID لسجل وجه المستخدم المرفوع.
                  image_url:
                    type: string
                    format: uri
                    nullable: true
                    description: رابط URL موقّع لصورة الوجه المرفوعة.
                  comment:
                    type: string
                    nullable: true
                    description: التعليق المقدَّم عند تحميل الوجه.
                  uploaded_by:
                    type: string
                    nullable: true
                    description: >-
                      البريد الإلكتروني أو معرّف الجهة الفاعلة للقائم بالرفع عند
                      توفره.
                  created_at:
                    type: string
                    format: date-time
                    description: الطابع الزمني للرفع.
              examples:
                Uploaded:
                  value:
                    uuid: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
                    image_url: https://signed-url.example/face.jpg
                    comment: Imported from previous KYC provider
                    uploaded_by: api
                    created_at: '2026-05-18T12:00:00Z'
        '400':
          description: >-
            جسم الطلب أو الصورة غير صالحة. الأسباب الشائعة: base64 غير صالح،
            صورة غير صالحة، تعذر كشف الوجه، حجم الصورة يتجاوز 2 ميجابايت، تضمين
            مفقود، أو أن المستخدم يمتلك بالفعل 5 وجوه تم تحميلها.
          content:
            application/json:
              examples:
                No face:
                  value:
                    image: >-
                      No face detected in the image. Please upload a clear photo
                      with a visible face.
                Too many faces:
                  value:
                    detail: Maximum of 5 faces per user reached.
                Too large:
                  value:
                    image: Image exceeds maximum size of 2 MB.
        '401':
          description: مفتاح API مفقود أو غير صالح.
          content:
            application/json:
              examples:
                Missing key:
                  value:
                    detail: Authentication credentials were not provided.
        '403':
          description: >-
            بيانات الاعتماد صالحة ولكن لا يمكنها كتابة الملفات الشخصية
            للمستخدمين لهذا التطبيق.
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: لا يوجد مستخدم بمعرّف `didit_internal_id` هذا في التطبيق.
          content:
            application/json:
              examples:
                Not found:
                  value:
                    detail: Not found.
        '429':
          description: تم تجاوز حد المعدل؛ تراجع مؤقتاً وأعد المحاولة.
          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/organization/11111111-2222-3333-4444-555555555555/application/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/vendor-users/by-id/f4e5e1f2-94a9-4f86-8c16-2b7d9b4db418/faces/upload/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"image": "/9j/4AAQSkZJRgABAQEA...", "comment": "Imported from previous KYC provider"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

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

            result = client.users.upload_face(
                "11111111-2222-3333-4444-555555555555",
                image="/9j/4AAQSkZJRgABAQEA...",
                comment="Imported from previous KYC provider",
            )
            print(result)
        - 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();


            const result = await
            didit.users.uploadFace("11111111-2222-3333-4444-555555555555", {
              image: "/9j/4AAQSkZJRgABAQEA...",
              comment: "Imported from previous KYC provider",
            });

            console.log(result);
        - 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\nresult, err := client.Users.UploadFace(ctx, \"11111111-2222-3333-4444-555555555555\", didit.UsersUploadFaceParams{\n\tImage:   \"/9j/4AAQSkZJRgABAQEA...\",\n\tComment: didit.String(\"Imported from previous KYC provider\"),\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.UsersUploadFaceParams;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            var result =
            client.users().uploadFace("11111111-2222-3333-4444-555555555555",
            UsersUploadFaceParams.builder()
                    .image("/9j/4AAQSkZJRgABAQEA...")
                    .comment("Imported from previous KYC provider")
                    .build());
            System.out.println(result);
        - 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();


            $result =
            $didit->users->uploadFace('11111111-2222-3333-4444-555555555555', [
                'image' => '/9j/4AAQSkZJRgABAQEA...',
                'comment' => 'Imported from previous KYC provider',
            ]);

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

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

            result = didit.users.upload_face(
              "11111111-2222-3333-4444-555555555555",
              image: "/9j/4AAQSkZJRgABAQEA...",
              comment: "Imported from previous KYC provider"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            using var client = new DiditClient();


            var result = await
            client.Users.UploadFaceAsync("11111111-2222-3333-4444-555555555555",
            new UsersUploadFaceParams

            {
                Image = "/9j/4AAQSkZJRgABAQEA...",
                Comment = "Imported from previous KYC provider",
            });

            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.