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

# تصدير سجل فحص AML بصيغة CSV عبر API

> تنزيل سجل المراقبة المستمرة لـ AML لجلسة من Didit بصيغة CSV، بسطر لكل إعادة فحص مكتملة، جاهز لتسليمه إلى المدقق.

موجّه واجهة برمجة تطبيقات تصدير سجل فحوصات AML
نسخ الموجّه إلى الحافظة

<pre>
  \`Download the ongoing AML monitoring history of one Didit verification session as a CSV file through the API.

  Endpoint:
  GET [https://verification.didit.me/v3/session/\{session\_id}/aml-screening-history/export/](https://verification.didit.me/v3/session/\{session_id}/aml-screening-history/export/)

  Authentication:
  Send my Didit API key in the x-api-key header. A scoped key needs decisions: read and media: read (the response is a file; without media: read the call returns 403).

  Goal:

  * Produce the audit evidence that ongoing AML monitoring ran for a subject, as a file a compliance team can hand to an auditor.

  Query parameters:

  * node\_id (optional): the workflow node ID of the AML check when the session ran several AML steps. Without it, the most recent AML check is used.

  Behavior:

  * Works for user (KYC) and business (KYB) session IDs.
  * Streams text/csv with Content-Disposition: attachment; filename="aml-screening-history-SESSION\_ID.csv". Not paginated: the file holds the whole history, newest first.
  * The first line is the header. Each following line is one completed re-screen.
  * Columns: screened\_at, outcome, provider, aml\_status, aml\_score, total\_hits, datasets\_captured\_at, datasets\_sanctions\_last\_updated\_at, datasets\_pep\_last\_updated\_at, datasets\_warnings\_last\_updated\_at, datasets\_adverse\_media\_last\_updated\_at, datasets\_catalog\_version.
  * Empty cell = unknown. Dataset dates are never estimated.
  * provider is an identifier of the data source; treat it as an opaque string.
  * Values that would start a spreadsheet formula (=, +, -, @) are prefixed with an apostrophe.
  * Errors come back as JSON, not CSV.

  Example call:
  curl -X GET "[https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/aml-screening-history/export/](https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/aml-screening-history/export/)" \
  -H "x-api-key: YOUR\_API\_KEY" \
  -o aml-screening-history.csv

  Failure modes:

  * 401: the API key has expired.
  * 403: missing key (a wrong, revoked or expired key gets 401), a key of another application, a scoped key without decisions: read or media: read, or a request from outside the key's IP allowlist.
  * 404: the session does not exist, was deleted, or is outside a scoped key's limits, or it has no AML check (for that node\_id).

  Side effects: none. This is a pure read.

  For the full integration shape, see /integration/integration-prompt.\`
</pre>

الصق في

يحتوي الملف على الفحوصات نفسها الواردة في [قائمة سجل فحوصات AML](https://docs.didit.me/ar/management-api/sessions/aml-screening-history.md)، مع تحويل كل فحص إلى سطر واحد، وتاريخ تحديث مجموعة البيانات لكل عائلة من القوائم (العقوبات، PEP، التحذيرات، الأخبار السلبية) حيثما أُبلغ عن هذا التاريخ. كما تتيح Business Console التصدير نفسه بجوار نتيجة AML. راجع [مراقبة AML المستمرة](https://docs.didit.me/ar/core-technology/aml-screening/continuous-monitoring-aml-screening.md) لمعرفة معنى كل قيمة.


## OpenAPI

````yaml ar/openapi-25.json GET /v3/session/{sessionId}/aml-screening-history/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}/aml-screening-history/export/:
    get:
      tags:
        - Sessions
      summary: تصدير سجل فحص AML بتنسيق CSV
      description: >-
        تنزيل سجل المراقبة المستمرة نفسه كما في `GET
        /v3/session/{sessionId}/aml-screening-history/` كملف CSV، بمعدل سطر واحد
        لكل عملية إعادة فحص مكتملة، الأحدث أولاً، وجاهز لتقديمه إلى مدقق
        الحسابات. يتم بث الملف كاملاً (من دون تقسيم إلى صفحات) ويبدأ بسطر رأس؛
        وتعني الخلية الفارغة غير معروف، ولا يتم تقدير تواريخ مجموعات البيانات
        أبداً، وتُسبق القيمة التي تبدأ صيغة جدول بيانات بفاصلة عليا. يعمل مع
        معرّفات جلسات KYC وKYB؛ مرِّر `node_id` عندما تُشغّل الجلسة أكثر من خطوة
        AML واحدة. مرِّر `month` لتصدير شهر تقويمي واحد. يتم إرجاع الأخطاء
        بتنسيق JSON وليس CSV. يحتاج مفتاح API ذو النطاق المحدد إلى `decisions:
        read` و`media: read`: نظراً لأن الاستجابة عبارة عن ملف، فإن المفتاح الذي
        لا يحتوي على `media: read` يحصل على `403`.
      operationId: get_v3_session_aml_screening_history_export
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            معرّف UUID لجلسة التحقق (`session_id` الذي تم إرجاعه بواسطة `POST
            /v3/session/`). يقبل معرّفات جلسات التحقق من المستخدمين (KYC)
            والتحقق من الشركات (KYB): يطابق الخادم المعرّف عبر كلا نوعي الجلسات.
            يجب أن يكون UUID صالح البنية؛ تؤدي القيمة غير صالحة البنية إلى عدم
            مطابقة المسار وإرجاع `404` بتنسيق HTML.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: node_id
          in: query
          required: false
          description: >-
            معرّف عقدة مخطط سير العمل لفحص AML. مطلوب فقط عندما تُجري الجلسة
            أكثر من خطوة AML واحدة؛ بدونه يتم استخدام أحدث فحص AML. يُرجع
            الاستدعاء `404` عند تحديد عقدة غير معروفة.
          schema:
            type: string
            example: feature_aml_1
        - name: month
          in: query
          required: false
          description: >-
            شهر تقويمي بتوقيت UTC بصيغة `YYYY-MM`. يتم إرجاع عمليات الفحص
            المكتملة في ذلك الشهر فقط؛ ومن دونه يتم إرجاع كل شهر. يُرجع الشهر
            غير الصالح `400`.
          schema:
            type: string
            pattern: ^\d{4}-(0[1-9]|1[0-2])$
            example: 2026-09
      responses:
        '200':
          description: >-
            ملف CSV، يتم بثه بتنسيق `text/csv` بنهايات أسطر CRLF. الأعمدة
            بالترتيب: `screened_at` (وقت انتهاء إعادة الفحص)، و`outcome`
            (`NO_CHANGE` أو `CHANGED` أو `FAILED`)، و`provider` (معرّف مبهم
            لمصدر بيانات AML؛ لا تفرّع بناءً عليه)، و`aml_status`، و`aml_score`،
            و`total_hits`، و`datasets_captured_at`،
            و`datasets_sanctions_last_updated_at`،
            و`datasets_pep_last_updated_at`،
            و`datasets_warnings_last_updated_at`،
            و`datasets_adverse_media_last_updated_at`،
            و`datasets_catalog_version`، و`run_id` (تشغيل المراقبة)،
            و`entities_screened` (`1`، أو `0` للتشغيل الفاشل) و`new_hits` (فارغ
            عندما يكون غير معروف). التواريخ بتنسيق ISO 8601 مع فارق UTC. تُرجع
            الجلسة التي ليس لها عمليات إعادة فحص بعد سطر الرأس فقط.
          headers:
            Content-Disposition:
              description: >-
                `attachment; filename="aml-screening-history-{sessionId}.csv"`،
                أو `aml-screening-history-{sessionId}-{month}.csv` عند تمرير
                `month`.
              schema:
                type: string
                example: >-
                  attachment;
                  filename="aml-screening-history-11111111-2222-3333-4444-555555555555.csv"
          content:
            text/csv:
              schema:
                type: string
                format: binary
              example: "screened_at,outcome,provider,aml_status,aml_score,total_hits,datasets_captured_at,datasets_sanctions_last_updated_at,datasets_pep_last_updated_at,datasets_warnings_last_updated_at,datasets_adverse_media_last_updated_at,datasets_catalog_version,run_id,entities_screened,new_hits\r\n2026-09-14T04:12:33.481207+00:00,NO_CHANGE,aml_data_source,Approved,0.0,0,2026-09-14T03:58:02.114820+00:00,2026-09-13T21:10:00+00:00,2026-09-13T08:00:00+00:00,2026-09-12T18:45:00+00:00,,2026-09-13,aaaaaaaa-1111-2222-3333-444444444444,1,0\r\n2026-09-13T04:11:58.020914+00:00,FAILED,aml_data_source,Approved,0.0,0,,,,,,,bbbbbbbb-1111-2222-3333-444444444444,0,\r\n"
        '400':
          description: '`month` ليس شهراً تقويمياً بصيغة `YYYY-MM`.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  month:
                    type: array
                    items:
                      type: string
              examples:
                Malformed month:
                  summary: month=2026-13
                  value:
                    month:
                      - Not a calendar month. Use YYYY-MM.
        '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 read:
                  summary: 'المفتاح محدد النطاق يفتقر إلى decisions: read'
                  value:
                    detail: This API key has no read access to decisions.
                Scoped key without media read:
                  summary: >-
                    المفتاح محدد النطاق يفتقر إلى media: read (الاستجابة عبارة
                    عن ملف)
                  value:
                    detail: This API key has no read access to media.
                IP not allowed:
                  summary: الطلب وارد من خارج قائمة IP المسموح بها للمفتاح
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            الجلسة غير موجودة، أو تم حذفها، أو أنها خارج حدود مفتاح ذي نطاق
            محدد، أو ليس لديها فحص AML (لقيمة `node_id` المحددة). يتم البحث عن
            الجلسة قبل التحقق من بيانات الاعتماد، لذلك فإن معرّف `sessionId` غير
            المعروف يُعيد `404` حتى بدون مفتاح صالح.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              examples:
                Unknown session:
                  summary: لا توجد جلسة بهذا المعرّف، أو أنها حُذفت
                  value:
                    detail: Not found.
                Outside key limits:
                  summary: >-
                    الجلسة خارج حدود مفتاح ذي نطاق محدد (تُعاد أيضاً للجلسة
                    المحذوفة منذ لحظات)
                  value:
                    detail: Session not found.
                No AML check:
                  summary: لم تقم الجلسة بتشغيل خطوة AML على الإطلاق
                  value:
                    detail: The session does not have an AML check.
                No AML check for node:
                  summary: حقل node_id لا يتطابق مع أي فحص AML للجلسة
                  value:
                    detail: >-
                      The session does not have an AML check for node
                      'feature_aml_2'.
        '429':
          description: >-
            تم تجاوز حد المعدل: 600 طلب GET في الدقيقة لكل مفتاح API. انتظر لعدد
            الثواني المحدد في `Retry-After` قبل إعادة المحاولة؛ تُظهر رؤوس
            `X-RateLimit-*` الميزانية.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              examples:
                Rate limited:
                  summary: استُنفدت الميزانية المخصصة للدقيقة الحالية
                  value:
                    detail: >-
                      GET request rate limit exceeded. You can make up to 600
                      requests per minute.
          headers:
            Retry-After:
              description: عدد الثواني الواجب انتظارها قبل إعادة المحاولة.
              schema:
                type: integer
                minimum: 1
                example: 30
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/aml-screening-history/export/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -o aml-screening-history.csv
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            content = client.sessions.export_aml_screening_history(
                "11111111-2222-3333-4444-555555555555",
            )
            with open("download.csv", "wb") as file:
                file.write(content)
        - lang: javascript
          label: Node.js
          source: >-
            import { writeFile } from "node:fs/promises";

            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const content = await
            didit.sessions.exportAmlScreeningHistory("11111111-2222-3333-4444-555555555555");

            await writeFile("download.csv", Buffer.from(await
            content.arrayBuffer()));
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresp, err := client.Sessions.ExportAMLScreeningHistory(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SessionsExportAMLScreeningHistoryParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer resp.Body.Close()\nfile, err := os.Create(\"download.csv\")\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer file.Close()\nif _, err := io.Copy(file, resp.Body); err != nil {\n\tlog.Fatal(err)\n}"
        - lang: java
          label: Java
          source: >-
            import java.nio.file.Path;

            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            client.sessions().exportAmlScreeningHistory("11111111-2222-3333-4444-555555555555")
                    .writeTo(Path.of("download.csv"));
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $content =
            $didit->sessions->exportAmlScreeningHistory('11111111-2222-3333-4444-555555555555');

            $content->saveTo('download.csv');
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            content =
            didit.sessions.export_aml_screening_history("11111111-2222-3333-4444-555555555555")

            File.binwrite("download.csv", content)
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var content = await
            client.Sessions.ExportAmlScreeningHistoryAsync("11111111-2222-3333-4444-555555555555");

            await content.SaveToAsync("download.csv");
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.