> ## 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 مسبقاً قبل جلسات KYC. استورد بالجملة من قواعد بيانات خارجية أو سجّل المستخدمين لمراقبة المعاملات.



مطالبة إنشاء المستخدم
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Goal: Pre-create a Didit User entity by vendor_data before any verification session runs, and optionally email the person a verification link in the same call.

Endpoint: POST https://verification.didit.me/v3/users/create/
Auth header: x-api-key: <DIDIT_API_KEY>
Content-Type: application/json

Request body fields:
\- vendor_data (string, REQUIRED) — your unique identifier for this user. Free-form string, NOT a UUID. Must be unique among non-deleted users in the app. Normalised lowercase + whitespace trim, so "USER-1" and "user-1" collide. Max 2000 bytes (UTF-8 encoded); longer values return a 400.
\- full_name (string, max 512, optional)
\- display_name (string, optional) — friendly label for the Console (takes precedence over full_name for UI).
\- date_of_birth (string YYYY-MM-DD, optional)
\- status (enum, optional) — "ACTIVE" | "FLAGGED" | "BLOCKED" (VendorUserStatusChoices). Defaults to "ACTIVE".
\- metadata (object, optional) — arbitrary JSON you attach to the user.
\- approved_emails (object<string, boolean>, optional) — e.g. {"john@example.com": true}.
\- approved_phones (object<string, boolean>, optional).
\- issuing_states (object<ISO3, int>, optional) — e.g. {"USA": 1}.

Contact fields (all optional):
\- first_name, last_name (string, max 255 each): joined with a space into full_name when you don't send full_name.
\- email (string, email): stored in metadata.contact.email.
\- phone_number (string, max 32): stored in metadata.contact.phone_number.
\- country (string): ISO 3166 code, alpha-2 or alpha-3 ("ES" or "ESP"), stored uppercased in metadata.address.country.

Verification link (optional):
\- send_verification_link (boolean, default false): when true, Didit also creates a verification session for the person on workflow_id and emails them the link at email.
\- workflow_id (UUID): REQUIRED with send_verification_link. The workflow must verify a person: a Business Verification (KYB) workflow is refused.
\- language (string, max 10): language of the verification email, a supported language code. English when omitted.
\- The person and the session are created together or not at all. The session runs the same checks as POST /v3/session/ (blocklist, credits).

curl:
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-abc-123", "full_name": "John Doe"}'

curl with a verification link:
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-abc-789", "first_name": "Julia", "last_name": "Martin", "email": "julia.martin@example.com", "send_verification_link": true, "workflow_id": "YOUR_WORKFLOW_ID"}'

Response 201: full UserDetailItem (same shape as GET /v3/users/{vendor_data}/) plus verification_link. Includes didit_internal_id (UUID), session_count, approved_count=0, metadata, comments=[], created_at, updated_at. See /reference/data-models.
\- verification_link is always present: null without a link, otherwise { session_id, session_number, status, url, workflow_id, email }. url is the link Didit emailed.

Failure modes:
\- 400: nothing is written. Most errors are keyed by field. Common cases:
\{ "vendor_data": ["A user with this vendor_data already exists."] }  // conflict, NOT idempotent. Use PATCH /v3/users/{vendor_data}/ to update.
\{ "vendor_data": ["This field is required."] }
\{ "vendor_data": ["Ensure this field has no more than 2000 characters."] }  // oversized vendor_data, rejected before it reaches storage
\{ "metadata": ["Metadata must be a JSON object."] }
\{ "country": ["Use an ISO 3166 country code, like ES or ESP."] }
\{ "email": ["metadata.contact must be a JSON object to store this value."] }  // same on phone_number; metadata.address on country
\{ "email": ["An email address is required to send a verification link."] }
\{ "workflow_id": ["Pick the workflow to send a verification link for."] }
\{ "workflow_id": ["Invalid workflow_id."] }
\{ "workflow_id": ["This workflow verifies a business. Pick a workflow that verifies a person to send them a verification link."] }
\{ "contact_details": { "email_lang": ["Invalid email language. Supported languages are ..."] } }  // unsupported language
\{ "vendor_data": "This user or business has been blocked and cannot create new verification sessions." }
\{ "detail": "You don't have enough credits to perform this request. Please top up at https://business.didit.me" }
\- 401: missing or invalid x-api-key. { "detail": "Authentication credentials were not provided." }
\- 403: the API key is revoked or is not valid for this application. { "detail": "You do not have permission to perform this action." }
\- 403: a scoped key without users write. { "detail": "This API key has no write access to people." }
\- 403: send_verification_link with a scoped key that lacks sessions write. Nothing is written. { "detail": "This API key has no write access to sessions." }
\- 429: rate-limited.

Upsert pattern (this endpoint is NOT idempotent):
GET /v3/users/{vendor_data}/  → on 404, POST /v3/users/create/; on 200, PATCH /v3/users/{vendor_data}/.

Notes:
\- Verified-session-derived identity fields such as full_name and date_of_birth seeded here can be overwritten by the first approved User Verification (KYC) session.
\- If you are migrating from another provider and already have a trusted face image, create the User first, read didit_internal_id from this response, then call POST /v3/organization/{organization_id}/application/{application_id}/vendor-users/by-id/{didit_internal_id}/faces/upload/.
\- The create itself sends no webhook. Later changes to the user send user.data.updated or user.status.updated. With send_verification_link, the new session updates the user (session_count) in the same call, which sends user.data.updated.
\- API key access: a scoped key needs users write; with send_verification_link it also needs sessions write. Full-access keys can always call it.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

الصق في

## نظرة عامةتُنشئ صراحةً [كيان المستخدم](https://docs.didit.me/ar/entities/users/overview.md) قبل تشغيل أي جلسة.
يصبح الكيان الذي تُعيده الاستجابة في حالة `ACTIVE` ما لم تحدد غير ذلك.
اختيارياً، يرسل الطلب نفسه إلى الشخص رابط التحقق (راجع [إرسال رابط التحقق](#إرسال-رابط-التحقق)).## متى تستخدمه- **تهيئة البيانات الوصفية مسبقاً** (المستوى، ومصدر التسجيل، والوسوم الداخلية) قبل أن يتحقق العميل.
- **الانتقال من مزوّد آخر**: أعد إنشاء قائمة مستخدميك الحالية في Didit ليبدأ السجل والتحليلات من خط أساس معروف.
- **استيراد صور الوجه الموثوقة للملفات الشخصية**: أنشئ المستخدم أولاً، ثم استدعِ [رفع وجه المستخدم](https://docs.didit.me/ar/management-api/users/upload-face.md) باستخدام `didit_internal_id` المُرجَع.
- **حالات الاستخدام الخاصة بالمعاملات فقط**: سجّل مستخدماً باستخدام `vendor_data` لتتمكن من إرسال المعاملات دون تشغيل أي جلسة للتحقق من المستخدمين (KYC).
- **دعوة شخص للتحقق**: أنشئ الشخص وأرسل إليه رابط التحقق عبر البريد الإلكتروني في استدعاء واحد.## بيانات الاتصاليمكنك إرسال بيانات الاتصال الخاصة بالشخص إلى جانب حقول الملف الشخصي.
يُدمج `first_name` و`last_name` بمسافة في `full_name` عندما لا ترسل `full_name`.
يُحفظ `email` و`phone_number` في `metadata.contact`، ويُحفظ `country` في `metadata.address`.
يقبل `country` رمز ISO 3166 من نوع alpha-2 أو alpha-3 (مثل `ES` أو `ESP`)، ويُحفظ بأحرف كبيرة.إذا كان `metadata` المُرسَل يحتوي بالفعل على قيمة `contact` أو `address` ليست كائن JSON، فلن يستبدلها Didit: يُعيد الطلب الاستجابة `400` على الحقل المعني الذي كان يتطلب كائناً JSON.## إرسال رابط التحققاضبط `send_verification_link` على `true` لدعوة الشخص إلى التحقق في الطلب نفسه.
ينشئ Didit جلسة تحقق للشخص على سير العمل المحدد في `workflow_id`، ويرسل إليه الرابط على العنوان المحدد في `email`.
استخدم `language` لاختيار [لغة](https://docs.didit.me/ar/integration/supported-languages.md) البريد الإلكتروني؛ وتكون الإنجليزية إذا حذفتها.```bash theme={null}
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-abc-789",
    "first_name": "Julia",
    "last_name": "Martin",
    "email": "julia.martin@example.com",
    "send_verification_link": true,
    "workflow_id": "YOUR_WORKFLOW_ID",
    "language": "es"
  }'
```- يكون `email` و`workflow_id` مطلوبَين مع الرابط، ويجب أن يكون سير العمل مخصصاً للتحقق من شخص: سير عمل التحقق من الشركات (KYB) يُعيد `400`.
- تمر الجلسة بالفحوص نفسها التي تُجرى عند [إنشاء جلسة](https://docs.didit.me/ar/sessions-api/create-session.md).
  إذا كان `vendor_data` مدرجاً في قائمة الحظر أو كان الرصيد غير كافٍ، يُعيد الطلب `400`.
- يُنشأ الشخص والجلسة معاً أو لا يُنشأ أيٌّ منهما. عند فشل أي فحص، لا يُكتب شيء ولا يُرسل أي بريد إلكتروني.
- تتضمن الاستجابة `verification_link` مع `session_id` و`session_number` و`status` و`url` و`workflow_id` الخاصة بالجلسة، و`email` الذي أُرسل إليه. وبدون رابط، تكون قيمة `verification_link` هي `null`.## ملاحظات- `vendor_data` مطلوب ويجب أن يكون فريداً لكل تطبيق. تؤدي محاولة إنشاء نسخة مكررة إلى خطأ تعارض. استخدم [`PATCH /v3/users/{vendor_data}/`](https://docs.didit.me/ar/management-api/users/update) لتحديث مستخدم موجود.
- يبلغ الحد الصارم للحقل `vendor_data` 2000 بايت (بترميز UTF-8). تُعيد القيمة التي تتجاوز هذا الحد خطأ تحقق 400 بدلاً من قبولها.
- يمكن تهيئة الحقول التي تُستمد عادةً من الجلسات الموثّقة (`full_name` و`date_of_birth`) هنا، لكنها قد **تُستبدل** بأول جلسة تحقق من المستخدمين (KYC) تُعتمد.
- لا يقبل هذا endpoint صور الوجه. لإرفاق وجه موثوق مستورد، استخدم [`POST /v3/organization/{organization_id}/application/{application_id}/vendor-users/by-id/{didit_internal_id}/faces/upload/`](https://docs.didit.me/ar/management-api/users/upload-face) بعد أن يُعيد هذا endpoint `didit_internal_id`.
- لا يرسل الإنشاء نفسه أي webhook. تُرسل التغييرات اللاحقة على المستخدم `user.data.updated` أو `user.status.updated`.
- مع `send_verification_link`، تُحدّث الجلسة الجديدة المستخدم في الطلب نفسه، وهذا يرسل `user.data.updated`.## الصلاحياتيمكن دائماً للسر الأساسي ولمفاتيح [API](https://docs.didit.me/ar/console/api-keys.md) ذات الوصول الكامل استدعاء هذا endpoint.
يحتاج المفتاح ذو الوصول المخصّص إلى صلاحية كتابة **الأشخاص** (`users`).
مع `send_verification_link: true` يحتاج أيضاً إلى صلاحية كتابة **الجلسات**، لأن الطلب ينشئ جلسة ويسلّم رابطها.
وبدونها، يُعيد الطلب `403` مع الرسالة `This API key has no write access to sessions.` ولا يُكتب شيء.
لا يستطيع مفتاح مقيّد ببعض سير العمل أو بالجلسات المعتمدة الوصول إلى هذا endpoint.تحدد [الأدوار والأذونات](https://docs.didit.me/ar/console/roles-permissions.md) في لوحة التحكم ما يستطيع عضو الفريق فعله فيها.
لا تُقيَّم هذه الأدوار والأذونات لطلبات مفاتيح API.## ذات صلة- [نموذج بيانات المستخدم](https://docs.didit.me/ar/entities/users/data-model.md)
- [رفع وجه المستخدم](https://docs.didit.me/ar/management-api/users/upload-face.md)
- [ربط بيانات المورد (vendor data)](https://docs.didit.me/ar/entities/vendor-data-linking.md)
- [عمليات المستخدم](https://docs.didit.me/ar/entities/users/operations.md)


## OpenAPI

````yaml ar/openapi-25.json POST /v3/users/create/
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/users/create/:
    post:
      tags:
        - Users
      summary: إنشاء مستخدم
      description: >-
        أنشئ [مستخدماً](/entities/users) بواسطة `vendor_data`، قبل جلسة التحقق
        أو بدونها. يجب أن يكون `vendor_data` فريداً بين مستخدمي التطبيق (تكرار
        القيمة يُرجع `400`). لا تتمتع العملية بخاصية idempotency.


        **بيانات الاتصال:** يتم تخزين `email` و`phone_number` في
        `metadata.contact`، و`country` في `metadata.address`. عندما ترسل
        `first_name` أو `last_name` دون `full_name`، يدمجهما Didit في
        `full_name`.


        **رابط التحقق:** مع `send_verification_link: true`، يُنشئ Didit أيضاً
        جلسة تحقق للشخص وفق `workflow_id` ويرسل إليه الرابط عبر البريد
        الإلكتروني إلى `email`. تُجري الجلسة الفحوصات نفسها المتبعة في [إنشاء
        جلسة](/ar/sessions-api/create-session)، مثل قائمة الحظر ورصيدك. يتم
        إنشاء الشخص والجلسة معاً أو لا يتم إنشاء أي منهما على الإطلاق: إذا فشل
        أي فحص، فلن تتم كتابة أي شيء ولن يُرسل أي بريد إلكتروني. يصف
        `verification_link` في الاستجابة الجلسة، وتكون قيمته `null` عند عدم طلب
        رابط.


        **الوصول عبر مفتاح API:** يحتاج مفتاح API ذو النطاق المحدد إلى إذن كتابة
        `users`. ومع `send_verification_link: true`، يحتاج أيضاً إلى إذن كتابة
        `sessions`، وإلا فسيُرجع الاستدعاء الرمز `403` قبل كتابة أي شيء. لا
        تتأثر المفاتيح ذات الوصول الكامل. راجع [مفاتيح
        API](/ar/console/api-keys).
      operationId: create_user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - vendor_data
              properties:
                vendor_data:
                  type: string
                  description: >-
                    معرّفك الفريد لهذا المستخدم (سلسلة نصية حرة، وليس UUID). يجب
                    أن يكون فريداً بين مستخدمي التطبيق؛ وتتم مطابقته تماماً كما
                    أُرسل.
                full_name:
                  type: string
                  nullable: true
                  maxLength: 512
                  description: الاسم القانوني الكامل للمستخدم.
                display_name:
                  type: string
                  nullable: true
                  description: >-
                    اسم العرض المألوف الظاهر في لوحة التحكم (له الأولوية على
                    `full_name` للعرض في واجهة المستخدم).
                  maxLength: 255
                date_of_birth:
                  type: string
                  format: date
                  nullable: true
                  description: تاريخ الميلاد بصيغة `YYYY-MM-DD`.
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - FLAGGED
                    - BLOCKED
                  default: ACTIVE
                  description: حالة دورة الحياة الأولية. القيمة الافتراضية هي `ACTIVE`.
                metadata:
                  type: object
                  nullable: true
                  description: كائن JSON عشوائي ترفقه بالمستخدم. القيمة الافتراضية هي `{}`.
                approved_emails:
                  type: array
                  items:
                    type: string
                  description: >-
                    عناوين البريد الإلكتروني الموثوقة مسبقاً لهذا المستخدم، على
                    سبيل المثال `["john@example.com"]`.
                approved_phones:
                  type: array
                  items:
                    type: string
                  description: >-
                    أرقام الهواتف الموثوقة مسبقاً لهذا المستخدم، على سبيل المثال
                    `["+14155551234"]`.
                issuing_states:
                  type: array
                  items:
                    type: string
                  description: >-
                    دول الإصدار المسجلة مسبقاً (ISO 3166-1 alpha-3)، على سبيل
                    المثال `["USA"]`.
                first_name:
                  type: string
                  maxLength: 255
                  description: >-
                    الاسم الشخصي. عند عدم إرسال `full_name`، تجمع Didit بين
                    `first_name` و`last_name` بمسافة في `full_name`. لا يُعاد
                    كحقل منفصل.
                last_name:
                  type: string
                  maxLength: 255
                  description: >-
                    اسم العائلة. يُدمج مع `first_name` لتكوين `full_name` عند
                    عدم إرسال `full_name`. لا يتم إرجاعه كحقل منفصل.
                email:
                  type: string
                  format: email
                  description: >-
                    البريد الإلكتروني لجهة الاتصال، مخزن في
                    `metadata.contact.email` (يستبدل `email` ترسله داخل
                    `metadata.contact`). مطلوب عندما تكون قيمة
                    `send_verification_link` هي `true`: يتم إرسال الرابط إلى هذا
                    العنوان. إذا لم يكن `metadata.contact` كائن JSON، فإن
                    الاستدعاء يُرجع `400` على هذا الحقل.
                phone_number:
                  type: string
                  maxLength: 32
                  description: >-
                    رقم هاتف التواصل، المخزن في `metadata.contact.phone_number`.
                    إذا لم يكن `metadata.contact` كائن JSON، فسيُرجع الاستدعاء
                    `400` لهذا الحقل.
                country:
                  type: string
                  maxLength: 3
                  description: >-
                    الدولة كرمز ISO 3166، بصيغة alpha-2 أو alpha-3 (`ES` أو
                    `ESP`). تُخزن بأحرف كبيرة في `metadata.address.country`. إذا
                    لم يكن `metadata.address` كائن JSON، تستجيب العملية بـ `400`
                    لهذا الحقل.
                send_verification_link:
                  type: boolean
                  default: false
                  description: >-
                    عندما تكون `true`، تُنشئ Didit جلسة تحقق للشخص وفقاً لـ
                    `workflow_id` وترسل له الرابط عبر البريد الإلكتروني إلى
                    `email`. يتطلب `email` و`workflow_id`. يتطلب مفتاح API محدد
                    النطاق أيضاً إذن كتابة لـ `sessions`.
                workflow_id:
                  type: string
                  format: uuid
                  description: >-
                    سير عمل جلسة التحقق. مطلوب عندما تكون قيمة
                    `send_verification_link` هي `true`. يجب أن يتحقق من شخص: يتم
                    رفض سير عمل التحقق من الشركات (KYB). يتم تجاهله في غير ذلك.
                language:
                  type: string
                  maxLength: 10
                  description: >-
                    لغة البريد الإلكتروني للتحقق، كرمز [لغة
                    مدعومة](/ar/integration/supported-languages). الإنجليزية عند
                    حذفه. يتم تجاهله إذا لم تكن قيمة `send_verification_link` هي
                    `true`.
            examples:
              Basic:
                summary: إنشاء بالمعلومات الأساسية
                value:
                  vendor_data: user-abc-123
                  full_name: John Doe
              Full:
                summary: جميع الحقول
                value:
                  vendor_data: user-abc-456
                  full_name: Jane Smith
                  display_name: Jane S.
                  date_of_birth: '1990-05-15'
                  status: ACTIVE
                  metadata:
                    tier: premium
                    source: api
                  approved_emails:
                    - jane@example.com
              Contact details:
                summary: الاسم والبريد الإلكتروني ورقم الهاتف والدولة
                value:
                  vendor_data: user-abc-789
                  first_name: Julia
                  last_name: Martin
                  email: julia.martin@example.com
                  phone_number: '+34600000000'
                  country: ES
              With verification link:
                summary: إنشاء الشخص وإرسال رابط التحقق إليه عبر البريد الإلكتروني
                value:
                  vendor_data: user-abc-789
                  first_name: Julia
                  last_name: Martin
                  email: julia.martin@example.com
                  send_verification_link: true
                  workflow_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  language: es
      responses:
        '201':
          description: >-
            تم إنشاء المستخدم. سجل المستخدم الكامل (بنفس شكل Get User)، بالإضافة
            إلى `verification_link`: جلسة التحقق التي أرسلها Didit بالبريد
            الإلكتروني عندما كان `send_verification_link` بقيمة `true`، وإلا
            فإنه يكون `null`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/UserDetailItem'
                  - type: object
                    required:
                      - verification_link
                    properties:
                      verification_link:
                        type: object
                        nullable: true
                        description: >-
                          جلسة التحقق التي أنشأتها Didit وأرسلتها عبر البريد
                          الإلكتروني إلى الشخص. تظهر دائماً: تكون `null` عندما
                          لا تكون قيمة `send_verification_link` هي `true`.
                        required:
                          - session_id
                          - session_number
                          - status
                          - url
                          - workflow_id
                          - email
                        properties:
                          session_id:
                            type: string
                            format: uuid
                            description: معرّف جلسة التحقق.
                          session_number:
                            type: integer
                            description: الرقم التسلسلي للجلسة داخل تطبيقك.
                          status:
                            type: string
                            description: >-
                              حالة الجلسة، وتكون `Not Started` للجلسة التي تم
                              إنشاؤها للتو.
                          url:
                            type: string
                            format: uri
                            description: >-
                              رابط التحقق الذي أرسلته Didit عبر البريد
                              الإلكتروني إلى الشخص.
                          workflow_id:
                            type: string
                            format: uuid
                            nullable: true
                            description: سير العمل الذي تُشغّله الجلسة.
                          email:
                            type: string
                            format: email
                            description: العنوان الذي أُرسل الرابط إليه.
              examples:
                Created:
                  value:
                    didit_internal_id: f4e5e1f2-94a9-4f86-8c16-2b7d9b4db418
                    vendor_data: user-abc-123
                    display_name: null
                    full_name: John Doe
                    date_of_birth: null
                    effective_name: John Doe
                    status: ACTIVE
                    metadata: {}
                    portrait_image_url: null
                    session_count: 0
                    approved_count: 0
                    declined_count: 0
                    in_review_count: 0
                    issuing_states: []
                    approved_emails: []
                    approved_phones: []
                    features: {}
                    features_list: []
                    last_session_at: null
                    last_activity_at: '2025-06-15T10:30:00Z'
                    first_session_at: null
                    tags: []
                    comments: []
                    created_at: '2025-06-15T10:30:00Z'
                    updated_at: '2025-06-15T10:30:00Z'
                    verification_link: null
                Created with verification link:
                  value:
                    didit_internal_id: 9b2f6c1e-3d4a-4e5f-8a7b-1c2d3e4f5a6b
                    vendor_data: user-abc-789
                    display_name: null
                    full_name: Julia Martin
                    date_of_birth: null
                    effective_name: Julia Martin
                    status: ACTIVE
                    metadata:
                      contact:
                        email: julia.martin@example.com
                    portrait_image_url: null
                    session_count: 1
                    approved_count: 0
                    declined_count: 0
                    in_review_count: 0
                    issuing_states: []
                    approved_emails: []
                    approved_phones: []
                    features: {}
                    features_list: []
                    last_session_at: '2025-06-15T10:30:00Z'
                    last_activity_at: '2025-06-15T10:30:00Z'
                    first_session_at: '2025-06-15T10:30:00Z'
                    tags: []
                    comments: []
                    created_at: '2025-06-15T10:30:00Z'
                    updated_at: '2025-06-15T10:30:00Z'
                    verification_link:
                      session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa7
                      session_number: 43762
                      status: Not Started
                      url: https://verify.didit.me/en/session/3FaJ9wLqX2Mz
                      workflow_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                      email: julia.martin@example.com
        '400':
          description: >-
            جسم الطلب غير صالح، مفهرساً حسب الحقل: عادةً ما يكون `vendor_data`
            مكرراً، أو حقلاً مطلوباً مفقوداً، أو قيمة بتنسيق غير صحيح. مع
            `send_verification_link: true`، قد يكون أيضاً بسبب فقدان `email` أو
            `workflow_id`، أو سير عمل غير معروف أو تابع للتحقق من الشركات (KYB)،
            أو `language` غير مدعومة (مفهرسة باسم `contact_details.email_lang`)،
            أو `vendor_data` مدرج في قائمة الحظر، أو عدم كفاية الرصيد لبدء
            الجلسة. لم يتم كتابة أي شيء.
          content:
            application/json:
              examples:
                Duplicate:
                  value:
                    vendor_data:
                      - A user with this vendor_data already exists.
                Missing vendor_data:
                  value:
                    vendor_data:
                      - This field is required.
                Bad metadata:
                  value:
                    metadata:
                      - Metadata must be a JSON object.
                Bad status:
                  value:
                    status:
                      - >-
                        Invalid status. Valid options are: ACTIVE, FLAGGED,
                        BLOCKED
                Bad country:
                  value:
                    country:
                      - Use an ISO 3166 country code, like ES or ESP.
                Contact not an object:
                  value:
                    email:
                      - >-
                        metadata.contact must be a JSON object to store this
                        value.
                Address not an object:
                  value:
                    country:
                      - >-
                        metadata.address must be a JSON object to store this
                        value.
                Link without email or workflow:
                  value:
                    email:
                      - >-
                        An email address is required to send a verification
                        link.
                    workflow_id:
                      - Pick the workflow to send a verification link for.
                Unknown workflow:
                  value:
                    workflow_id:
                      - Invalid workflow_id.
                Business workflow:
                  value:
                    workflow_id:
                      - >-
                        This workflow verifies a business. Pick a workflow that
                        verifies a person to send them a verification link.
                Blocklisted vendor_data:
                  value:
                    vendor_data: >-
                      This user or business has been blocked and cannot create
                      new verification sessions.
                Insufficient credits:
                  value:
                    detail: >-
                      You don't have enough credits to perform this request.
                      Please top up at https://business.didit.me
        '401':
          description: >-
            لم يتم توفير بيانات اعتماد. الطلبات المرسلة إلى مسارات `/v3/users/*`
            بدون رأس `x-api-key` (أو رمز `Authorization: Bearer`) يتم رفضها
            بواسطة برمجية المصادقة الوسيطة قبل وصولها إلى الـ API.
          content:
            application/json:
              examples:
                Missing credentials:
                  value:
                    detail: >-
                      You must be authenticated with a valid access token to
                      access this endpoint.
        '403':
          description: >-
            مفتاح API غير صالح أو تم إلغاؤه، أو أن المفتاح لا يملك صلاحية إنشاء
            مستخدمين لهذا التطبيق. يحتاج مفتاح API مقيّد النطاق إلى صلاحية كتابة
            `users`، وكذلك صلاحية كتابة `sessions` عندما يكون
            `send_verification_link` بقيمة `true`؛ لم يُكتب أي شيء. يُرجع
            المفتاح المفقود `403`؛ بينما يُرجع المفتاح غير الصحيح أو المُلغى أو
            المنتهي الصلاحية `401`.
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
                No sessions write:
                  summary: مفتاح محدد النطاق يطلب رابط التحقق بدون إذن كتابة للجلسات
                  value:
                    detail: This API key has no write access to sessions.
        '429':
          description: >-
            تم تجاوز حد المعدل؛ تراجع مؤقتاً وأعد المحاولة بعد الفاصل الزمني
            الموضح في `Retry-After`.
          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/users/create/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"vendor_data": "user-abc-123", "full_name": "John Doe"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.users.create(
                vendor_data="user-abc-123",
                full_name="John Doe",
            )
            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.users.create({
              vendor_data: "user-abc-123",
              full_name: "John Doe",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Users.Create(ctx, didit.UsersCreateParams{\n\tVendorData: \"user-abc-123\",\n\tFullName:   didit.String(\"John Doe\"),\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.UsersCreateParams;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            var result = client.users().create(UsersCreateParams.builder()
                    .vendorData("user-abc-123")
                    .fullName("John Doe")
                    .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->users->create([
                'vendor_data' => 'user-abc-123',
                'full_name' => 'John Doe',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.users.create(
              vendor_data: "user-abc-123",
              full_name: "John Doe"
            )
            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.Users.CreateAsync(new UsersCreateParams
            {
                VendorData = "user-abc-123",
                FullName = "John Doe",
            });
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    UserDetailItem:
      type: object
      description: >-
        تفاصيل المستخدم الكاملة. يوسع UserListItem بالبيانات الوصفية،
        والتعليقات، وحقل updated_at.
      allOf:
        - $ref: '#/components/schemas/UserListItem'
        - type: object
          properties:
            metadata:
              type: object
              description: >-
                بيانات وصفية مخصصة بتنسيق JSON أرفقتها بهذا المستخدم. القيمة
                الافتراضية هي `{}`.
            tags:
              type: array
              description: >-
                تعيينات العلامات. ملاحظة: في استجابات التفاصيل يكون كل إدخال
                كائن *ربط* علامة (`{uuid, tag: {...}, added_by_email,
                added_by_name, created_at}`)، على عكس التنسيق المسطح `{uuid,
                name, color}` المُستخدم في استجابات القوائم.
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: معرّف UUID لتعيين الوسم (وليس الوسم نفسه).
                  tag:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      name:
                        type: string
                      color:
                        type: string
                      description:
                        type: string
                        nullable: true
                      source:
                        type: string
                        enum:
                          - didit
                          - custom
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                  added_by_email:
                    type: string
                    nullable: true
                  added_by_name:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
            comments:
              type: array
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                  comment_type:
                    type: string
                    enum:
                      - COMMENT
                      - STATUS_CHANGED
                      - METADATA_UPDATED
                      - TAG_ADDED
                      - TAG_REMOVED
                      - PROFILE_UPDATED
                  comment:
                    type: string
                    nullable: true
                  actor_email:
                    type: string
                    nullable: true
                  actor_name:
                    type: string
                    nullable: true
                  previous_status:
                    type: string
                    nullable: true
                    enum:
                      - ACTIVE
                      - FLAGGED
                      - BLOCKED
                      - null
                  new_status:
                    type: string
                    nullable: true
                    enum:
                      - ACTIVE
                      - FLAGGED
                      - BLOCKED
                      - null
                  previous_value:
                    type: object
                    nullable: true
                    description: قيم الحقول السابقة لإدخالات PROFILE_UPDATED.
                  new_value:
                    type: object
                    nullable: true
                    description: قيم الحقول الجديدة لمدخلات PROFILE_UPDATED.
                  changed_fields:
                    type: array
                    items:
                      type: string
                    description: أسماء الحقول التي تم تغييرها بواسطة إدخال PROFILE_UPDATED.
                  metadata:
                    type: object
                    nullable: true
                  mentioned_emails:
                    type: array
                    items:
                      type: string
                  created_at:
                    type: string
                    format: date-time
              description: >-
                سجل الأنشطة والتعليقات الخاصة بهذا المستخدم (تغييرات الحالة،
                تعديلات الملف التعريفي، الملاحظات اليدوية).
            updated_at:
              type: string
              format: date-time
    UserListItem:
      type: object
      description: مستخدم تم التحقق منه.
      properties:
        didit_internal_id:
          type: string
          format: uuid
          description: معرّف UUID الداخلي الثابت من Didit لهذا المستخدم.
        vendor_data:
          type: string
          nullable: true
          description: >-
            معرّفك الفريد لهذا المستخدم (يتم تمريره عند إنشاء الجلسات). يمكن أن
            يكون هذا null في حال عدم تقديم معرّف بائع.
        display_name:
          type: string
          nullable: true
          description: اسم عرض مخصص تم تعيينه بواسطتك
        full_name:
          type: string
          nullable: true
          description: الاسم الكامل المستخرج من المستندات التي تم التحقق منها
        date_of_birth:
          type: string
          format: date
          nullable: true
        effective_name:
          type: string
          nullable: true
          description: 'أفضل اسم متاح: display_name إذا كان محدداً، وإلا فـ full_name'
        status:
          type: string
          enum:
            - ACTIVE
            - FLAGGED
            - BLOCKED
          description: >-
            حالة دورة حياة سجل المستخدم (ليست حالة جلسة). القيمة الافتراضية هي
            `ACTIVE`، و`FLAGGED` تميز المستخدم للمراجعة اليدوية، و`BLOCKED` تمنع
            إنشاء جلسات جديدة لقيمة `vendor_data` هذه.
        portrait_image_url:
          type: string
          nullable: true
          description: >-
            رابط موقع مسبقاً للصورة الشخصية للمستخدم (تنتهي صلاحيته بعد بضع
            ساعات)
        session_count:
          type: integer
          description: العدد الإجمالي لجلسات التحقق لهذا المستخدم
        approved_count:
          type: integer
          description: عدد الجلسات المقبولة
        declined_count:
          type: integer
          description: عدد الجلسات المرفوضة
        in_review_count:
          type: integer
          description: عدد الجلسات قيد المراجعة
        issuing_states:
          type: array
          items:
            type: string
          description: >-
            رموز ISO 3166-1 alpha-3 لدول الإصدار الواردة في مستندات الهوية
            المقبولة لهذا المستخدم، مثل `["USA", "ESP"]`. مصفوفة فارغة في حال
            عدم وجود أي منها.
        approved_emails:
          type: array
          items:
            type: string
          description: >-
            عناوين البريد الإلكتروني التي تم التحقق منها والمجمعة من الجلسات
            المقبولة لهذا المستخدم، على سبيل المثال `["john@example.com"]`.
        approved_phones:
          type: array
          items:
            type: string
          description: >-
            أرقام الهواتف التي تم التحقق منها والمجمعة من الجلسات المقبولة لهذا
            المستخدم، على سبيل المثال `["+14155551234"]`.
        features:
          type: object
          description: >-
            الحالة المجمعة لكل ميزة عبر جميع جلسات هذا المستخدم. المفاتيح
            المحتملة: `ID_VERIFICATION`، `NFC`، `LIVENESS`، `FACE_MATCH`، `POA`،
            `QUESTIONNAIRE`، `EMAIL_VERIFICATION`، `PHONE`، `AML`،
            `IP_ANALYSIS`، `AGE_ESTIMATION`، `DATABASE_VALIDATION`. القيم
            المحتملة: `Approved`، `Declined`، `In Review`، `Not Finished`،
            `Resub Requested`.
        features_list:
          type: array
          items:
            type: object
            properties:
              feature:
                type: string
              status:
                type: string
          description: >-
            البيانات نفسها مثل `features`، كمصفوفة مرتبة من كائنات `{feature,
            status}`.
        last_session_at:
          type: string
          format: date-time
          nullable: true
          description: الطابع الزمني لأحدث جلسة
        first_session_at:
          type: string
          format: date-time
          nullable: true
          description: الطابع الزمني للجلسة الأولى
        last_activity_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            الطابع الزمني لأحدث نشاط لهذا المستخدم (جلسة، معاملة، تغيير حالة،
            تعديل بيانات، إلخ).
        tags:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              name:
                type: string
              color:
                type: string
          description: العلامات المعيّنة لهذا المستخدم
        created_at:
          type: string
          format: date-time
  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.