> ## 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: تنزيل الكل في ملف ZIP واحد

> POST /v3/session/{id}/files-export/ لإعداد ملف ZIP واحد يضم كل الصور والفيديوهات والمستندات لجلسة KYC أو KYB بجودتها الأصلية في Didit.

تحضير ملف ZIP واحد يضم كل ملفات جلسة التحقق من المستخدمين (KYC) أو التحقق من الشركات (KYB): وجهي المستند، وصور السيلفي، وفيديوهات كشف الحيوية، والمستندات المرفوعة، بالجودة الأصلية.

يُجهَّز ملف ZIP في الخلفية. يُرجع الاستدعاء الرمز `202` مع التصدير؛ اقرأه عبر [الحصول على تصدير الملفات](https://docs.didit.me/ar/sessions-api/get-files-export.md) حتى تصبح قيمة `status` هي `READY`، ثم حمّل `download_url`.

* أثناء تحضير تصدير للجلسة نفسها، يُرجع الاستدعاء ذلك التصدير بدلاً من بدء تصدير جديد.
* يُحذف ملف ZIP بعد 24 ساعة من جاهزيته، وفوراً عند حذف الجلسة.
* لا يمكن تصدير جلسة محذوفة: يُرجع الاستدعاء `404`.
* يُسجَّل كل تصدير في سجل التدقيق الخاص بالجلسة.
* يحتاج مفتاح API مقيّد النطاق إلى `media: read` و`decisions: read`.


## OpenAPI

````yaml ar/openapi-25.json POST /v3/session/{sessionId}/files-export/
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}/files-export/:
    post:
      tags:
        - Sessions
      summary: تصدير كل ملفات الجلسة
      description: >-
        بدء إعداد ملف ZIP واحد يحتوي على كل صورة وفيديو ومستند من جلسة التحقق من
        المستخدمين (KYC) أو التحقق من الشركات (KYB)، بالجودة الأصلية: يتم تخزين
        الملفات في ملف ZIP تماماً كما تم التقاطها دون إعادة ضغطها مطلقاً. يستجيب
        بـ `202` مع التصدير؛ اقرأه باستخدام `GET
        /v3/session/{sessionId}/files-export/{exportId}/` حتى تصبح `status` هي
        `READY`، ثم نزّل `download_url`. طالما لا يزال تصدير لنفس الجلسة قيد
        الإعداد، يتم إرجاع ذلك التصدير بدلاً من إنشاء تصدير جديد.


        يُحذف ملف ZIP بعد 24 ساعة من جاهزيته، وفوراً عند حذف الجلسة. لا يمكن
        تصدير جلسة محذوفة. يتم تسجيل كل عملية تصدير وكل رابط تنزيل يُمنح في سجل
        التدقيق الخاص بالجلسة. يحتاج مفتاح API محدد الصلاحيات إلى `media: read`
        و`decisions: read`؛ ويحتاج مستخدم لوحة التحكم إلى صلاحية قراءة الجلسات.
      operationId: post_v3_session_files_export
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            معرّف UUID لجلسة التحقق (`session_id` الذي تم إرجاعه بواسطة `POST
            /v3/session/`). يقبل معرّفات جلسات التحقق من المستخدمين (KYC)
            والتحقق من الشركات (KYB). تُرجع الجلسة المحذوفة `404`.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
      responses:
        '202':
          description: التصدير، قيد الإعداد.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionFilesExport'
              example:
                export_id: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
                session_id: 11111111-2222-3333-4444-555555555555
                status: PENDING
                file_count: null
                size_bytes: null
                download_url: null
                expires_at: null
                error: null
                created_at: '2026-10-29T12:00:03Z'
                completed_at: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/files-export/'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.export_files(
                "11111111-2222-3333-4444-555555555555",
            )
            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.exportFiles("11111111-2222-3333-4444-555555555555");

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.ExportFiles(ctx, \"11111111-2222-3333-4444-555555555555\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().exportFiles("11111111-2222-3333-4444-555555555555");

            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->exportFiles('11111111-2222-3333-4444-555555555555');

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


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result =
            didit.sessions.export_files("11111111-2222-3333-4444-555555555555")

            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.ExportFilesAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    SessionFilesExport:
      type: object
      description: ملف ZIP واحد يحتوي على كل ملفات الجلسة، بالجودة الأصلية.
      required:
        - export_id
        - session_id
        - status
        - file_count
        - size_bytes
        - download_url
        - expires_at
        - error
        - created_at
        - completed_at
      properties:
        export_id:
          type: string
          format: uuid
          description: >-
            معرّف التصدير. مرره إلى `GET
            /v3/session/{sessionId}/files-export/{exportId}/`.
        session_id:
          type: string
          format: uuid
          description: الجلسة التي تنتمي إليها الملفات.
        status:
          type: string
          enum:
            - PENDING
            - PROCESSING
            - READY
            - FAILED
            - EXPIRED
          description: >-
            `PENDING` و`PROCESSING` أثناء إعداد ملف ZIP، و`READY` بمجرد أن يصبح
            قابلاً للتنزيل، و`FAILED` عندما يتعذر إعداده (اطلب عملية تصدير
            جديدة)، و`EXPIRED` بمجرد حذف ملف ZIP.
        file_count:
          type: integer
          nullable: true
          description: >-
            الملفات الموجودة في ملف ZIP. تُعيّن فقط عندما تكون `status` هي
            `READY`.
        size_bytes:
          type: integer
          format: int64
          nullable: true
          description: حجم ملف ZIP بالبايت. يُعيَّن فقط عندما تكون `status` هي `READY`.
        download_url:
          type: string
          format: uri
          nullable: true
          description: >-
            رابط URL موقّع لملف ZIP، صالح لفترة قصيرة. يُعيَّن فقط عندما تكون
            `status` هي `READY`؛ اقرأ التصدير مجدداً للحصول على رابط جديد.
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            وقت حذف ملف ZIP، بعد 24 ساعة من جاهزيته. لا يُعيَّن إلا عندما تكون
            `status` هي `READY`.
        error:
          type: string
          nullable: true
          description: سبب فشل التصدير، عندما تكون قيمة `status` هي `FAILED`.
        created_at:
          type: string
          format: date-time
          description: وقت طلب التصدير.
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: وقت جاهزية ملف ZIP أو فشل التصدير.
  responses:
    Unauthorized:
      description: غير مصرح به
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: مفتاح API غير صالح
              value:
                detail: Invalid API Key.
    Forbidden:
      description: محظور
      content:
        application/json:
          examples:
            No Permission:
              summary: لا يوجد إذن
              value:
                detail: You do not have permission to perform this action.
            Not Enough Credits:
              summary: الرصيد غير كافٍ
              value:
                error: >-
                  You don't have enough credits to perform this request. Please
                  top up at https://business.didit.me
    NotFound:
      description: غير موجود
      content:
        application/json:
          examples:
            Not Found:
              summary: غير موجود
              value:
                detail: Resource not found.
  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.