> ## 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: حظر عناصر الجلسة

> POST /v3/blocklist/add/: أضف وجه أو مستند أو رقم هاتف أو بريد إلكتروني من جلسة تحقق في Didit إلى قائمة الحظر لرفض الجلسات المطابقة الجديدة.



موجه واجهة API لإضافة عناصر إلى قائمة الحظر
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Blocklist the face, document, phone number or email address of one of my Didit verification sessions through the Management API.

Endpoint:
POST https://verification.didit.me/v3/blocklist/add/

Authentication:
Use the x-api-key header with my Didit API key. A scoped API key needs workflows: write.

Goal:
\- After reviewing a fraudulent session, block what it collected so the same person is declined next time.

Request body (application/json):
\{
"session_id": "33333333-4444-5555-6666-777777777777", // required: a verification session of my application
"blocklist_face": true,       // optional, default false
"blocklist_document": true,   // optional, default false
"blocklist_phone": false,     // optional, default false
"blocklist_email": false      // optional, default false
}
At least one blocklist_* flag must be true.

Behavior:
\- Didit uses the session's most recent record of each selected type.
\- Each selected record is flagged as blocklisted and gets an entry, linked to the session, in the matching system blocklist (added_by "api").
\- From then on, new sessions with a matching face, document number, phone number or email address are declined.
\- The session itself and sessions that already finished are not changed.
\- Safe to repeat: an item already listed keeps its single entry, and its blocklisted_at is refreshed.
\- All or nothing: Didit checks every selected item first. If one is missing, nothing is blocklisted.
\- A document needs its issuing state, document type, document number and full name.

Example call:
curl -X POST "https://verification.didit.me/v3/blocklist/add/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session_id": "33333333-4444-5555-6666-777777777777", "blocklist_face": true, "blocklist_document": true}'

Example response (200):
\{ "message": "Successfully updated blocklist." }

Failure modes:
\- 400: session_id is missing ({ "session_id": ["This field is required."] }) or not a UUID ({ "session_id": ["Must be a valid UUID."] }); the session is not a verification session of this application ({ "non_field_errors": ["Session not found"] }; business verification sessions are not accepted); no flag is true ({ "non_field_errors": ["Must specify at least one item to blocklist"] }); the session has no record of a selected type ({ "non_field_errors": ["Session does not have a face record"] }); or the document lacks a required field.
\- 401: the API key has expired.
\- 403: missing x-api-key (a wrong, revoked or expired key gets 401) ({ "detail": "You do not have permission to perform this action." }), or a scoped key without workflows: write.
\- 429: rate limited (see /integration/rate-limiting); back off and retry.

Side effects:
\- Writes entries to the system face, document, phone and email blocklists and blocks matching new sessions.

To block a value without a session, or an IP address, device fingerprint, user or business, use POST /v3/lists/{list_uuid}/entries/ on the matching system blocklist instead.

For the full integration shape, see /integration/integration-prompt.`

\</pre>



      
      

الصق في

أضِف إلى قائمة الحظر ما جمعته جلسة تحقق واحدة: الوجه، ومستند الهوية، ورقم الهاتف، أو عنوان البريد الإلكتروني. يضع Didit علامة "محظور" على كل سجل محدد، ويضيفه إلى قائمة الحظر المقابلة في النظام، مرتبطًا بالجلسة. بعد ذلك، تُرفض الجلسات الجديدة التي تتطابق وجوهها أو أرقام مستنداتها أو أرقام هواتفها أو عناوين بريدها الإلكتروني.> [!NOTE]
>
> العملية إما أن تنجح كاملةً أو لا تُنفَّذ أيًا منها: إذا لم تتضمن الجلسة سجلًا من النوع المحدد، أو إذا كان المستند يفتقر إلى دولة الإصدار أو نوع المستند أو رقم المستند أو الاسم الكامل، تُرجع العملية `400` ولا يُضاف أي عنصر إلى قائمة الحظر. إعادة الاستدعاء لعنصر مُضاف مسبقًا إلى قائمة الحظر آمنة.لمراجعة العناصر المحظورة، استخدم [قائمة العناصر المحظورة](https://docs.didit.me/ar/management-api/blocklist/list.md). لرفع الحظر، استخدم [إزالة من قائمة الحظر](https://docs.didit.me/ar/management-api/blocklist/remove.md). لحظر عنوان IP أو بصمة جهاز أو مستخدم أو شركة أو قيمة غير مرتبطة بجلسة، أضِف إدخالًا إلى قائمة الحظر المقابلة في النظام باستخدام [إنشاء إدخال](https://docs.didit.me/ar/management-api/lists/create-entry.md). راجع [قائمة الحظر الخاصة بالمستخدم](https://docs.didit.me/ar/entities/users/blocklist.md) لمعرفة كيفية تطبيق قوائم الحظر.


## OpenAPI

````yaml ar/openapi-25.json POST /v3/blocklist/add/
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/blocklist/add/:
    post:
      tags:
        - Blocklist
      summary: إضافة عناصر الجلسة إلى قائمة الحظر
      description: >-
        يضيف الوجه أو مستند الهوية أو رقم الهاتف أو البريد الإلكتروني الخاص
        بجلسة تحقق لشخص واحد في التطبيق إلى قائمة الحظر. لكل نوع محدد، تأخذ
        Didit السجل الأحدث للجلسة، وتضع عليه علامة تفيد بأنه مدرج في قائمة
        الحظر، وتضيف مدخلاً مرتبطاً بالجلسة إلى قائمة الحظر المطابقة في النظام
        (`added_by: "api"`)، بحيث يتم رفض الجلسات الجديدة التي تطابق الوجه أو
        رقم المستند أو رقم الهاتف أو البريد الإلكتروني. يتم التحقق من كل عنصر
        محدد أولاً، وبالتالي إذا كان أحدها مفقوداً فلن تتم إضافة أي شيء إلى
        قائمة الحظر؛ وتكرار الاستدعاء لعنصر مدرج بالفعل يحتفظ بمدخله الفردي
        ويُحدّث `blocklisted_at`. لا تتغير الجلسة نفسها والجلسات التي انتهت
        بالفعل. يتطلب مفتاح API محدد النطاق الصلاحية `workflows: write`.
      operationId: add_to_blocklist
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - session_id
              description: >-
                يجب أن تكون علامة `blocklist_*` واحدة على الأقل مضبوطة على
                `true`.
              properties:
                session_id:
                  type: string
                  format: uuid
                  description: جلسة تحقق من شخص تابعة لتطبيقك. يتم رفض الجلسات المحذوفة.
                blocklist_face:
                  type: boolean
                  default: false
                  description: إضافة وجه الجلسة إلى قائمة الحظر.
                blocklist_document:
                  type: boolean
                  default: false
                  description: >-
                    إضافة مستند الهوية للجلسة إلى قائمة الحظر. يتطلب المستند
                    دولة إصداره ونوعه ورقمه والاسم الكامل.
                blocklist_phone:
                  type: boolean
                  default: false
                  description: إضافة رقم هاتف الجلسة إلى قائمة الحظر.
                blocklist_email:
                  type: boolean
                  default: false
                  description: إضافة البريد الإلكتروني للجلسة إلى قائمة الحظر.
            examples:
              Face and document:
                value:
                  session_id: 33333333-4444-5555-6666-777777777777
                  blocklist_face: true
                  blocklist_document: true
              Phone only:
                value:
                  session_id: 33333333-4444-5555-6666-777777777777
                  blocklist_phone: true
      responses:
        '200':
          description: تمت إضافة العناصر المحددة إلى قائمة الحظر.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    description: دائماً `Successfully updated blocklist.`
              examples:
                Blocklisted:
                  value:
                    message: Successfully updated blocklist.
        '400':
          description: >-
            نص الطلب غير صالح، أو أن الجلسة ليست جلسة تحقق تابعة لهذا التطبيق،
            أو ليس لديها سجل من النوع المحدد. لم تتم إضافة أي شيء إلى قائمة
            الحظر.
          content:
            application/json:
              examples:
                Unknown session:
                  value:
                    non_field_errors:
                      - Session not found
                No item selected:
                  value:
                    non_field_errors:
                      - Must specify at least one item to blocklist
                No face record:
                  value:
                    non_field_errors:
                      - Session does not have a face record
                Incomplete document:
                  value:
                    non_field_errors:
                      - >-
                        To blocklist a document, the document must have an
                        issuing state, document type, document number and full
                        name
                Invalid session id:
                  value:
                    session_id:
                      - Must be a valid UUID.
                Missing session id:
                  value:
                    session_id:
                      - This field is required.
        '401':
          description: >-
            انتهت صلاحية مفتاح API محدد النطاق. تُرجع حالات فشل المصادقة الأخرى
            الرمز `403`.
          content:
            application/json:
              examples:
                Expired API key:
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            رأس `x-api-key` مفقود (المفتاح الخاطئ أو الملغى أو منتهي الصلاحية
            يحصل على `401`)، أو أن مفتاح API محدد النطاق يفتقر إلى `workflows:
            write` أو تم استخدامه من عنوان IP خارج قائمة السماح الخاصة به.
          content:
            application/json:
              examples:
                Missing or invalid API key:
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without workflows access:
                  value:
                    detail: This API key has no write access to workflows.
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/blocklist/add/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "session_id": "33333333-4444-5555-6666-777777777777",
                "blocklist_face": true,
                "blocklist_document": true
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.blocklist.add(
                session_id="33333333-4444-5555-6666-777777777777",
                blocklist_face=True,
                blocklist_document=True,
            )
            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.blocklist.add({
              session_id: "33333333-4444-5555-6666-777777777777",
              blocklist_face: true,
              blocklist_document: true,
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Blocklist.Add(ctx, didit.BlocklistAddParams{\n\tSessionID:         \"33333333-4444-5555-6666-777777777777\",\n\tBlocklistFace:     didit.Bool(true),\n\tBlocklistDocument: didit.Bool(true),\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.BlocklistAddParams;

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

            var result = client.blocklist().add(BlocklistAddParams.builder()
                    .sessionId("33333333-4444-5555-6666-777777777777")
                    .blocklistFace(true)
                    .blocklistDocument(true)
                    .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->blocklist->add([
                'session_id' => '33333333-4444-5555-6666-777777777777',
                'blocklist_face' => true,
                'blocklist_document' => true,
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.blocklist.add(
              session_id: "33333333-4444-5555-6666-777777777777",
              blocklist_face: true,
              blocklist_document: true
            )
            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.Blocklist.AddAsync(new BlocklistAddParams
            {
                SessionId = "33333333-4444-5555-6666-777777777777",
                BlocklistFace = true,
                BlocklistDocument = true,
            });
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  responses:
    RateLimitedWrite:
      description: >-
        تم تجاوز حد الكتابة المشترك البالغ 300 طلب في الدقيقة لكل مفتاح API.
        التزم بالمدة المحددة في `Retry-After` قبل إعادة المحاولة.
      content:
        application/json:
          schema:
            type: object
            required:
              - detail
            properties:
              detail:
                type: string
          example:
            detail: >-
              Write request rate limit exceeded. You can make up to 300 requests
              per minute.
  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.